Add ch09
authorLorin Hochstein <lorin.hochstein@sendgrid.com>
Sat, 7 Feb 2015 23:30:22 +0000 (18:30 -0500)
committerLorin Hochstein <lorin.hochstein@sendgrid.com>
Sat, 7 Feb 2015 23:30:22 +0000 (18:30 -0500)
ch09/playbooks/ansible.cfg [new file with mode: 0644]
ch09/playbooks/disable-requiretty.yml [new file with mode: 0644]
ch09/playbooks/templates/disable-requiretty.j2 [new file with mode: 0644]

diff --git a/ch09/playbooks/ansible.cfg b/ch09/playbooks/ansible.cfg
new file mode 100644 (file)
index 0000000..4c49145
--- /dev/null
@@ -0,0 +1,9 @@
+[defaults]
+pipelining = True
+gathering = smart
+fact_caching = redis
+fact_caching_timeout = 86400
+forks = 20
+
+[ssh_connection]
+control_path = %(directory)s/%%h-%%r
diff --git a/ch09/playbooks/disable-requiretty.yml b/ch09/playbooks/disable-requiretty.yml
new file mode 100644 (file)
index 0000000..32304d4
--- /dev/null
@@ -0,0 +1,11 @@
+---
+- name: do not require tty for ssh-ing user
+  hosts: myhosts
+  sudo: True
+  tasks:
+    - name: Set a sudoers file to disable tty
+      template: >
+        src=templates/disable-requiretty.j2
+        dest=/etc/sudoers.d/disable-requiretty
+        owner=root group=root mode=0440
+        validate="visudo -cf %s"
diff --git a/ch09/playbooks/templates/disable-requiretty.j2 b/ch09/playbooks/templates/disable-requiretty.j2
new file mode 100644 (file)
index 0000000..9a5cbaf
--- /dev/null
@@ -0,0 +1 @@
+Defaults:{{ ansible_ssh_user }} !requiretty