Skip to content
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

lacks documentation #52

Open
bsdlp opened this issue Oct 3, 2014 · 4 comments
Open

lacks documentation #52

bsdlp opened this issue Oct 3, 2014 · 4 comments

Comments

@bsdlp
Copy link

bsdlp commented Oct 3, 2014

Trying to guess the usage of this formula based on the pillar example is extremely frustrating, and the "official" doc is a dev doc for making new formulas, with barely any relevant information on how to use existing formulas.

While most of you probably already figured out how to use formulas, new users probably have a terrible time trying to use formulas.

@whiteinge
Copy link
Contributor

This is a good point. Neither the "Installation" or "Usage" sections in that doc explain how Pillar should / can be used. Thanks for filing this.

@ReifiedException
Copy link

BTW, simple question. Can this formula be used with some parameters list (e.g., usernames?). As far as I can see, it works like 'all or nothing', I mean, you can't keep different sets of users for different hosts/hostgroups easily, right?

@skandyla
Copy link
Contributor

Personally, I did this slightly modifying the code of this formula, adding virtusers section:

 {% for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %}   
+{%- if name in pillar.get('virtusers', {}) %   
...   
+{%- endif -%}   
 {% endfor %}   
 {% for name, user in pillar.get('users', {}).items() if user.absent is defined and user.absent %}   

Then, I'm able to control what users to deploy per host individually through pillar data. I.e.

virtusers:  
  root: true  
  rbackups: true  
  skandyla: true  

@pgporada
Copy link

@skandyla
How are you using your "virtusers" in regards to the entire users-formula? In what file are you placing the virtusers data that you specified? What file contains the jinja template from above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants