Re: [ansible-project] Sudo issues... again

2014-03-21 Thread Makimoto Marakatti
solved! At the end it was something simple (isn't it always...) On the client machines, /etc/sudoers had this fateful line: Defaultsrequiretty That has been commented out. And no issues. But I feel ambivalent about the security side of things. Is there no way for ansible to log with a

Re: [ansible-project] Intermittent connection refused errors using rax module

2014-03-21 Thread Matt Martz
I believe this email ended up being delayed a bit.  Jimmy and I worked through this yesterday and changed the wait_for task to look like: - local_action: wait_for port=22 delay=20 hostname={{ ansible_ssh_host }} --  Matt Martz m...@sivel.net On March 21, 2014 at 12:10:24 AM, Jimmy Prescott

Re: [ansible-project] lineinfile with_items only updates last line, despite four changed messages

2014-03-21 Thread Matt Martz
I believe what you are doing is constantly overwriting the last line. I think, based on the examples and my testing, you would simply want to do:   vars:     limits_lines:          - 'root soft nofile 65535'         - 'root hard nofile 65535'         - 'root soft memlock unlimited'         - 

Re: [ansible-project] Using a list with lineinfile throws an undefined variable error

2014-03-21 Thread Simón Muñoz
Thanks for your answer Matt, but unfortunately it hasn't worked :(. - name: Setting log level in development lineinfile: dest=/etc/php5/fpm/php.ini regexp={{ item.regexp }} line={{ item.line }} backrefs=yes with_items: php_ini_settings fatal: [192.168.33.9] = One or more

Re: [ansible-project] Problem accessing variables in nested templates

2014-03-21 Thread Matt Martz
What version of jinja2 are you running? According to the docs[1], as of 2.1 this should work.  Something else to try would be something like: {% include incfile with context %} Not sure if something would be disabling context, so maybe this would override that if that is indeed the problem.

Re: [ansible-project] Problem accessing variables in nested templates

2014-03-21 Thread eoblar
Running ansible 1.5 with Jinja2 2.7.2 on Debian 7. I should have mentioned - I did try the 'with context' change, but it made no difference. -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop receiving

Re: [ansible-project] Output a dynamic inventory

2014-03-21 Thread Michael DeHaan
Ideally, I would like to be able to revisit these hosts on a second run, just in case something went wrong with one of those hosts, The way to do this is to call some basic script tests to verify that your service is running by the time your playbooks complete, such that the playbooks fail for

Re: [ansible-project] Vault pseudo leaf encryption

2014-03-21 Thread Michael DeHaan
This article had some good things in it, though I disagree with some points -- including the part where it suggests only using scalar variables. What this really shows isn't specific to vault -- it's just that you can use variables in other variables. On Fri, Mar 21, 2014 at 7:54 AM,

Re: [ansible-project] lineinfile with_items only updates last line, despite four changed messages

2014-03-21 Thread Michael DeHaan
The regexp needs to match the line being added. On Fri, Mar 21, 2014 at 8:20 AM, Matt Martz m...@sivel.net wrote: I believe what you are doing is constantly overwriting the last line. I think, based on the examples and my testing, you would simply want to do: vars: limits_lines:

Re: [ansible-project] Passing complex variables to a role

2014-03-21 Thread Michael DeHaan
I see you are still using legacy variables here. Please switch to {{ foo }}, which is the only option available starting in 1.6, and let us know if you still have problems. However without seeing the source to the role, I can't tell how this is being used. A traceback is always worthy of a bug

Re: [ansible-project] copy module with force=no intermittently reports ok status even when destination file does not exist

2014-03-21 Thread Michael DeHaan
the 'copy' module will report an 'ok' status and *not* copy in the file, despite the fact that the file definitely did not exist when the task was run. I'm highly skeptical here but it's not quite fair for me to claim server gremlins without first using the server gremlins detector, which I

Re: [ansible-project] Using a list with lineinfile throws an undefined variable error

2014-03-21 Thread Frédéric Badel
Hi, ... not really answering to the initial question, but why wouldn't you use the ini_file module? Fred On Mar 21, 2014, at 13:31 , Simón Muñoz simon...@gmail.com wrote: Thanks a lot Matt, the debug command was enough to find the problem. After including it in the playbook I found this:

Re: [ansible-project] Vault pseudo leaf encryption

2014-03-21 Thread Petros Moisiadis
On 03/21/14 13:54, ralov...@gmail.com wrote: Hi all. (reposting because of a silly copy/paste error - sorry about that.) Vault was a great addition to Ansible. Some complained about the lack of

[ansible-project] Re: New URI module from Romeo Theriault

2014-03-21 Thread bryan hunt
I have this same issue when using it to create riak-cs admin users. riak-cs will return either 201 or 409 when sending a PUT request, never a 200. Unfortunately 201 triggers module failure, as 200 is what it expects. riak_cs | FAILED **msg: Status code was not 200, I can work around

[ansible-project] Re: New URI module from Romeo Theriault

2014-03-21 Thread bryan hunt
I have this same issue when using it to create riak-cs admin users. riak-cs will return either 201 or 409 when sending a PUT request, never a 200. Unfortunately 201 triggers module failure, as 200 is what it expects. riak_cs | FAILED **msg: Status code was not 200, On Monday, October 7,

Re: [ansible-project] Vault pseudo leaf encryption

2014-03-21 Thread Michael DeHaan
I'd definitely resent any inference of evil-doing from The Ansible Team here :) While I'm open to pull requests to enhancements within reason, we've had the discussion a few times already that this could be served better by a password2 style plugin that used the VaultLib classes. --Michael On

Re: [ansible-project] Re: New URI module from Romeo Theriault

2014-03-21 Thread Michael DeHaan
There's a status_code option you can send. http://docs.ansible.com/uri_module.html On Fri, Mar 21, 2014 at 10:55 AM, bryan hunt picsolvebr...@gmail.comwrote: I have this same issue when using it to create riak-cs admin users. riak-cs will return either 201 or 409 when sending a PUT

Re: [ansible-project] Vault pseudo leaf encryption

2014-03-21 Thread Petros Moisiadis
On 03/21/14 16:59, Michael DeHaan wrote: I'd definitely resent any inference of evil-doing from The Ansible Team here :) While I'm open to pull requests to enhancements within reason, we've had the discussion a few times already that this could be served better by a password2 style plugin

Re: [ansible-project] 1.4.4 to 1.6 break on localhost playbook

2014-03-21 Thread Matt Martz
So, 1.6 is not officially released yet.  That is the 'devel' branch.  Are you running the most recent devel?  I just tested here and it works. It appears to have been fixed 10 days ago. --  Matt Martz m...@sivel.net On March 21, 2014 at 10:42:02 AM, Eric Palmer (e...@ericfpalmer.com) wrote:

Re: [ansible-project] 1.4.4 to 1.6 break on localhost playbook

2014-03-21 Thread Eric Palmer
ansible --version ansible 1.6 I did it through macports with sudo port upgrade outdated On Fri, Mar 21, 2014 at 11:56 AM, James Tanner tanner...@gmail.com wrote: facts.update(Network(module). populate()) This was an error that made it in to the 1.5.1 and 1.5.2 releases but should no

Re: [ansible-project] Re: New URI module from Romeo Theriault

2014-03-21 Thread bryan hunt
Yes, but there are two valid results, either 409 or 201. On 21 Mar 2014, at 15:03, Michael DeHaan mich...@ansible.com wrote: There's a status_code option you can send. http://docs.ansible.com/uri_module.html On Fri, Mar 21, 2014 at 10:55 AM, bryan hunt picsolvebr...@gmail.com wrote:

Re: [ansible-project] Re: Running ansible on local Linux desktop hangs on Gathering Facts

2014-03-21 Thread Paul Durivage
Generally this is related to Ansible somehow waiting for standard input, most commonly for a sudo or su password. I should note that I make this mistake *all the time* . I'd check to make sure that you haven't set sudo: yes or su: yes somewhere in the playbooks that you're running. If you have,

Re: [ansible-project] ansible on beaglebone black

2014-03-21 Thread Michael DeHaan
One of our guys has been doing a project with Ansible on a Beaglebone, but I'm not sure of the species. I'll check. If others have cool embedded projects or usages I'd be very interested in hearing about what they are! (There have also been a few interesting Raspberry Pi projects including some

Re: [ansible-project] 1.4.4 to 1.6 break on localhost playbook

2014-03-21 Thread Eric Palmer
I reverted back to 1.4.4 using mac ports and it works. I will wait till 1.6 is production. Not sure why macports is pulling a dev branch. But macports makes it easy to revert. ep On Fri, Mar 21, 2014 at 12:06 PM, Eric Palmer e...@ericfpalmer.com wrote: ansible --version ansible 1.6 I did

Re: [ansible-project] Re: New URI module from Romeo Theriault

2014-03-21 Thread Romeo Theriault
On Fri, Mar 21, 2014 at 6:38 AM, bryan hunt picsolvebr...@gmail.com wrote: Yes, but there are two valid results, either 409 or 201. You may want to check out this pull request: https://github.com/ansible/ansible/pull/4383/files and possibly try resubmitting it the suggested fixes. This would

[ansible-project] Problem with local variables in Jinja2 template includes

2014-03-21 Thread Mike Yumatov
Hi It seems there is a problem with locals in Jinja2 templates. For example, this works in vanilla Jinja2 environment, but doesn't work in ansible environment (One or more undefined variables: 'publisher' is undefined): {# simplified config.xml.j2 #} config {% for publisher in item.publishers

[ansible-project] ansible.runner.HostVars object has no element

2014-03-21 Thread David Neudorfer
Ansible is telling me that the HostVars object has no element, but when I run setup I see the object! setup: ansible_eth1: { active: true, device: eth1, ipv4: { address: 10.209.169.109, netmask: 255.255.224.0,

[ansible-project] Ansible deployment in OpenStack

2014-03-21 Thread pcorchary .
Question - I've been using Bang (http://fr33jc.github.io/bang/index.html) for Ansible deployments into OpenStack environments, but I'm wondering if there is work on other solutions? Most of what I've seen googling and digging around so far is for Ansible deployments _of_ OpenStack, which is

Re: [ansible-project] ansible.runner.HostVars object has no element

2014-03-21 Thread James Tanner
Before the mysql_user task, add a debug task to check the hostvars data structure ... - debug: var=hostvars That should tell you what is available during the play execution. On Mar 21, 2014, at 10:53 AM, David Neudorfer david.neudor...@warbyparker.com wrote: Ansible is telling me that the

Re: [ansible-project] ansible on beaglebone black

2014-03-21 Thread Eric Palmer
I hope to test ansible Sunday with the new debian image that will become the official BBB OS soon. I tested it earlier with an early debian image and had a lot of problems. I will report results here when I get to testing. Too many projects, so little time. Whoever said less is more was wrong!

Re: [ansible-project] Vault pseudo leaf encryption

2014-03-21 Thread Michael DeHaan
quoted: Auditing capabilities. You still cannot tell whether a specific secret has changed and by whom. A structure that allows the provability of the source of a security breach is quite important, especially in environments that need to conform to security standards. Eh, I'm not sold. While

[ansible-project] Using Ansible Galaxy roles in shared project

2014-03-21 Thread Shaunak Kashyap
I'm very new to Ansible and just discovered Ansible Galaxy as a way to reuse roles. I'm trying to figure out how best to use it within a project I'm sharing with other team members. Specifically, If I use ansible-galaxy install to install a role, it installs it into

Re: [ansible-project] Ansible deployment in OpenStack

2014-03-21 Thread Michael DeHaan
Many people are using the cloud modules, like 'nova_compute': http://docs.ansible.com/list_of_cloud_modules.html On Fri, Mar 21, 2014 at 11:47 AM, pcorchary . phillip.corch...@gmail.comwrote: Question - I've been using Bang (http://fr33jc.github.io/bang/index.html) for Ansible deployments

Re: [ansible-project] Using Ansible Galaxy roles in shared project

2014-03-21 Thread Matt Martz
ansible-galaxy as a -p/--roles-path flag where you can specify the path of where it installs the files to.  You can also configure then in ansible.cfg as roles_path. So that may be of some interest to you. As far as storing roles with your project, I think it is acceptable to put it in your

Re: [ansible-project] Output a dynamic inventory

2014-03-21 Thread Juergen Brendel
Hello! On Fri, 2014-03-21 at 09:05 -0400, Michael DeHaan wrote: The way to do this is to call some basic script tests to verify that your service is running by the time your playbooks complete, such that the playbooks fail for those hosts. Then the generated retry file can be used to

Re: [ansible-project] 1.4.4 to 1.6 break on localhost playbook

2014-03-21 Thread Michael DeHaan
1.4.4 is part of the last series, the latest stable release is actually 1.5.3 On Fri, Mar 21, 2014 at 1:29 PM, Eric Palmer e...@ericfpalmer.com wrote: I reverted back to 1.4.4 using mac ports and it works. I will wait till 1.6 is production. Not sure why macports is pulling a dev branch.

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Michael DeHaan
If you do ansible hostname -m setup in recent versions, you should see that environment variables are provided, in which case you can pull $HOME from there. This of course would only work for the active user. http://docs.ansible.com/faq.html#how-do-i-access-shell-environment-variables On

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Grant BlahaErath
Okay, my example kind of sucks and I'm not surprised that you noticed. I had to implement this approach after finding that ansible_env.HOME did what it should, but not what I needed. The playbooks run with sudo: yes because it was maddening to declare sudo state for each task.That makes

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Michael DeHaan
I had to implement this approach after finding that ansible_env.HOME did what it should, but not what I needed. Yep! The HOME environment variable is not always predictable in sudo scenarios. On Fri, Mar 21, 2014 at 7:52 PM, Grant BlahaErath gr...@spryhive.comwrote: Okay, my example kind

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Will Thames
Surely the result is still in userhome.stdout Since this thread was created, (and still a good while ago) set_fact was invented set_fact: new_variable={{result.stdout}} On 22 Mar 2014, at 09:57, Brian Coca brianc...@gmail.com wrote: shell: 'getent passwd user |cut -f 6 -d : ' register: