Hey Brian,

I like the idea of using host_vars.

Within the playbook I will need to update host_vars based on the outcome of the 
job. For example, after emailing user jdoe​, update variable emailed_users​. 
That way, when the job runs again a few minutes later, I want the second job to 
know what work was completed on the first job so not to email jdoe​ again. 
Hopefully that example makes sense.

Is there a way within the playbook that I can add jdoe​ to emailed_users​​, and 
record that change so that the variable change persists across multipe Ansible 
Tower jobs?


Timothy Dilbert

________________________________
From: Brian Coca <bc...@redhat.com>
Sent: 11 May 2022 12:33
To: Timothy A. Dilbert | BMT <timothy.dilb...@bmt.ky>
Cc: Ansible Development <ansible-devel@googlegroups.com>
Subject: Re: [ansible-devel] Looking for generic execute "once-only" practise 
for Automations

Many ways, just an example:
 - in a handler update a host_vars/<sytemY>.yml with the list of users
already synced, notify when sync tasks run/change
 - add to sync role/block/tasks a conditional based on the variable
cdreated `when: username not in already_processed_users`



--
----------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/PH0PR17MB51824B803B5B01D81AF0383189C89%40PH0PR17MB5182.namprd17.prod.outlook.com.

Reply via email to