From 9c5cec32545510875de3ca2e149e1aff2909102e Mon Sep 17 00:00:00 2001 From: error10 Date: Fri, 30 Oct 2015 20:41:05 -0400 Subject: Don't require tty to run sudo Set Defaults !requiretty so that ansible can run sudo without a terminal. Fixes #773 --- playbooks/libvirt/openshift-cluster/templates/user-data | 1 + 1 file changed, 1 insertion(+) (limited to 'playbooks/libvirt/openshift-cluster') diff --git a/playbooks/libvirt/openshift-cluster/templates/user-data b/playbooks/libvirt/openshift-cluster/templates/user-data index eacae7c7e..cf57e6489 100644 --- a/playbooks/libvirt/openshift-cluster/templates/user-data +++ b/playbooks/libvirt/openshift-cluster/templates/user-data @@ -21,3 +21,4 @@ ssh_authorized_keys: runcmd: - NETWORK_CONFIG=/etc/sysconfig/network-scripts/ifcfg-eth0; if ! grep DHCP_HOSTNAME ${NETWORK_CONFIG}; then echo 'DHCP_HOSTNAME="{{ item[0] }}.example.com"' >> ${NETWORK_CONFIG}; fi; pkill -9 dhclient; service network restart + - echo "Defaults !requiretty" >> /etc/sudoers.d/00-no-requiretty -- cgit v1.2.3 From d75f1b5879dce664f86eea25dff66417618e379e Mon Sep 17 00:00:00 2001 From: error10 Date: Sun, 1 Nov 2015 14:49:09 -0500 Subject: Disable requiretty for only the openshift user Use write_files to disable requiretty for the openshift user as suggested by @detiberm, fixes #773 --- playbooks/libvirt/openshift-cluster/templates/user-data | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'playbooks/libvirt/openshift-cluster') diff --git a/playbooks/libvirt/openshift-cluster/templates/user-data b/playbooks/libvirt/openshift-cluster/templates/user-data index cf57e6489..e0c966e45 100644 --- a/playbooks/libvirt/openshift-cluster/templates/user-data +++ b/playbooks/libvirt/openshift-cluster/templates/user-data @@ -19,6 +19,11 @@ system_info: ssh_authorized_keys: - {{ lookup('file', '~/.ssh/id_rsa.pub') }} +write_files: + - path: /etc/sudoers.d/00-openshift-no-requiretty + permissions: 440 + content: | + Defaults:openshift !requiretty + runcmd: - NETWORK_CONFIG=/etc/sysconfig/network-scripts/ifcfg-eth0; if ! grep DHCP_HOSTNAME ${NETWORK_CONFIG}; then echo 'DHCP_HOSTNAME="{{ item[0] }}.example.com"' >> ${NETWORK_CONFIG}; fi; pkill -9 dhclient; service network restart - - echo "Defaults !requiretty" >> /etc/sudoers.d/00-no-requiretty -- cgit v1.2.3 From da95bc1be774413448d894f4bd330555f251aec0 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Wed, 28 Oct 2015 11:11:15 -0400 Subject: Refactor common group evaluation to avoid duplication --- playbooks/libvirt/openshift-cluster/launch.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'playbooks/libvirt/openshift-cluster') diff --git a/playbooks/libvirt/openshift-cluster/launch.yml b/playbooks/libvirt/openshift-cluster/launch.yml index d3e768de5..8d7949dd1 100644 --- a/playbooks/libvirt/openshift-cluster/launch.yml +++ b/playbooks/libvirt/openshift-cluster/launch.yml @@ -17,7 +17,7 @@ - include: tasks/configure_libvirt.yml - - include: ../../common/openshift-cluster/set_etcd_launch_facts_tasks.yml + - include: ../../common/openshift-cluster/tasks/set_etcd_launch_facts.yml - include: tasks/launch_instances.yml vars: instances: "{{ etcd_names }}" @@ -25,7 +25,7 @@ type: "{{ k8s_type }}" g_sub_host_type: "default" - - include: ../../common/openshift-cluster/set_master_launch_facts_tasks.yml + - include: ../../common/openshift-cluster/tasks/set_master_launch_facts.yml - include: tasks/launch_instances.yml vars: instances: "{{ master_names }}" @@ -33,7 +33,7 @@ type: "{{ k8s_type }}" g_sub_host_type: "default" - - include: ../../common/openshift-cluster/set_node_launch_facts_tasks.yml + - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml vars: type: "compute" count: "{{ num_nodes }}" @@ -44,7 +44,7 @@ type: "{{ k8s_type }}" g_sub_host_type: "{{ sub_host_type }}" - - include: ../../common/openshift-cluster/set_node_launch_facts_tasks.yml + - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml vars: type: "infra" count: "{{ num_infra }}" -- cgit v1.2.3