我尝试使用代理Squid安装https://github.com/solval/ansible-role-gitlab_runner。
我使用http_proxy,https_proxy添加了环境
cat gitlab-runner.yml
- hosts: gitlab-runner
become: yes
roles:
- solval.gitlab_runner
environment:
http_proxy: http://192.168.88.249:3128
https_proxy: http://192.168.88.249:3128
如果重写任务:
- name: RHEL Install GitLab GPG
rpm_key:
state: present
key: https://packages.gitlab.com/gpg.key
environment:
http_proxy: http://192.168.88.249:3128
https_proxy: http://192.168.88.249:3128
become: yes
具有环境的任务(http_proxy,https_proxy)-正常工作。 如果环境在剧本中定义,为什么在任务中没有定义环境? 坦克!