Skip to content

Commit

Permalink
Add YAML files from bitbucket repository
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaska committed Jun 25, 2014
1 parent cfb8027 commit e7e1799
Show file tree
Hide file tree
Showing 13 changed files with 369 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aws_credentials_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

# Tests whether two environment variables are present (and non-empty)

- hosts: local
connection: local
tasks:
- shell: 'test -n "${AWS_ACCESS_KEY}"'
- shell: 'test -n "${AWS_SECRET_KEY}"'
154 changes: 154 additions & 0 deletions debug-50.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---

- hosts: all
gather_facts: false
tasks:
- debug: msg='01'
- pause: seconds=1

- debug: msg='02'
- pause: seconds=1

- debug: msg='03'
- pause: seconds=1

- debug: msg='04'
- pause: seconds=1

- debug: msg='05'
- pause: seconds=1

- debug: msg='06'
- pause: seconds=1

- debug: msg='07'
- pause: seconds=1

- debug: msg='08'
- pause: seconds=1

- debug: msg='09'
- pause: seconds=1

- debug: msg='10'
- pause: seconds=1

- debug: msg='11'
- pause: seconds=1

- debug: msg='12'
- pause: seconds=1

- debug: msg='13'
- pause: seconds=1

- debug: msg='14'
- pause: seconds=1

- debug: msg='15'
- pause: seconds=1

- debug: msg='16'
- pause: seconds=1

- debug: msg='17'
- pause: seconds=1

- debug: msg='18'
- pause: seconds=1

- debug: msg='19'
- pause: seconds=1

- debug: msg='20'
- pause: seconds=1

- debug: msg='21'
- pause: seconds=1

- debug: msg='22'
- pause: seconds=1

- debug: msg='23'
- pause: seconds=1

- debug: msg='24'
- pause: seconds=1

- debug: msg='25'
- pause: seconds=1

- debug: msg='26'
- pause: seconds=1

- debug: msg='27'
- pause: seconds=1

- debug: msg='28'
- pause: seconds=1

- debug: msg='29'
- pause: seconds=1

- debug: msg='30'
- pause: seconds=1

- debug: msg='31'
- pause: seconds=1

- debug: msg='32'
- pause: seconds=1

- debug: msg='33'
- pause: seconds=1

- debug: msg='34'
- pause: seconds=1

- debug: msg='35'
- pause: seconds=1

- debug: msg='36'
- pause: seconds=1

- debug: msg='37'
- pause: seconds=1

- debug: msg='38'
- pause: seconds=1

- debug: msg='39'
- pause: seconds=1

- debug: msg='40'
- pause: seconds=1

- debug: msg='41'
- pause: seconds=1

- debug: msg='42'
- pause: seconds=1

- debug: msg='43'
- pause: seconds=1

- debug: msg='44'
- pause: seconds=1

- debug: msg='45'
- pause: seconds=1

- debug: msg='46'
- pause: seconds=1

- debug: msg='47'
- pause: seconds=1

- debug: msg='48'
- pause: seconds=1

- debug: msg='49'
- pause: seconds=1

- debug: msg='50'
- pause: seconds=1
6 changes: 6 additions & 0 deletions debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

- hosts: all
gather_facts: false
tasks:
- debug: msg='hello'
7 changes: 7 additions & 0 deletions debug2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- hosts: all
gather_facts: false
tasks:
- debug: msg='hello'
- debug: msg='goodbye'
89 changes: 89 additions & 0 deletions dynamic_inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
- name: add 10 hosts to inventory
hosts: 'local'
vars:
num_hosts: 10
tasks:
- name: create inventory
add_host:
name: 'host-{{item}}'
groups: dynamic
ansible_connection: local
host_id: '{{item}}'
with_sequence: start=0 end={{num_hosts}} format=%d

- name: shrink inventory to 1 host
hosts: 'dynamic'
tasks:
- name: fail even numbered hosts
command: 'false'
when: host_id|int % 2 == 0
- name: skip multiples of 3
command: 'true'
when: host_id|int % 3 != 0
- name: all skipped
command: 'true'
when: false
- name: all changed
command: 'true'
- name: all ok
command: 'true'
changed_when: false
- name: fail all but 1
command: 'false'
when: host_id|int != 1

- name: 1 host play
hosts: 'host-1'
gather_facts: false
tasks:
- name: pass
command: 'true'
- name: ok
command: 'true'
changed_when: false
- name: ignored
command: 'false'
ignore_errors: true

- name: fail remaining dynamic group
hosts: all
gather_facts: true
tasks:
- name: fail
command: 'false'
when: inventory_hostname == 'host-1'

- name: add 10 hosts to inventory
hosts: 'local'
vars:
num_hosts: 10
tasks:
- name: add dynamic inventory
add_host:
name: 'new-host-{{item}}'
groups: dynamic
ansible_connection: local
host_id: '{{item}}'
with_sequence: start=0 end={{(num_hosts|int / 2)|int}} format=%d
- name: add unreachable inventory
add_host:
name: 'unreachable-host-{{item}}'
groups: unreachable
ansible_connection: UKNOWN
host_id: '{{item}}'
with_sequence: start={{(num_hosts|int / 2)|int + 1}} end={{num_hosts}} format=%d

- name: some unreachable
hosts: dynamic:unreachable
gather_facts: false
tasks:
- name: all changed with items
# debug: msg='{{item}}'
command: 'true'
with_sequence: start=0 end=10 format='This is string number - %d'
when: host_id|int % 5 == 0

- name: gather facts fail
hosts: unreachable
gather_facts: true
9 changes: 9 additions & 0 deletions fail_unless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- hosts: all
vars:
fail: true

tasks:
- fail: msg="Sorry, unless you tell me otherwise, this task will fail"
when: fail
9 changes: 9 additions & 0 deletions pass_unless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- hosts: all
vars:
fail: false

tasks:
- fail: msg="Congrats, you asked for this playbook to fail ... and it has"
when: fail
6 changes: 6 additions & 0 deletions pause.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

- hosts: all
gather_facts: false
tasks:
- pause: seconds=1
45 changes: 45 additions & 0 deletions ping-20.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---

- hosts: all
gather_facts: false
tasks:
- name: ping-01
ping:
- name: ping-02
ping:
- name: ping-03
ping:
- name: ping-04
ping:
- name: ping-05
ping:
- name: ping-06
ping:
- name: ping-07
ping:
- name: ping-08
ping:
- name: ping-09
ping:
- name: ping-10
ping:
- name: ping-11
ping:
- name: ping-12
ping:
- name: ping-13
ping:
- name: ping-14
ping:
- name: ping-15
ping:
- name: ping-16
ping:
- name: ping-17
ping:
- name: ping-18
ping:
- name: ping-19
ping:
- name: ping-20
ping:
6 changes: 6 additions & 0 deletions ping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

- hosts: all
gather_facts: false
tasks:
- ping:
9 changes: 9 additions & 0 deletions rax_credentials_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

# Tests whether two environment variables are present (and non-empty)

- hosts: local
connection: local
tasks:
- shell: 'test -n "${RAX_USERNAME}"'
- shell: 'test -n "${RAX_API_KEY}"'
10 changes: 10 additions & 0 deletions site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

- hosts: all
tasks:
- name: group hosts by distribution
action: group_by key={{ansible_distribution}}

tasks:
- name: site | hello world
shell: echo "Hi! AWX is working"
10 changes: 10 additions & 0 deletions vault.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$ANSIBLE_VAULT;1.1;AES256
30666235383963666339363533616635623965616438613233363865623263336536383231623035
6234303962373165393239376635313163666336386563370a396361663164343130623335646538
30646364643536663838373262353562633065323738663731366531316365653361373130313938
3864613639633131380a666131616566326133336430333332623734646166643734653232373366
63386633373335383938323035363461666132353466623466616431363932633631363930626639
37623562383131373162653463333161626663623166613463383666323739336566326336366233
36366132643561373536313865336639303431393735353434366637633838646666623036373630
39353036653330393839353431636163343062303163333936306430656537633066323036383432
3731

0 comments on commit e7e1799

Please sign in to comment.