Remove requiretty for sudo on centos hosts.

In order to be able to use become: yes to execute command with ansible
the requiretty option needs to be disabled on centos.

Change-Id: Ifbba7153cf7d3d97daf86106c1f027787d76e865
This commit is contained in:
Marc Gariepy 2016-09-15 09:08:23 -04:00 committed by Jesse Pretorius (odyssey4me)
parent 94afa972a0
commit 738e88dcfd
2 changed files with 12 additions and 0 deletions

View File

@ -25,3 +25,13 @@
tags:
- openstack-yum-packages
- openstack-packages
- name: Disable requiretty for root sudo on centos
template:
dest: /etc/sudoers.d/openstack-ansible
owner: root
group: root
mode: "0440"
src: sudoers.j2
when:
- ansible_pkg_mgr == 'yum'

2
templates/sudoers.j2 Normal file
View File

@ -0,0 +1,2 @@
# {{ ansible_managed }}
Defaults:root !requiretty