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

Issue with 'Make sure the users are present' on Ansible 1.6.8 #3

Closed
pusewicz opened this issue Jul 24, 2014 · 10 comments
Closed

Issue with 'Make sure the users are present' on Ansible 1.6.8 #3

pusewicz opened this issue Jul 24, 2014 · 10 comments

Comments

@pusewicz
Copy link

TASK: [Ansibles.generic-users | generic-users | Make sure the users are present] *** 
fatal: [vagrant] => A variable inserted a new parameter into the module args. Be sure to quote variables if they contain equal signs (for example: "{{var}}").
@sloria
Copy link

sloria commented Jul 28, 2014

I am seeing this same error on the "Make sure all groups are present" task as well.

@sloria
Copy link

sloria commented Jul 28, 2014

Also seeing this in ansible 1.6.10

@pusewicz
Copy link
Author

@pjan Ping

@pjan
Copy link
Contributor

pjan commented Sep 6, 2014

Sorry for taking this long... moved places & life took over...

Made a change which should resolve it. Let me know if it persists.

@rndmh3ro
Copy link
Contributor

rndmh3ro commented Sep 8, 2014

Issue persists on Ansible 1.7.

@pjan
Copy link
Contributor

pjan commented Sep 9, 2014

Pushed an update for it. The work-around that seems to work (it's a bit of a patch) is to require all fields to be provided. I don't like it that much myself, but lack the time to dive into it deeper, unfortunately. I updated the readme to reflect this. Hope a better solution exists. Would accept a PR for this if anyone knows how to do it

@rndmh3ro
Copy link
Contributor

rndmh3ro commented Sep 9, 2014

@pjan it's not a workaround, I think its the actual solution to this.

Ansible has never endorsed Jinja2 inside of playbooks much more than to assign variables.

...

The work-around that seems to work (it's a bit of a patch) is to require all fields to be provided.

That's the default now.

In Ansible 1.8 there will be this, to omit empty fields:

new omit value can be used to leave off a parameter when not set, like so module_name: a=1 b={{ c | default(omit) }}, would not pass value for b (not even an empty value) if c was not set.

@galaux
Copy link

galaux commented Dec 21, 2014

I am no expert in Ansible but I can get this to work by using …|default(omit). Here is a quick diff.

BTW, your last commit (87c31d6) induces a warning (ansible 1.8.2):

[WARNING]: It is unnecessary to use '{{' in loops, leave variables in loop expressions bare.

Maybe you should revert it (my previous diff is based on your previous commit being reverted).

One last thing: one line module declarations are a pain in the neck to read… :)

@pjan
Copy link
Contributor

pjan commented Feb 15, 2015

@soupdiver if you fancy to have a shot at this? You might have to update the .travis.yml configuration so it's not forcefully checking out ansible, but a newer version. The Readme.md would have to be updated as well to reflect the minimum version requirement.

@soupdiver
Copy link
Contributor

@pjan It's already on my list :)

@soupdiver soupdiver mentioned this issue Feb 21, 2015
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

6 participants