saltstack-formulas / sudoers-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
41 stars 168 forks source link

Pillar data is being ignored #30

Closed rahedges closed 8 years ago

rahedges commented 8 years ago

I have a top.sls file:

base:
  '*':
    - sudoers

And as a test I have a pillar file in /srv/salt/pillar/sudoers/init.sls

sudoers:
  users:
    johndoe:
      - 'All=(ALL) ALL'

When I run the highstate I see this output:

pbp:
----------
          ID: sudo
    Function: pkg.installed
      Result: True
     Comment: Package sudo is already installed
     Started: 14:48:45.512514
    Duration: 441.472 ms
     Changes:   
----------
          ID: /etc/sudoers
    Function: file.managed
      Result: True
     Comment: The file /etc/sudoers is in the correct state
     Started: 14:48:45.955057
    Duration: 46.428 ms
     Changes:   

Summary
------------
Succeeded: 2
Failed:    0
------------
Total states run:     2

On my minion it shows a sudoes file that is managed by salt, but it does not have the additional users in my pillar data. I realize this is may be a fundamental error, but I've tried several things and can't seem to get the pillar data included.

Thanks, Robert

gravyboat commented 8 years ago

I assume: johndoe; with the semicolon instead of the colon is just a typo specifically in this issue? As is the missing ' in - 'All=(ALL) ALL?

iggy commented 8 years ago

salt 'host' pillar.get sudoers

rahedges commented 8 years ago

When I run the comand:

sudo salt 'pbp' pillar.get sudoers

the response is:

pbp:

And then if i run

sudo salt 'pbp' pillar.items

The response is:

pbp:
    ----------

Also the /etc/sudoers file is unchanged.

iggy commented 8 years ago

Your host isn't getting pillars, why it's not could be any different reason.

bradthurber commented 8 years ago

@djibi2, by any chance are you using jinja2 v2.2.1 as in issue #6 ? If so, you may want to try the workaround from the comment made by jcross-linkup.

rahedges commented 8 years ago

There was a configuration issue with my general setup that was preventing me from seeing the pillar data. It had nothing to do with this formula.