Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ansible-playbook serial > 1 (manage multiple hosts at a time) #153

Open
georgelupu opened this issue Feb 13, 2024 · 0 comments

Comments

@georgelupu
Copy link

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:

  1. 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:
  2. set serial to 2 (or 100%) in your ansible playbook yaml file.
  3. set {{ grafana_agent_version }} variable to different versions in the respective db1 and db2 group_vars files.
  4. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant