Remove requiretty for sudo on centos base image.

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: Iab2408267fdcb1c19c3c560d2f86181a6fc180e0
This commit is contained in:
Marc Gariepy 2016-09-15 08:55:29 -04:00 committed by Jesse Pretorius (odyssey4me)
parent de6d37f2d3
commit cf65c6736b
2 changed files with 12 additions and 0 deletions

View File

@ -106,3 +106,13 @@
tags:
- lxc-cache
- lxc-cache-apt-keys
- name: Remove requiretty for sudo on centoos
template:
dest: "/var/lib/lxc/LXC_NAME/rootfs/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