Created
December 11, 2017 20:49
-
-
Save mkrizek/77df149b0bb0ee6ec766a50875de0edb to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
TMP_DIR=tmp_group_vars | |
mkdir -p $TMP_DIR/{dir,group_vars,inv}/ | |
cat > $TMP_DIR/playbook.yml << EOF | |
- include: dir/playbook2.yml | |
EOF | |
cat > $TMP_DIR/group_vars/all << EOF | |
group_vars_variable_play: true | |
EOF | |
cat > $TMP_DIR/dir/playbook2.yml << EOF | |
- hosts: localhost | |
tasks: | |
- debug: var=group_vars_variable_play | |
EOF | |
touch $TMP_DIR/inventory | |
touch $TMP_DIR/inv/inventory | |
ansible-playbook -i $TMP_DIR/inv/inventory $TMP_DIR/playbook.yml | |
ansible-playbook -i $TMP_DIR/inventory $TMP_DIR/playbook.yml | |
rm -rf $TMP_DIR/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment