Ansible 2.5.2on OSX Sierra (nodes are Centos7)
command:
> ansible-playbook -i inventory/mycluster/hosts.ini cluster.yml
error:
The error appears to have been in '/xx/kubernetes-project/kubespray/roles/vault/handlers/main.yml': line 44, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: unseal vault
^ here
It works when I checkout a specific release: (v2.5.0)
the last commit working is e23fd5ca44b23
@mattymo We now have a very strong dependency on the ansible vault module. My setup also fails now with this error.
I see the issue now that our docs has no reference to the requirements.txt and a pre-task before setting up the cluster, you need to do a sudo pip install -r requirements.txt
Yes after sudo pip install -r requirements.txt Now is working fine.
As far as I know, I didn't request vault mode, but I'm also getting this error; surely vault mode is not required now? Edit: no, but Ansible insists on loading and parsing files, including verifying module names, even if the code in those files is never executed. I'm sure there's a good reason for this.
I commented out the hashicorp_vault-requiring task, and was able to proceed
I have exact same problem... sudo pip install -r requirements.txt did not help...
Requirement already satisfied: ansible>=2.4.0 in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 1)) (2.5.4)
Requirement already satisfied: jinja2>=2.9.6 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2)) (2.10)
Requirement already satisfied: netaddr in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 3)) (0.7.18)
Requirement already satisfied: pbr>=1.6 in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 4)) (3.1.1)
Requirement already satisfied: ansible-modules-hashivault>=3.9.4 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5)) (3.9.5)
Requirement already satisfied: hvac in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 6)) (0.5.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python2.7/dist-packages (from jinja2>=2.9.6->-r requirements.txt (line 2)) (0.23)
Requirement already satisfied: requests>=2.7.0 in /usr/lib/python2.7/dist-packages (from hvac->-r requirements.txt (line 6)) (2.18.4)
@bocob the same issue
it worked for me after "sudo pip3 install -r requirements.txt"
I also have this problem.
I use mac os x latest version.
I installed ansible via brew.
I tried both sudo and regular pip install -r requiremets.txt. I also tried same command with pip3. Ring no bells.
How can I solve this problem?
I think one issue is that ansible-modules-hashivault module does not appear to install correctly on some platforms.. at least it did not for mine. using
python
then help(), and then modules to list out the modules and I find that ansible-modules-hashivault is not listed. Trying to create a test.yml file to test to see whether or not hashivault's functions shows that this module simply is not loading. Some people have suggested using the pip version of ansible instead of the package, but I have found that, that creates conflicts in some files.
ansible, btw, on redhat references python2 if you do a:
more /usr/bin/ansible
So updating python3 won't help unless you change ansible to use python3.
turns out in my case ansible-modules-hashivault was not installing the hashivault files underneath:
/usr/lib/python2.7/site-packages/ansible/modules
So I had to do:
cp -rp ansible-modules-hashivault-3.9.5/ansible/modules/hashivault /usr/lib/python2.7/site-packages/ansible/modules
And then I was able to get farther...
I still have some errors, but they are unrelated to this issue.
@arrowcircle I was in the same boat. What finally worked for me was:
pip install ansiblepip uninstall ansible-modules-hashivaultpip install ansible-modules-hashivault (it claimed it was installed prior, no idea)No sudo on any of those. I also ensured brew doctor was nice and clean.
@arrowcircle Since you are using MAC - few binaries installed with sudo might not have right permissions.
Try using "sudo ansible-playbook -i inventory/mycluster/hosts.ini cluster.yml"
Copying /usr/local/lib/python2.7/dist-packages/ansible/modules/hashivault to /usr/lib/python2.7/dist-packages/ansible/modules on AWS Ubuntu 16.04 image made a fix for me
Yes! ansible-modules-hashivault module does not appear to install correctly.
Open file requirements.txt
Then change row "ansible-modules-hashivault>=3.9.4" to "ansible-modules-hashivault"
Then sudo pip install -r requirements.txt
Its Work for me.
@bocob the same issue
it worked for me after "sudo pip3 install -r requirements.txt"
This worked for me on Ubuntu 18.04 too, after install pip3 which was missing also
For me this problem was solved by using python2.7 instead of python3.
suddenly started to happen from today, nothing changed on the hosts. Tried all the different items above.
Anyway to just comment out somewhere the vault stuff?
Most helpful comment
Yes after
sudo pip install -r requirements.txtNow is working fine.