Created
July 31, 2015 13:37
-
-
Save foxmask/b3c958169933e044f7b0 to your computer and use it in GitHub Desktop.
definir des variables à la volée
This file contains 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: localhost | |
tasks: | |
- name: definissons une variable | |
command: echo Fox | |
register: mimi | |
- name: premiere variable | |
debug: msg="premiere variable {{ mimi.stdout }}" | |
when: mimi | |
- name: definissons une autre variable | |
command: echo MaSk | |
register: rara | |
- name: seconde variable | |
debug: msg="seconde variable {{ rara.stdout }}" | |
when: rara | |
- name: Tout le monde ensemble | |
command: echo {{ mimi.stdout }}{{ rara.stdout }} | |
when: mimi and rara | |
register: mimirara | |
- name: Tout le monde ensemble autrement | |
command: echo {{ mimirara.stdout }} | |
when: mimirara | |
- name: la totale | |
debug: msg="la totale en 2 bouts {{ mimi.stdout }}{{ rara.stdout }}" | |
when: mimi and rara | |
- name: la totale | |
debug: msg="la totale {{ mimirara.stdout }}" | |
when: mimirara |
Author
foxmask
commented
Jul 31, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment