Пытаюсь установить запустить ansible-playbook (kubespray) через прокси.
Вот здесь указал прокси сервер: https://github.com/kubernetes-incubator/kubespray/blob/master/inventory/sampl...
Добавил в таску Install packages requirements for bootstrap
environment: "{{proxy_env}}"
https://github.com/kubernetes-incubator/kubespray/blob/master/roles/bootstrap...
Выдает ошибку
Trying other mirror.
Если в этом yaml файле сделать вот такую таску:
- name: echo Variables
shell: "echo $http_proxy $https_proxy"
register: shell_echo_proxy
environment: "{{proxy_env}}"
- debug:
var: shell_echo_proxy.stdout
То будет вот такая ошибка:
The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'
The error appears to have been in '/home/user/kubespray/roles/bootstrap-os/tasks/bootstrap-centos.yml': line 17, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: echo Variables
^ here
Кто знает как исправить ошибку или как запустить установку пакетов через прокси?
Если проверить переменные, то можно увидеть что переменная есть и заполнена
ansible kuber1 -i inventory/sample/hosts.ini -m setup |grep -C 10 ansible_default_ipv4
"month": "11",
"second": "26",
"time": "06:02:26",
"tz": "EST",
"tz_offset": "-0500",
"weekday": "Sunday",
"weekday_number": "0",
"weeknumber": "44",
"year": "2018"
},
"ansible_default_ipv4": {
"address": "172.16.149.93",
"alias": "enp0s3",
"broadcast": "172.16.149.255",
"gateway": "172.16.149.1",
"interface": "enp0s3",
"macaddress": "08:00:27:26:a9:de",
"mtu": 1500,
"netmask": "255.255.255.0",
"network": "172.16.149.0",
"type": "ether"