Amazon Linux 2 instances are operated upon by an Ansible Playbook which performs multiple yum tasks one after the other.
What specific changes need to be made to the syntax below in order for the successive
yumtasks to run without stopping due to process conflicts?
Currently, the second yum task below is failing because Ansible does not know how to handle hearing that the preceding yum task has not yet let go of the yum lockfile.
Here is the current error message that files when the second yum task below is called:
TASK [remove any previous versions of specific stuff] ************************************************************************************************************************************
fatal: [10.1.0.232]: FAILED! => {"changed": false, "msg": "yum lockfile is held by another process"}
The two successive yum tasks are currently written as follows:
- name: Perform yum update of all packages
yum:
name: '*'
state: latest
- name: remove any previous versions of specific stuff
yum:
name: thing1, thing2, thing3, thing4, thing5, thing6
state: absent
I imagine the solution is just to add something telling Ansible to wait until the first task's yum lock has been released. But what syntax should be used for this?