summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael DeHaan <michael.dehaan@gmail.com>2012-03-13 19:27:13 -0400
committerMichael DeHaan <michael.dehaan@gmail.com>2012-03-13 19:27:13 -0400
commit2e1b59a9d2440be500cbb73117ffcf60a5bc137b (patch)
treeec54e34dca25b2d2e66890966942d3cd8c596bd5
parent09a7119e74e82a6973625c16030bc7c778c415a1 (diff)
downloadansible-2e1b59a9d2440be500cbb73117ffcf60a5bc137b.tar.gz
restructure the examples directory0.0.1
-rw-r--r--examples/etc_ansible_hosts (renamed from examples/hosts)0
-rw-r--r--examples/playbooks/handlers/handlers.yml (renamed from examples/handlers.yml)0
-rw-r--r--examples/playbooks/playbook.yml (renamed from examples/playbook.yml)4
-rw-r--r--examples/playbooks/playbook2.yml (renamed from examples/playbook2.yml)8
-rw-r--r--examples/playbooks/playbook3.yml26
-rw-r--r--examples/playbooks/tasks/base.yml (renamed from examples/base.yml)0
-rw-r--r--examples/playbooks/templates/foo.j2 (renamed from examples/foo.j2)0
-rw-r--r--examples/playbooks/vars/external_vars.yml (renamed from examples/external_vars.yml)0
-rwxr-xr-xexamples/scripts/uptime.py (renamed from examples/uptime.py)0
9 files changed, 32 insertions, 6 deletions
diff --git a/examples/hosts b/examples/etc_ansible_hosts
index f58b26ed9e..f58b26ed9e 100644
--- a/examples/hosts
+++ b/examples/etc_ansible_hosts
diff --git a/examples/handlers.yml b/examples/playbooks/handlers/handlers.yml
index b9a25d9ede..b9a25d9ede 100644
--- a/examples/handlers.yml
+++ b/examples/playbooks/handlers/handlers.yml
diff --git a/examples/playbook.yml b/examples/playbooks/playbook.yml
index be5a90d574..34fd9603dd 100644
--- a/examples/playbook.yml
+++ b/examples/playbooks/playbook.yml
@@ -42,7 +42,7 @@
# end of the playbook run
- name: write some_random_foo configuration
- action: template src=foo.j2 dest=/etc/some_random_foo.conf
+ action: template src=templates/foo.j2 dest=/etc/some_random_foo.conf
notify:
- restart apache
@@ -66,6 +66,6 @@
# is changed, and only then
- name: restart apache
- action: service httpd state=restarted
+ action: service name=httpd state=restarted
diff --git a/examples/playbook2.yml b/examples/playbooks/playbook2.yml
index 3aea97026d..0eab7b185b 100644
--- a/examples/playbook2.yml
+++ b/examples/playbooks/playbook2.yml
@@ -16,7 +16,7 @@
# files but still keep the playbook in public source control
vars_files:
- - external_vars.yml
+ - vars/external_vars.yml
# as with before, every play has a list of tasks in it
@@ -30,7 +30,7 @@
# or we can promote reuse and simplicity by including tasks
# from other files, for instance, to reuse common tasks
- - include: base.yml
+ - include: tasks/base.yml
# we could also have done something like:
# - include: wordpress.yml user=timmy
@@ -44,7 +44,7 @@
# and simpler recipes, you may wish to only have one
# handler file for all your plays and playbooks
- - include: handlers.yml
+ - include: handlers/handlers.yml
# you can mix things that are directly in the file with things
# that are included. Order is executed as written, but only
@@ -75,7 +75,7 @@
vars:
release: 2.0
vars_files:
- - external_vars.yml
+ - vars/external_vars.yml
# these all runs as the user 'mdehaan'. If there were any handlers
diff --git a/examples/playbooks/playbook3.yml b/examples/playbooks/playbook3.yml
new file mode 100644
index 0000000000..092b5997c7
--- /dev/null
+++ b/examples/playbooks/playbook3.yml
@@ -0,0 +1,26 @@
+---
+# this is not so much an example playbook file as a playbook we sometimes use
+# for testing. I have chosen to not comment this one so folks can get
+# an idea of what a concise playbook can look like...
+
+- hosts: all
+ user: root
+ vars:
+ http_port: 80
+ max_clients: 200
+ tasks:
+ - name: simulate long running op, wait for 45s, poll every 5
+ action: command /bin/sleep 15
+ async: 45
+ poll: 5
+ - include: tasks/base.yml favcolor=blue
+ - name: write the foo config file using vars set above
+ action: template src=foo.j2 dest=/etc/some_random_foo.conf
+ notify:
+ - restart apache
+ - name: ensure apache is running
+ action: service name=httpd state=started
+ - name: pointless test action
+ action: command /bin/echo {{ http_port }}
+ handlers:
+ - include: handlers/handlers.yml
diff --git a/examples/base.yml b/examples/playbooks/tasks/base.yml
index 3cdc1d00b2..3cdc1d00b2 100644
--- a/examples/base.yml
+++ b/examples/playbooks/tasks/base.yml
diff --git a/examples/foo.j2 b/examples/playbooks/templates/foo.j2
index ceaa5b2f1d..ceaa5b2f1d 100644
--- a/examples/foo.j2
+++ b/examples/playbooks/templates/foo.j2
diff --git a/examples/external_vars.yml b/examples/playbooks/vars/external_vars.yml
index ebc76961bf..ebc76961bf 100644
--- a/examples/external_vars.yml
+++ b/examples/playbooks/vars/external_vars.yml
diff --git a/examples/uptime.py b/examples/scripts/uptime.py
index dd11ed20e0..dd11ed20e0 100755
--- a/examples/uptime.py
+++ b/examples/scripts/uptime.py