Added ability to enable SETENV in sudoers
Change-Id: Icee295720a5a2425390a1bcd588841897071938e
diff --git a/README.rst b/README.rst
index 30be47c..97420bc 100644
--- a/README.rst
+++ b/README.rst
@@ -157,6 +157,7 @@
salt-ops-2nd:
name: salt-ops
nopasswd: false
+ setenv: true # Enable sudo -E option
runas:
- DBA
commands:
diff --git a/linux/files/sudoer-users b/linux/files/sudoer-users
index 4e05269..738d25d 100644
--- a/linux/files/sudoer-users
+++ b/linux/files/sudoer-users
@@ -2,6 +2,6 @@
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
{%- for user,spec in users.iteritems() %}
-{{ spec.name|default(user) }} {{ spec.get('hosts', ['ALL'])|join(',') }}=({{ spec.get('runas', ['ALL'])|join(', ') }}) {% if spec.get('nopasswd', True) %}NOPASSWD: {% endif %}{{ spec.get('commands', ['ALL'])|join(', ') }}
+{{ spec.name|default(user) }} {{ spec.get('hosts', ['ALL'])|join(',') }}=({{ spec.get('runas', ['ALL'])|join(', ') }}) {% if spec.get('nopasswd', True) %}NOPASSWD:{% endif %}{% if spec.get('setenv', False) %}SETENV:{% endif %} {{ spec.get('commands', ['ALL'])|join(', ') }}
{%- endfor %}