This is one of those answers I dislike the most. Generalized, it goes:
> Q. I want to do X but I don't know how.
> A. Want something else.

There are so many levels here it's hard to know where to start. But the 
first thing that pops out is that you've got "state: absent" on your first 
task, so you're just removing some packages. That will not take long, and 
if it does, waiting longer isn't going to help. In the case that your 
"state: absent" is just a copy/paste error (like, you were resetting to 
"initial conditions" to try your technique again and inadvertently copied 
that into your question), then perhaps you're waiting on some other process 
to get the host into a state where the packages can be installed. If so, 
I'd suggest you focus on managing that process rather than using the yum 
task to act as a proxy for it.

Next, there are lots of tricky interactions to consider in creating 
"strategies" — Ansible's term for the different ways to batch, group, 
schedule, and generally manage the running of tasks on various hosts. While 
lots of modules have associated action plugins, I seriously doubt it would 
be worth the effort - if it's even possible - to implement a multi-module 
action plugin and integrate it cleanly into Ansible's architecture. Rather, 
this feels to me a better fit for workflows in AWX/Tower or maybe 
ansible-runner which I believe is the bit from AWX that handles job 
scheduling/workflows, but I've not gone there before. At any rate, if I 
were trying to do what you're thinking about, that's the direction I'd go 
in.

Which brings us to the questions I probably should have started with: (a) 
What is the problem you're actually trying to solve, and (b) what is unique 
about your situation that makes the envisioned solution the way to go when 
nobody else has implemented this already?

On Thursday, March 30, 2023 at 1:55:52 AM UTC-4 Neha Singh wrote:

> Hi Team,
>
> Need some help to develop an action plugin script using two modules. Below 
> is my ansible playbook code:
>
> - name: Ensure packages are installed   yum:     name:       - 
> xorg-x11-server*       - dhcp       - bind       - vsftpd       - dovecot   
>     - samba       - squid       - net-snmp       - ypserv       - ypbind   
>     - rsh       - telnet-server       - telnet     state: absent   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: nohup python /opt/ibm/si/saas/ansible/test_neha.py   register: 
> console_job_results   until: console_job_results.finished   retries: 100
>
> Here above in the second task, I am calling two ansible modules at once 
> (shell & async_status) which is giving me the error *ERROR! conflicting 
> action statements: shell, async_status*, so as an alternative I am now 
> trying to develop an action plugin, which can call two ansible modules at 
> once.  Now here, async_status module will go on iteration till the job 
> finished, so on each iteration, I want to call the python script. Thats why 
> going with the approach of developing action plugin. 
> Need some help regarding the same
>
> Thanks & Regards
> Neha Singh
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/27c431d9-094d-4f99-8f3e-0c495b2ed4a0n%40googlegroups.com.

Reply via email to