Created
September 14, 2018 12:37
-
-
Save decentral1se/1d1c193a9f1b8779cdea504cc9465ec2 to your computer and use it in GitHub Desktop.
groupby.yml
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 | |
connection: local | |
tasks: | |
- name: Ensure mandatory variables specified | |
assert: | |
that: env is defined | |
- name: Show execution path | |
debug: | |
msg: "USING ENVIRONMENT: {{ env }}" | |
- hosts: dev | |
vars_prompt: | |
- name: prompted_mysql_root_password | |
prompt: MySQL root password | |
- name: ansible_become_pass | |
prompt: SUDO password | |
private: true | |
tasks: | |
- name: Import dev tasks | |
import_tasks: dev/main.yml | |
- hosts: stage | |
tasks: | |
- name: Import stage tasks | |
import_tasks: stage/main.yml | |
when: env == 'stage' | |
- hosts: prod | |
tasks: | |
- name: Import prod tasks | |
import_tasks: prod/main.yml | |
when: env == 'prod' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment