By using `module_defaults` in a play, you can impact all uses of an
underlying module.

This can be done for `yum`, even if using the `package` module.

https://docs.ansible.com/ansible/latest/user_guide/playbooks_module_defaults.html

There is however a bug in Ansible 2.8 that prevents this from working right
now, but a backport PR is waiting to be merged:

https://github.com/ansible/ansible/pull/56400

On Thu, Jun 27, 2019 at 2:59 PM Scott Lundgren <[email protected]> wrote:

> If I'm calling the role newrelic.newrelic-infra that uses the package
> module
> <https://github.com/newrelic/infrastructure-agent-ansible/blob/34e290787a83a47d4edb77dcae7685c942515a39/tasks/install_dist_pkgs.yml#L85>,
> is there a way to set or override lock_timeout's default value of 0 ?
> Can you suggest another solution than forking the role, rewriting the task
> in an OS dependent way using the yum module and setting lock_timeout ?
>
> I have a simple playbook below to setup a web application firewall. I'm
> using Amazon Linux 2 (4.14.123-111.109.amzn2.x86_64) with python (v2.7.14)
> that has installed Ansible (v2.8.1) via pip. Packer (v1.4.1) builds of
> AMI's thru ansible_local fail with
>
> amazon-ebs: TASK [roles/newrelic.newrelic-infra : install agent]
> ***************************
> amazon-ebs: fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "yum
> lockfile is held by another process"}
>
> ---
> - hosts: all
>   become: true
>   roles:
>     - roles/geerlingguy.apache
>     - roles/newrelic.newrelic-infra
>     - roles/ansible-role-apache-modsecurity
>     - roles/nickhammond.logrotate
>   tasks:
> <-- snip -->
>
> --
> 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/55d1ab83-32c1-43fa-9bd5-9b4dbefcab4f%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/55d1ab83-32c1-43fa-9bd5-9b4dbefcab4f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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/CAD8N0v9jzpsNOR4F0XedwThsj3KSbWLrayBSkNzAyFvT3xu_7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to