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
| [vagrant@localhost ~]$ curl -O https://github.com/needim/noty/archive/v2.1.0.tar.gz | |
| % Total % Received % Xferd Average Speed Time Time Time Current | |
| Dload Upload Total Spent Left Speed | |
| 119 119 119 119 0 0 218 0 --:--:-- --:--:-- --:--:-- 1025 | |
| [vagrant@localhost ~]$ tar zxvf v2.1.0.tar.gz | |
| gzip: stdin: not in gzip format | |
| tar: Child returned status 1 | |
| tar: Error is not recoverable: exiting now | |
| [vagrant@localhost ~]$ file v2.1.0.tar.gz |
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: localhost | |
| connection: local | |
| vars: | |
| - x: "{{ 'False'|bool }}" | |
| tasks: |
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
| [webservers] | |
| my-staging-webserver-1 | |
| my-staging-webserver-2 | |
| my-prod-webserver-1 | |
| my-prod-webserver-2 | |
| [staging] | |
| my-staging-webserver-1 | |
| my-staging-webserver-2 |
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
| - include: packages.yml | |
| - include: config.yml |
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: all | |
| vars: | |
| cluster_interface: eth0 | |
| tasks: | |
| - name: debug me | |
| debug: msg="{{ hostvars[inventory_hostname]["ansible_" + cluster_interface]["ipv4"]["address"] }}" |
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: webserver1 | |
| gather_facts: false | |
| vars: | |
| create_command: 'echo -e \"FOO=bar\\necho hello" > /tmp/sh.sh' | |
| tasks: | |
| - name: create the shell script | |
| raw: sh -c "{{create_command}}" |
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: all | |
| vars: | |
| testvar: helloo | |
| tasks: | |
| - name: debug me | |
| debug: msg="{{ testvar }}" |
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
| 2013-08-12 07:10:43,089 p=12814 u=root | /root/git/ansible/bin/ansible-playbook -i hosts test-when.yml | |
| 2013-08-12 07:10:43,089 p=12814 u=root | | |
| 2013-08-12 07:10:43,097 p=12814 u=root | PLAY [all] ******************************************************************** | |
| 2013-08-12 07:10:43,097 p=12814 u=root | GATHERING FACTS *************************************************************** | |
| 2013-08-12 07:10:44,678 p=12814 u=root | ok: [webserver1] | |
| 2013-08-12 07:10:46,592 p=12814 u=root | fatal: [webserver2] => {'msg': 'FAILED: [Errno 113] No route to host', 'failed': True} | |
| 2013-08-12 07:10:46,606 p=12814 u=root | TASK: [hello] ***************************************************************** | |
| 2013-08-12 07:10:46,657 p=12814 u=root | skipping: [webserver1] | |
| 2013-08-12 07:10:46,697 p=12814 u=root | PLAY RECAP ******************************************************************** | |
| 2013-08-12 07:10:46,701 p=12814 u=root | to retry, use: --limit @/var/tmp/ansible/test-when.retry |
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: all | |
| vars: | |
| debug: True | |
| tasks: | |
| - name: get path | |
| shell: "echo $PATH" | |
| register: last_result |
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
| --- | |
| # This playbook deploys the whole application stack in this site. | |
| # apply common configuration to all hosts | |
| - hosts: all | |
| roles: | |
| - common | |
| - hosts: dbservers | |
| user: root |