progress
authorLorin Hochstein <lorin.hochstein@sendgrid.com>
Mon, 19 Jan 2015 02:32:53 +0000 (21:32 -0500)
committerLorin Hochstein <lorin.hochstein@sendgrid.com>
Mon, 19 Jan 2015 02:32:53 +0000 (21:32 -0500)
ch04/install-package.yml [new file with mode: 0644]
ch04/localfact.yml [new file with mode: 0644]
ch04/update-cache.yml [new file with mode: 0644]
ch04/whoami.yml

diff --git a/ch04/install-package.yml b/ch04/install-package.yml
new file mode 100644 (file)
index 0000000..8e70309
--- /dev/null
@@ -0,0 +1,10 @@
+---
+- name: show return value of apt module
+  hosts: server1
+  gather_facts: False
+  sudo: True
+  tasks:
+    - name: install nginx
+      apt: name=nginx
+      register: result
+    - debug: var=result
diff --git a/ch04/localfact.yml b/ch04/localfact.yml
new file mode 100644 (file)
index 0000000..4c9a587
--- /dev/null
@@ -0,0 +1,7 @@
+- name: print local facts
+  hosts: server1
+  tasks:
+    - name: print ansible_local
+      debug: var=ansible_local
+    - name: print book title
+      debug: msg="The title of the book is {{ ansible_local.example.book.title }}"
diff --git a/ch04/update-cache.yml b/ch04/update-cache.yml
new file mode 100644 (file)
index 0000000..34d4be1
--- /dev/null
@@ -0,0 +1,10 @@
+---
+- name: show return value of apt module
+  hosts: server1
+  gather_facts: False
+  sudo: True
+  tasks:
+    - name: install nginx
+      apt: update_cache=yes
+      register: result
+    - debug: var=result
index a624570..9d76452 100644 (file)
@@ -7,3 +7,4 @@
       command: id -un
       register: login
     - debug: var=login
+    - debug: msg="Logged in as user {{ login.stdout }}"