Skip to content

Instantly share code, notes, and snippets.

@ssbarnea
Created May 16, 2023 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssbarnea/c11db6b4bf4ba3d6bfb46e316dfdda76 to your computer and use it in GitHub Desktop.
Save ssbarnea/c11db6b4bf4ba3d6bfb46e316dfdda76 to your computer and use it in GitHub Desktop.
---
- name: cleanup
hosts: localhost
gather_facts: false
tasks:
- name: Cleanup
debug:
msg: "Doing cleanup"
- name: Foo
standalone_module1: {}
tags:
- cleanup
- name: prepare
hosts: localhost
gather_facts: false
tasks:
- name: Prepare
debug:
msg: "Doing prepare"
- name: Add new host to tests group
ansible.builtin.add_host:
name: 127.0.0.1
groups: test_group
- name: converge
hosts: test_group # <-- this should now contain one host, but it does not
gather_facts: false
tasks:
- name: converge
debug:
msg: "Doing converge"
- name: destroy
hosts: localhost
gather_facts: false
tasks:
- name: Destroy
debug:
msg: "Doing destroy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment