Hi
I was trying to use aio configruation with proxy settings on my vm.
http://docs.openstack.org/developer/openstack-ansible/install-guide/app-no-internet-connectivity.html#practice-b-proxy-access-to-internet-resources
Thank you for this page.
I have one issue:
- as part of task container_create[1] tool gpg should be executed to download and check key
Module lxc[2] launches lxc-create(package lxc) and lxc-create launches lxc-download (script in package lxc-templates).
[1] https://github.com/openstack/openstack-ansible-lxc_container_create/blob/master/tasks/container_create.yml
[2] https://github.com/ansible/ansible-modules-extras/blob/devel/cloud/lxc/lxc_container.py
[3] https://github.com/lxc/lxc/blob/master/templates/lxc-download.in
My setup:
ubuntu image from canonical Ubuntu 14.04.3 LTS (was tested also with 14.04.2)
locally launched polipo with socks5
root@ephimeralnodejune240103:/opt/openstack-ansible/playbooks# git branch -v
* master 2e7c5ad Merge "Fix HAProxy config and install version when ssl is disabled"
boostrap-ansible.sh && boostral-aio.sh
in /etc/openstack_deploy/user_variables.yml added:
global_environment_variables:
HTTP_PROXY: "http://127.0.0.1:8123"
HTTPS_PROXY: "http://127.0.0.1:8123"
NO_PROXY: "localhost,127.0.0.1"
http_proxy: "http://127.0.0.1:8123"
no_proxy: "localhost,127.0.0.1"
run-playbooks.sh executed.
Error output:
........
........
........
TASK [lxc_hosts : Create base container] ***************************************
task path: /etc/ansible/roles/lxc_hosts/tasks/lxc_cache.yml:16
<172.29.236.100> ESTABLISH SSH CONNECTION FOR USER: root
<172.29.236.100> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=120 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 172.29.236.100 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python && sleep 0'"'"''
FAILED - RETRYING: TASK: lxc_hosts : Create base container (2 retries left).Result was: {"attempts": 1, "command": "/usr/bin/lxc-create --name LXC_NAME --quiet --template download --bdev dir -- --dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org\n", "err": "", "failed": true, "invocation": {"module_args": {"archive": false, "archive_compression": "gzip", "archive_path": null, "backing_store": "dir", "clone_name": null, "clone_snapshot": false, "config": null, "container_command": null, "container_config": null, "container_log": false, "container_log_level": "INFO", "directory": null, "fs_size": "5G", "fs_type": "ext4", "lv_name": "LXC_NAME", "lxc_path": null, "name": "LXC_NAME", "state": "stopped", "template": "download", "template_options": "--dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org\n", "thinpool": null, "vg_name": "lxc", "zfs_root": null}, "module_name": "lxc_container"}, "msg": "Failed executing lxc-create.", "rc": 1, "retries": 3}
<172.29.236.100> ESTABLISH SSH CONNECTION FOR USER: root
<172.29.236.100> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=120 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 172.29.236.100 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python && sleep 0'"'"''
FAILED - RETRYING: TASK: lxc_hosts : Create base container (1 retries left).Result was: {"attempts": 2, "command": "/usr/bin/lxc-create --name LXC_NAME --quiet --template download --bdev dir -- --dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org\n", "err": "", "failed": true, "invocation": {"module_args": {"archive": false, "archive_compression": "gzip", "archive_path": null, "backing_store": "dir", "clone_name": null, "clone_snapshot": false, "config": null, "container_command": null, "container_config": null, "container_log": false, "container_log_level": "INFO", "directory": null, "fs_size": "5G", "fs_type": "ext4", "lv_name": "LXC_NAME", "lxc_path": null, "name": "LXC_NAME", "state": "stopped", "template": "download", "template_options": "--dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org\n", "thinpool": null, "vg_name": "lxc", "zfs_root": null}, "module_name": "lxc_container"}, "msg": "Failed executing lxc-create.", "rc": 1, "retries": 3}
<172.29.236.100> ESTABLISH SSH CONNECTION FOR USER: root
<172.29.236.100> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=120 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 172.29.236.100 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python && sleep 0'"'"''
fatal: [aio1]: FAILED! => {"changed": false, "command": "/usr/bin/lxc-create --name LXC_NAME --quiet --template download --bdev dir -- --dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org\n", "err": "", "failed": true, "invocation": {"module_args": {"archive": false, "archive_compression": "gzip", "archive_path": null, "backing_store": "dir", "clone_name": null, "clone_snapshot": false, "config": null, "container_command": null, "container_config": null, "container_log": false, "container_log_level": "INFO", "directory": null, "fs_size": "5G", "fs_type": "ext4", "lv_name": "LXC_NAME", "lxc_path": null, "name": "LXC_NAME", "state": "stopped", "template": "download", "template_options": "--dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org\n", "thinpool": null, "vg_name": "lxc", "zfs_root": null}, "module_name": "lxc_container"}, "msg": "Failed executing lxc-create.", "rc": 1}
command: /usr/bin/lxc-create --name LXC_NAME --quiet --template download --bdev dir -- --dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org
msg: Failed executing lxc-create.
command: /usr/bin/lxc-create --name LXC_NAME --quiet --template download --bdev dir -- --dist ubuntu --release trusty --arch amd64 --force-cache --server images.linuxcontainers.org
msg: Failed executing lxc-create.
to retry, use: --limit @lxc-hosts-setup.retry
PLAY RECAP *********************************************************************
aio1 : ok=37 changed=5 unreachable=0 failed=1
TASK: lxc_hosts : Create base container ------------------------------ 1100.75s
TASK: pip_install : Install PIP ----------------------------------------- 2.42s
TASK: lxc_hosts : Create base directories ------------------------------- 1.57s
TASK: lxc_hosts : Drop base config file(s) ------------------------------ 1.48s
TASK: lxc_hosts : Install pip packages ---------------------------------- 1.14s
TASK: lxc_hosts : Install apt packages ---------------------------------- 0.83s
TASK: pip_install : Create pip config directory ------------------------- 0.77s
TASK: pip_install : Get Modern PIP -------------------------------------- 0.51s
TASK: pip_install : Drop pip file(s) ------------------------------------ 0.46s
TASK: lxc_hosts : Remove dnsmasq file(s) -------------------------------- 0.45s
Hit maximum number of retries, giving up...
+ cat /openstack/log/instance-info/host_info_1467417041.log
----------------------------------------------------------------------
I've checked that my variable are presented in /etc/environment but there is not such variable in environment of processes.
pstree -p
....
├─sshd(3673)───sh(30309)───python(30310)───python(30311)───lxc-create(30312)───lxc-download(30314)───gpg(30325)───gpgkeys_hkp(30326)
....
cat /proc/30325/environ | grep http|HTTP
there is no such variable in parent processes starting from sshd.
if I execute "ssh localhost", I can see this vars in my shell environment.
----------------------------------------------------------------------
Temporary solution that was workign for me:
add proxy variables to .bashrc and next attempt will be successfull.
I would like to add this variables in /etc/profile in https://github.com/openstack/openstack-ansible-lxc_container_create/blob/master/tasks/container_create.yml#L183
There was a bug about proxy (https://bugs.launchpad.net/openstack-ansible/+bug/1493570) but I think it is outdated. This one is related with gpg and current implementation of exporting variables though /etc/environment file.
Few things that was asked in irc chat:
- UsePAM has yes in sshd_config.
- pam_env.conf does not use /etc/environment. grep -c -v "^#.*$" /etc/security/pam_env.conf = 0
Maybe it somehow specific with 14.04.3 LTS. will repeat it on 14.04.4
Thank you for your bug submission. We'll wait for your next input.