Kitware / HPCCloud-deploy

VM Deploy for HPC-Cloud
Apache License 2.0
18 stars 4 forks source link

ansible errors on provision or up #78

Open TristanWright opened 7 years ago

TristanWright commented 7 years ago

Ansible version is 2.1?

(girder)elysium:HPCCloud-deploy tristan$ vagrant provision
==> hpccloud: Running provisioner: ansible...
    hpccloud: Running ansible-playbook...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit='hpccloud' --inventory-file=/Users/tristan/Envs/girder/HPCCloud-deploy/.vagrant/provisioners/ansible/inventory --extra-vars={"default_user":"vagrant","development":"1","hpccloud_password":"letmein","demo":false} -vv ansible/site.yml

PLAY [None] ******************************************************************* 

GATHERING FACTS *************************************************************** 
<127.0.0.1> REMOTE_MODULE setup
ok: [hpccloud]

TASK: [fail msg="Playbook requires ansible >= {{required_ansible_version}}"] *** 
failed: [hpccloud] => {"failed": true}
msg: Playbook requires ansible >= 2.0.2

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/Users/tristan/site.retry

hpccloud                   : ok=1    changed=0    unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
(girder)elysium:HPCCloud-deploy tristan$ 
cjh1 commented 7 years ago

Yes 2.1 will do it.

TristanWright commented 7 years ago

wait...

(girder)elysium:HPCCloud-deploy tristan$ ansible --version
ansible 1.9.4

why would I keep getting this after

sudo pip install --upgrade ansible==2.1
TristanWright commented 7 years ago

it was falling back on an ansible version I had in /usr/bin/python instead of virtualenv's x_X

closing

TristanWright commented 7 years ago

Different message now:

{"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when 
becoming an unprivileged user. For information on working around this, see 
https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}

Nothing apparent in the docs, not like I need to run sudo vagrant up?

cjh1 commented 7 years ago

What task is it failing on?

TristanWright commented 7 years ago
...
PLAY [Common configuration] ****************************************************

TASK [setup] *******************************************************************
fatal: [hpccloud]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user. For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @ansible/site.retry

PLAY RECAP *********************************************************************
hpccloud                   : ok=6    changed=4    unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
cjh1 commented 7 years ago

Please try this, in ansible/roles/common/tasks/main.yml please add 'become: yes', where ever you see become_user

kotfic commented 7 years ago

This is a known issue that is common for vagrant deployments because the default user for connecting to the machine is vagrant not root. This means when ever you become a non-root user (e.g. hpccloud or celery) you run into the 'becoming an unprivileged user' error. Because the machine is a trusted host (its a VM after all) I would recommend we add allow_world_readable_tmpfiles to the Vagrantfile's ansible.extra_vars which (i believe) should resolve the issue.

TristanWright commented 7 years ago

Tried rebranching from master added allow_world_readable_tmpfiles: true to ansible.extra_vars with no luck

kotfic commented 7 years ago

This may need to go into the ansible.cfg file to work (e.g. it may be processed before extra_vars are taken into account). If that doesn't work we'll have to do a little deeper digging.