# Commands needed for NPM Set registry, NPM set proxy and untar  a tgz file in ansible

**URL:** <https://forum.ansible.com/t/commands-needed-for-npm-set-registry-npm-set-proxy-and-untar-a-tgz-file-in-ansible/25405>\
**Category:** Ansible Project\
**Created:** [September 5, 2017, 9:09am UTC](https://forum.ansible.com/t/commands-needed-for-npm-set-registry-npm-set-proxy-and-untar-a-tgz-file-in-ansible/25405 "2017-09-05T09:09:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManiGandan\_T](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@ManiGandan\_T](https://forum.ansible.com/u/ManiGandan_T)\
**Post date:** [September 5, 2017, 9:09am UTC](https://forum.ansible.com/t/commands-needed-for-npm-set-registry-npm-set-proxy-and-untar-a-tgz-file-in-ansible/25405/1 "2017-09-05T09:09:13Z")

</div>

Hi Team,

I am logically creating a code in ansible-container with reference of a nodejs application container code written using docker. I am not able to find the exact syntax to change the below docker code. Could someone help me on this.

RUN npm config set registry [http://registry.npmjs.org/](http://registry.npmjs.org/) - Set npm  
RUN npm config set proxy [http://prod-proxy-out.xxxx.com:8080](http://prod-proxy-out.xxxx.com:8080/) - set proxy using npm  
RUN tar -xzf \*.tgz - untar a existing tar file

I tried these options, but they are not working

Approach 1:

shell: npm config set registry “{{ nodejs\_npm\_registry }}”  
when: nodejs\_npm\_registry != “[https://registry.npmjs.org/](https://registry.npmjs.org/)”  
Approach 2;

- name: Set NPM registry  
command: ‘npm config set registry [http://registry.npmjs.org/](http://registry.npmjs.org/)’

Approach used for Untar:

unarchive:  
src: “{{ node\_package\_url }}”  
dest: “{{ app\_home\_path }}”  
copy: no  
mode: 0777

None of the above is working. please guide me with proper steps so that i can proceed and run the code by changing the docker file syntax.

TIA!
