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 | |
tasks: | |
- debug: msg="{{ item.src }} and {{ item.dest }}" | |
with_items: | |
- { src: "{{ ansible_hostname }}", dest: /tmp/foo } | |
- { src: "{{ ansible_os_family }}", dest: /tmp/bar } |
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
--- | |
- | |
job: | |
builders: | |
- | |
ssh-builder: | |
command: | | |
"sleep 60 | |
echo $sudopass | sudo -S docker pull myimage |
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: all | |
vars: | |
users: | |
- user1 | |
- user2 | |
tasks: | |
- name: create users | |
user: name={{item}} state=present | |
with_items: users |
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
# vars/amazon.yml | |
--- | |
foo: bar |
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
# /tmp/example_otpions.txt | |
rw,noatime,data=ordered,acl |
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 | |
tasks: | |
- name: create a tmp file | |
lineinfile: dest=/tmp/head line=BODY create=yes | |
# the task will be marked 'ok', because the output contains 'BODY', not 'HEAD' | |
- name: cat head | |
command: cat /tmp/head | |
register: response |
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: testserver | |
remote_user: root | |
roles: | |
- { role: configs } | |
- { role: users } | |
- { role: sudo } |
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
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [test] ****************************************************************** | |
ok: [localhost] => (item={'value': {'smf_name': 'trollname', 'method': 'trollimethod', 'manifest': 'trollifest'}, 'key': 'troll'}) => { | |
"item": { | |
"key": "troll", | |
"value": { | |
"manifest": "trollifest", | |
"method": "trollimethod", |
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
tasks: | |
- name: Launch instance | |
ec2: | |
keypair: "{{ keypair }}" | |
instance_profile_name: "{{ instance_profile_name }}" | |
group: "{{ security_group }}" | |
region: "{{ aws_region }}" | |
instance_type: "{{ instance_type }}" | |
image: "{{ image }}" | |
wait: yes |
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
# /tmp/foo | |
bar |
OlderNewer