On 28.08.2018 16:12, [email protected] wrote:
I just checked the ansible version, it was quite old, version 2.2
I updated, now it is version 2.6
The earlier problem is resolved, though I have another problem now.
When running the playbook below, it throws error. I am running in
*vagrant*.
- name: ensure Nginx is installed via the system package
apt: name=nginx state=present update_cache=yes
sudo: yes
ansible-playbook -i hosts site.yml --tags acceptance
....
TASK [common : ensure Nginx is installed via the system package]
***********************************************************************************************
fatal: [195.121.71.148]: FAILED! => {"changed": false, "msg": "Failed
to
lock apt for exclusive operation"}
....
Does this have to do with the user?
If you check the top of the message you'll something about ignoring sudo
or something like that.
That's because sudo is deprecated if favor of become and partially
removed in Ansible 2.6.
Change "sudo: yes" to "become: yes" and it should work.
--
Kai Stian Olstad
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/46f4af4afb777f1b69d1cfca2afa385c%40olstad.com.
For more options, visit https://groups.google.com/d/optout.