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

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/ - Set npm
RUN npm config set proxy 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/
Approach 2;

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!