When I get that error, it's usually because Ansible didn't try to sudo to the root user, or Ansible's attempt to sudo was not successful.
Does invoking lots of verbose messages with the -vvvv option to the ansible-playbook command show a successful sudo? -Greg On Wed, Nov 12, 2014 at 3:38 AM, <[email protected]> wrote: > Hi folks. > > I try to run such yaml using *ansible 1.8 *via Web-UI Tower: > --- > - name: setup steps that are not specific to a particular role or project > hosts: all > sudo: True > user: rnd > gather_facts: True > > tasks: > > - name: update apt cache > apt: > update_cache: yes > > - name: ensure required base packages are present > apt: > pkg: "{{ item }}" > state: latest > update_cache: yes > cache_valid_time: 600 > with_items: > - chrony > - python-mysqldb > - python-software-properties > > > And have such result: > SSH password: > sudo password [defaults to SSH password]: > PLAY [setup steps that are not specific to a particular role or project] > ****** GATHERING FACTS > *************************************************************** > ok: > [172.20.6.85] TASK: [update apt cache] > ****************************************************** > > failed: [172.20.6.85] => {"failed": true} > > *msg: Failed to lock apt for exclusive operation* > > FATAL: all hosts have already failed -- aborting > PLAY RECAP > ******************************************************************** > to retry, use: --limit @/var/lib/awx/openstack.yaml.retry 172.20.6.85 : ok > =1 changed=0 unreachable=0 failed=1 > > Could you please suggest me how to solve this problem. > > Thanks. > > > > > > -- > 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/ab84f2b8-545d-47db-9aa9-b6f79820843a%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/ab84f2b8-545d-47db-9aa9-b6f79820843a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAPdwyX4RfCHGtYe%3DJ_K_djnPeUgkqJFAcxAu96VDPuaLw1eRmg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
