From 87f5660c51580b48a5f348c86f67ed026db67915 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Sat, 7 Feb 2015 18:30:22 -0500 Subject: [PATCH] Add ch09 --- ch09/playbooks/ansible.cfg | 9 +++++++++ ch09/playbooks/disable-requiretty.yml | 11 +++++++++++ ch09/playbooks/templates/disable-requiretty.j2 | 1 + 3 files changed, 21 insertions(+) create mode 100644 ch09/playbooks/ansible.cfg create mode 100644 ch09/playbooks/disable-requiretty.yml create mode 100644 ch09/playbooks/templates/disable-requiretty.j2 diff --git a/ch09/playbooks/ansible.cfg b/ch09/playbooks/ansible.cfg new file mode 100644 index 0000000..4c49145 --- /dev/null +++ b/ch09/playbooks/ansible.cfg @@ -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 index 0000000..32304d4 --- /dev/null +++ b/ch09/playbooks/disable-requiretty.yml @@ -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 index 0000000..9a5cbaf --- /dev/null +++ b/ch09/playbooks/templates/disable-requiretty.j2 @@ -0,0 +1 @@ +Defaults:{{ ansible_ssh_user }} !requiretty -- 2.44.0