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
| - name: Install Apache | |
| apt: name={{ item }} state=present | |
| with_items: | |
| - apache2-mpm-prefork | |
| - libapache2-mod-php5 |
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
| tasks: | |
| - name: install prerequisite packages | |
| apt: | |
| update_cache: yes | |
| name: "{{ item }}" | |
| install_recommends: no | |
| state: latest | |
| with_items: | |
| - nginx | |
| - python-pip |
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
| Space-separated values: {{ (l1+l2+l3)|join(" ") }} |
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
| - name: Terminate legacy instance(s) | |
| ec2: | |
| region: '{{ region }}' | |
| zone: '{{ zone }}' | |
| keypair: '{{ keypair }}' | |
| group: '{{ security_group }}' | |
| image: '{{ image }}' | |
| instance_ids: '{{ ansible_ec2_instance_id }}' | |
| state: absent | |
| wait: yes |
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
| [root@awxbox2 ~]# supervisorctl stop awx-celeryd | |
| ^[[A^CTraceback (most recent call last): | |
| File "/usr/bin/supervisorctl", line 6, in <module> | |
| main() | |
| File "/usr/lib/python2.6/site-packages/supervisor/supervisorctl.py", line 598, in main | |
| c.onecmd(" ".join(options.args)) | |
| File "/usr/lib/python2.6/site-packages/supervisor/supervisorctl.py", line 86, in onecmd | |
| return func(arg) | |
| File "/usr/lib/python2.6/site-packages/supervisor/supervisorctl.py", line 433, in do_stop | |
| result = supervisor.stopProcess(processname) |
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
| - name: my sudo task | |
| command: uptime | |
| sudo: yes |
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 | |
| gather_facts: false | |
| tasks: | |
| - name: Create the security group | |
| ec2_group: | |
| name: sshonly |
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
| Timothys-MacBook-Pro:ansible-test tgerla$ ansible-playbook -i localhost, test-vars.yml | |
| PLAY [localhost] ************************************************************** | |
| GATHERING FACTS *************************************************************** | |
| ok: [localhost] | |
| TASK: [debug msg="VLAN for our IP is {{ip_vlan_mapping[ip]}}"] **************** | |
| ok: [localhost] => { | |
| "msg": "VLAN for our IP is 997" |
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
| - name: do something not sudo | |
| command: echo hello | |
| sudo: no |
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
| - name: test file existence | |
| stat: file=filename.txt | |
| register: st | |
| - name: do something | |
| shell: ... | |
| when: st.stat.exists |
OlderNewer