Created
January 5, 2021 08:27
-
-
Save zeitounator/6781298b31fbaba88916ab82cd059763 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
all: | |
hosts: | |
my_vm_target: | |
ansible_host: 127.0.0.1 | |
ansible_port: 2222 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: my_vm_target | |
tasks: | |
- name: do something locally | |
command: /bin/true | |
delegate_to: localhost | |
register: toto | |
- name: do something on target | |
command: echo very interesting task | |
when: toto.stdout == "go for it" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment