-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error using sudoers.included #6
Comments
+1 |
Hmm, I'm surprised this is still an issue (I actually don't even remember this one being opened last year sadly). @nmadhok Do you know who is familiar enough with this formula to do a quick fix? The contributors list is pretty sparse. |
@carlosperello or @aboe76 May be able to provide a fix for this. |
Carlos or Niels, can you please let us know if there are any updates. |
Strange I run the same sudoers formula on my own machines, archlinux / opensuse / debian and I have this configuration: sudoers:
users:
root:
- 'ALL=(ALL) ALL'
defaults:
generic:
- env_reset
- always_set_home
- mail_no_perms
- set_home
- tty_tickets
- mail_badpass
- secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- editor=/usr/bin/vim
user_list:
aboe: '!requiretty'
runas_list:
root: '!set_logname'
includedir: /etc/sudoers.d
included_files:
/etc/sudoers.d/10_XXXXXXXX:
users:
XXXXXXXX:
- 'ALL=(ALL) NOPASSWD: ALL'
- 'ALL = NOPASSWD: /usr/bin/build'
- 'ALL = NOPASSWD: /usr/bin/osc' And I don't see this problem, this is my top.sls base:
'*':
- users_minion
- salt-minion
- openssh
- sudoers
- mine
- ntp Will test with sudoers.included |
@vachaspativ update, base:
'*':
- users
- sudoers
- sudoers.included
- logrotate
- openssh
- openssh.client
- openssh.config
- vim.salt
- vim.jinja
- vim.repeat
- salt.minion
- haveged
'example.home.lan':
- sudoers.included running state.highstate on example.home.lan is without issues. |
Hi Niels, But when i try it out for Oracle Ent Linux 6.5 its failing. The error is below.
I observed that the python is 2.7.3 on the Debian machine but it is just 2.6.6 on the OEL. |
I am experiencing this problem on some CentOS 6.5 systems, the only difference that i see is the version of jinja.
For me sudoers.included does not work on minion003 and minion004 that uses python-jinja2-2.2.1-2.el6_5.x86_64. |
Hmm, I know there is some functionality that doesn't work on older Jinja2 releases, but I'm not familiar enough with them to confirm if that functionality exists in this formula. |
I can confirm that it is a jinja2 version issue in CentOS 6. I started with jinja2 2.2.1 which did not work. I then switched to version 2.8 and it worked. Here's the hack I use to work around it:
|
@jcross-linkup commented on Jan 28, 2016, 10:07 PM EST:
I am on RHEL 6.7 with the same Jinja2 2.2.1. I can confirm that @jcross-linkup 's workaround also works in my case. In, fact the issue goes away in Jinja2 2.3 - which is the very next version after 2.2.1. From the Jinja2 2.3 change log I'm guessing that this may be the jinja2 issue that fixes this:
I'm not sure what that tells those of us that are stuck on 2.2.1. Should the formula be modified to account for this? Should salt/utils/templates.py be modified to work better with Jinja2 2.2.1? Should we consider slipstreaming a newer version of Jinja2 on RHEL 6/CentOS 6? |
…t-upgrade-fallout Fixing unicode issues in plos groups
I am experiencing errors with the sudoers.included state related to the 'sudoers' variable in the /etc/sudoers template. Here is my configuration:
In top.sls, sudoers is applied globally, and sudoers.included is applied to the host experiencing the error:
top.sls
The pillar data for myhost is as follows:
However when salt is called, I receive the following error:
From looking at the code, it seems that indeed sudoers is not initialized if the file is included, which it is from sudoers.included. sudoers.included does initialize sudoers from pillar, but I'm not sure how or if the context gets passed between the included file.
The text was updated successfully, but these errors were encountered: