I’m running into an issue trying to manage updates to my FreePBX systems with Ansible, including not only system updates via yum but also FreePBX updates using fwconsole.
According to @lgaetz, the issue is occurring because of a “background check that determines if there are any pending system or PBX updates.” However sometimes I get this result as part of the second part of my playbook, described below.
Unfortunately this is exactly what I am trying to accomplish – updating FreePBX. And because of the way Ansible works, I get this ‘The command is already running in another process.’ error unless I spam my playbook a few times after the initial playbook is run. The playbook currently runs the command “fwconsole ma showupgrades”, checks the output to see if there are updates, and if there are, it runs ‘fwconsole ma upgradeall’, followed by ‘fwconsole r’.
Is there a way I can disable the background check from running? Or possibly can you provide more specific information about how this background check works so I can accommodate it better?
I found that this runs fairly quickly and while my first instinct was to kill the process, after seeing how it ran and finished fairly quickly, I decided instead to add a short 10-second sleep command to my Ansible playbook before running fwconsole. Note that I am testing on a system where updates are already applied, so that may have something to do with the time it takes for the command above to run. In that case, a sleep command longer than 10s may be necessary.
So instead of:
tasks:
- name: check packages for updates
shell: fwconsole ma showupgrades
changed_when: "'Upgradable' in check.stdout"
args:
warn: false
register: check
I updated my playbook to:
tasks:
- name: check packages for updates
shell: |
sleep 10s
fwconsole ma showupgrades
changed_when: "'Upgradable' in check.stdout"
args:
warn: false
register: check
This change seems to result in the playbook running successfully.