Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

299
Visualizações
Ansible - using npm with a proxy

I have this Ansible code:

- name: Installing project files
  shell: |
    cd /opt/ewd-server
    npm install
  become_user: prod-{{SITE}}

Every time I run the code and it reaches that part it keeps saying that the server doesn't have the proxy up. Even thought I executed 2 commands before that:

npm config set https-proxy
npm config set proxy

The values are actually the companies IP's, but redacted for obvious reasons.

The code keeps running until it reaches the 'npm install' task, stays for about half an hour, then Ansible gives the error 'ENOENT'.

NOTE: when I run the npm install command in the server without Ansible it works.

If anyone knows any replacement for npm that works with Ansible, or a solution for this issue please help.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Try configuring the environment variables 'http_proxy' and 'https_proxy':

 - name: Installing project files, using a specific proxy
     shell: |
              cd /opt/ewd-server
              npm install
     become_user: prod-{{SITE}}
     environment:
       http_proxy: http://proxy.adres
       https_proxy: http://proxy.adres

Of course, edit the proxy values.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda