Created
February 26, 2018 13:08
-
-
Save mkrizek/f47bc1f4401d26487009e7f83f4edeb7 to your computer and use it in GitHub Desktop.
36028.sh
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 | |
DIR=tmp_36028 | |
mkdir -p $DIR/roles/my_role/{tasks,library} | |
cat > $DIR/playbook.yml << EOF | |
- hosts: localhost | |
gather_facts: no | |
pre_tasks: | |
- ping: | |
roles: | |
- my_role | |
EOF | |
cat > $DIR/roles/my_role/library/ping.py << EOF | |
#!/usr/bin/python | |
print('{"failed": false, "msg": "MODULE IN ROLE"}') | |
EOF | |
cat > $DIR/roles/my_role/tasks/main << EOF | |
- ping: | |
EOF | |
cat > $DIR/inventory << EOF | |
EOF | |
ansible-playbook -i $DIR/inventory $DIR/playbook.yml -v | |
rm -rf $DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment