ara_playbook/ara_record: set BYPASS_HOST_LOOP to run once
These action plugins interact with the API to get a playbook or add a key/value record. When run against an inventory of 100 hosts, these shouldn't be running 100 times as they only need to run once to retrieve or set the data.
-1
ara_playbook has a stronger case for using this, but even there I could see someone wanting to retrieve a different playbook based on the current host (e.g. storing the playbook ID that generated a machine image in a file, then using the contents of that file as playbook_id).
ara_record can currently be used for storing per-host records, which this change would prevent.
Purely per-host records could be argued to be against the design intent of the action, but consider something that's merely reliant on a value that can vary across hosts, like:
- ara_record:
key: foo_version_{{ foo_version }}
value: true
Hey @flowerysong, thanks for the input and you're right, I agree.
This originates from a user asking about why the modules were running N times for N hosts and perhaps the better approach is instead to add a suggestion/recommendation to set run_once on the task unless there is a use case like the ones you mentioned.
Putting this in draft, I have no intention of merging it but keeping it opened as a reminder for now.