Call async_status & python script in one task (Failed error message)

8 views
Skip to first unread message

Neha Singh

unread,
Feb 21, 2023, 3:31:33 AM2/21/23
to Ansible Development
Hi Team,

Below are the two tasks which I am including in playbook. Main agenda is that, when my packages are installing, at that time rather than just getting  waiting or retried message, I wanted some customised message to print as well. That xustomized message, I am retrieving from python script (in 2nd task)

- name: Ensure packages are installed
  yum:
    name:
      - xorg-x11-server*
      - dhcp
      - bind
      - vsftpd
      - dovecot
    state: present
  async: 86400 #24 hours
  poll: 0
  register: yum_installer

- name: Waiting for yum package installation to complete
  async_status: jid={{ yum_installer.ansible_job_id }}
  shell: python /opt/ibm/si/saas/ansible/test_neha.py
  register: console_job_results
  until: console_job_results.finished
  retries: 100
  delay: 10


But I am getting the error ERROR! conflicting action statements: shell, async_status here. Can you please suggest something, what should be the next thing to do here. I really need some customised message to print, which I am retrieving from python script. Is there any way to include both async_status & python script module in one task.

Thanks 
Neha Singh
Reply all
Reply to author
Forward
0 new messages