grafana-ansible-collection
grafana-ansible-collection copied to clipboard
Add support for ansible-playbook serial > 1 (manage multiple hosts at a time)
At the moment (grafana-ansible-collection v2.2.5), it is not possible to run ansible-playbook in parallel on 2 (or more) hosts and specify different {{ grafana_agent_version }}.
Steps to reproduce:
- Crate an inventory file with 2 hosts - for example: all: children: my_db: children: db1: hosts: 10.10.10.10: db2: hosts: 10.10.11.10:
- set serial to 2 (or 100%) in your ansible playbook yaml file.
- set {{ grafana_agent_version }} variable to different versions in the respective db1 and db2 group_vars files.
- run ansible-playbook and notice how: 4.1) two distinct grafana-agent_*.zip files are downloaded on the controller host in {{ grafana_agent_local_tmp_dir }} for each respective versions. 4.2) in the same {{ grafana_agent_local_tmp_dir }} on the controller host, unzip task will run twice. Destination file has the same name, so the last unzip for ver B will override the previous unzip for ver A. 4.3) the incorrect version grafana-agent unzipped binary will get propagated to one of the remote hosts.
Workaround until a fix is provided:
- Run ansible-playbook with serial=1, one node at a time.