Re: [ansible-project] Maintaining state of a set of machines which are not always up or connected

2014-06-11 Thread Tomasz Kontusz
On 10.06.2014 18:25, eskhool wrote: what is the recommendation or best practice to apply a playbook to a set of machines which may often not be running? You might want to look at running ansible-pull on boot - then each machine will get into consistent state ASAP. But that takes some control

Re: [ansible-project] Re: Remove task loop item from output

2014-06-11 Thread 'Petros Moisiadis' via Ansible Project
On 06/10/2014 08:28 PM, Scott Sturdivant wrote: This is something I'd be quite interested in as well. All of our private data is stored via ansible-vault, but then it winds up being displayed in plain text as the playbook executes. In a slightly contrived example, I've got an encrypted

Re: [ansible-project] synchronize module connects to local machine as root before calling rsync

2014-06-11 Thread Chris Hoffman
I just ran into this same issue. As alluded to above, adding this line to my inventory resolved the issue. localhost ansible_connection=local In my case, I was passing an explicit user and private-key on the command line which were not set up on my machine. Should there be a note added to

[ansible-project] Re: why isn't stdout returned on this most basic of commands?

2014-06-11 Thread Andy Ingham
Just to close the loop...ansible 1.6.2 DOES fix this issue for me. Thanks! Andy On Thursday, May 1, 2014 4:37:42 PM UTC-4, Andy Ingham wrote: This one baffles me. I issue this command: ansible HOSTABC -a 'cat /etc/motd' -K --sudo -v sudo password: and I see the success message

Re: [ansible-project] Maintaining state of a set of machines which are not always up or connected

2014-06-11 Thread Serge van Ginderachter
On 10 June 2014 18:25, eskhool anshuman.aggar...@gmail.com wrote: what is the recommendation or best practice to apply a playbook to a set of machines which may often not be running? ​Depends what behavior you want. Should it boot up if you want to run ansible on them, or should it fail? ​

[ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Andrew Udvare
On Tuesday, 26 November 2013 10:15:03 UTC-8, Bruce Pennypacker wrote: It looks like the mysql_db module will blindly run mysqldump wiht the specified target file if it's specified, so yes it's currently expected behavior. What you would probably need to do is run an action before you

[ansible-project] Ansible-pull failing due to Vault issues (not using vault!)

2014-06-11 Thread Ben Sebborn
We have been successfully using ansible-pull at boot time to run through a playbook to ensure our webservers are up-to-date when they autoscale. Since yesterday (with no changes to the playbook) we're getting the following error, every time it's run: TASK: [Config files]

[ansible-project] python Dynamic Inventory won't work: it is interpreted as a .ini file

2014-06-11 Thread Pierre Masci
Hi, I'm trying the simplest possible example of a Dynamic Inventory http://docs.ansible.com/developing_inventory.html but it won't work: my hosts.py file gets interpreted as a .ini file: $ ansible-playbook -i *hosts.py* play.yml

[ansible-project] using Ansible for 100% of rails development

2014-06-11 Thread Weston Platter
I wanted to ask if anyone out there is using Ansible to provision servers and 100% deploy their Rails (rather than using Capistrano). I saw a couple of posts/projects related to this: - https://mxey.net/deploying-rails-with-ansible/ - https://github.com/nicolai86/ansible-rails-deployment

[ansible-project] Ansible and complex hierarchy

2014-06-11 Thread andreub
Hello, I'm facing a problem and I'm not sure if it's a bug or a feature :) I have a role that includes other role (using meta dependency), when including that role more than once in my playbook, it runs only once: role/mymetarole/meta/main.yml: --- allow_duplicates: yes dependencies: - {

Re: [ansible-project] python Dynamic Inventory won't work: it is interpreted as a .ini file

2014-06-11 Thread Serge van Ginderachter
Sounds like you forgot to chmod +x hosts.py On 11 June 2014 20:13, Pierre Masci mas...@gmail.com wrote: Hi, I'm trying the simplest possible example of a Dynamic Inventory http://docs.ansible.com/developing_inventory.html but it won't work: my hosts.py file gets interpreted as a .ini

Re: [ansible-project] Ansible and complex hierarchy

2014-06-11 Thread Serge van Ginderachter
On 11 June 2014 18:02, andreub memyselfandand...@gmail.com wrote: allow_duplicates: yes ​Not sure, but I'd think you need to add this to ​role/otherrole/meta/main.yml also? -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe

Re: [ansible-project] python Dynamic Inventory won't work: it is interpreted as a .ini file

2014-06-11 Thread Scott Sturdivant
Similarly, don't forget the shebang line at the top of your inventory script. e.g. '#!/usr/bin/env python` On Wed, Jun 11, 2014 at 12:45 PM, Serge van Ginderachter se...@vanginderachter.be wrote: Sounds like you forgot to chmod +x hosts.py On 11 June 2014 20:13, Pierre Masci

Re: [ansible-project] using Ansible for 100% of rails development

2014-06-11 Thread Michael DeHaan
Lots of people are using Ansible to replace Fabric or Capistrano and only get down to one tool - and those aren't neccessarily Python or Ruby apps respect (Ansible can also run things as non-root, so if you need to, that's all cool) I'll let some folks using Rails chime in with details, though

Re: [ansible-project] Request to improve RDS module to use boto rds2

2014-06-11 Thread Michael DeHaan
It seems very non-Ansible-way to have another copy of the module that just uses a different protocol. Couldn't this just be changed up to support the new parameter? --Michael On Tue, Jun 10, 2014 at 12:29 AM, iain wright iainw...@gmail.com wrote: Hi folks, The goal was to provision an

Re: [ansible-project] Testing file upload with uri?

2014-06-11 Thread Michael DeHaan
It's a devel topic mostly, but the answer is no, because lookup plugins are just going to evaluate to string parameters here, and this is an inefficient way to pass large files to remote hosts. On Tue, Jun 10, 2014 at 10:42 AM, Guy Matz guym...@gmail.com wrote: OR - and I think I prefer

Re: [ansible-project] Ubuntu 14.04 and Default Variable not Set

2014-06-11 Thread Michael DeHaan
$foo variables have not been used in Ansible for some time. This is an out of date playbook. On Mon, Jun 9, 2014 at 3:09 PM, Ray Hooker ray.hoo...@gmail.com wrote: I am trying to debug a problem with installing OpenEdX on Ubuntu 14.04. The same set of playbooks work find on Ubuntu 12.04

Re: [ansible-project] python Dynamic Inventory won't work: it is interpreted as a .ini file

2014-06-11 Thread Pierre Masci
And now my more complex dynamic inventory works. Easy peasy, cheers! I'm loving Ansible :) On Wednesday, 11 June 2014 19:55:03 UTC+1, Pierre Masci wrote: Oh so silly of me, thank you Serge and Scott ! Now it works. Perhaps these info could be added to this documentation page:

Re: [ansible-project] How to debug/log message when writing Ansible Module?

2014-06-11 Thread Michael DeHaan
What happens in your case with the above? You may possibly be not picking up the ansible out of yoru source tree. Better question for ansible-devel regardless. On Tue, Jun 10, 2014 at 9:15 AM, howac...@gmail.com wrote: Hey I've tried the information in this link:

Re: [ansible-project] Dynamic Inventory does not work: it gets interpreted as .ini

2014-06-11 Thread Paul Durivage
chmod +x host.py Ansible uses the executable flag to determine whether or not a file is a .ini or script. On Wed, Jun 11, 2014 at 11:21 AM, Pierre Masci mas...@gmail.com wrote: Hi, I'm trying to get the simplest *Dynamic Inventory* to work, but it doesn't work because *Ansible interprets

Re: [ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Paul Durivage
Hi Andrew, Determining how a task should be treated as changed is can be controlled using the changed_when directive. See the documentation: http://docs.ansible.com/playbooks_error_handling.html#overriding-the-changed-result -name: check if DB exists shell: mysql -u user -p password -h host

[ansible-project] Tidbits of info, Docker/Ansible

2014-06-11 Thread Patrick Galbraith
Hi all, Just a quick post I keep meaning to get out to let people know about my slides I presented at AnsibleFest where I discussed managing Docker with Ansible http://www.slideshare.net/PatrickGalbraith/docker-ansible-34909080 Additionally, I'm posting a series on my blog about Docker,

Re: [ansible-project] Dictionary from Register as Module Arg

2014-06-11 Thread James Cammarata
You still need to specify the value as a complex arg: - name: Verify OSPF Information nxapi_ospf: host: {{ inventory_hostname }} user: admin passwd: cisco.com neighborInfo: {{item.value}} register: insieme.ospf with_dict: insieme.topo On Wed, Jun

Re: [ansible-project] Ansible-pull failing due to Vault issues (not using vault!)

2014-06-11 Thread James Cammarata
Did you recently upgrade ansible? The function in question does in fact receive that parameter, so I'm wondering if there's some mix up in library files/cruft left over from a previous installation of some kind. On Wed, Jun 11, 2014 at 4:06 AM, Ben Sebborn b...@skiddle.com wrote: We have been

Re: [ansible-project] Ansible and complex hierarchy

2014-06-11 Thread andreub
Yes! it worked for the tasks, thanks The only thing were the handlers, they were triggered just once. So I added (at the end of the meta-task) - meta: flush_handlers And then they were ran twice but both with the parameters of the first role Finally I had to add parametrize the handlers as

Re: [ansible-project] Request to improve RDS module to use boto rds2

2014-06-11 Thread iain wright
Hi Michael, Thanks for the reply! That makes sense, I'm still learning the ansible/correct way :) Do you think we should we pursue modifying the boto rds interface to support the param or should we modify the ansible rds module to use rds2 (which seems to support option groups and a couple other

Re: [ansible-project] Recommended way to regex replace multiple lines in a configuration file

2014-06-11 Thread Michael DeHaan
Like the filter plugin? How might that look in a playbook? On Tue, Jun 10, 2014 at 12:22 PM, eskhool anshuman.aggar...@gmail.com wrote: Sorry to dig out an old post but Michael would an enhancement to the regex plugin to do multi line be accepted? Seems like pretty useful functionality and

Re: [ansible-project] ERROR: A vault password must be specified to decrypt data

2014-06-11 Thread Michael DeHaan
Per James's comment, this is now resolved on the development branch! On Tue, Jun 10, 2014 at 11:41 AM, Michael Hauck michael.ha...@avenyou.com wrote: Since this affects me as well, I opened an issue: https://github.com/ansible/ansible/issues/7716 Best regards, Michael On Tuesday,

Re: [ansible-project] Re: Remove task loop item from output

2014-06-11 Thread Michael DeHaan
We're not going to be adding anything called sensitive_keys, especially as filtering is not just about sensitivity. Tasks take a no_log: True attribute to prevent their output from hitting syslog, easiest is to also make this automatically dock the verbosity in the callback. On Wed, Jun 11,

Re: [ansible-project] synchronize module connects to local machine as root before calling rsync

2014-06-11 Thread Michael DeHaan
No, we don't add documentation in this project when the software can be made to do the right thing. If localhost needs to know to use the local connection here, this can be dealt with amid the various fuzzy logic already in the synchronize plugin. On Wed, Jun 11, 2014 at 11:08 AM, Chris

Re: [ansible-project] Re: Executing subset of task with tags does not work

2014-06-11 Thread Michael DeHaan
When you use tags you are selecting what to execute. There are no negative tags. Both tags above have been applied with update, and you've requested all things with update to run. On Wed, Jun 11, 2014 at 10:35 AM, Michael Hauck michael.ha...@avenyou.com wrote: I think I found the problem in

Re: [ansible-project] Maintaining state of a set of machines which are not always up or connected

2014-06-11 Thread Michael DeHaan
A really awesome solution here are the provisioning callbacks in Ansible tower. Set up a cron tab that pings tower (anacron, firstboot, whatever) and when the machine checks in, ansible jobs will make sure that system gets the latest configuration. This is better than ansible-pull because you

Re: [ansible-project] Conditional Include Question

2014-06-11 Thread Michael DeHaan
Includes with conditionals are implemented by including all the steps and applying the conditional to each included task. You will get skipped messages. Often a better solution is using the group_by module to create a dynamic group, and then applying that config to just the hosts that match.

Re: [ansible-project] environment variables ISSUE {{ lookup('env','HOME') }}

2014-06-11 Thread Michael DeHaan
Also please be sure you're aware lookup plugins execute on the ansible control machine, not the remotes. (For those environment variables, there are facts available) On Wed, Jun 11, 2014 at 2:52 PM, James Cammarata jcammar...@ansible.com wrote: There was also a bug in the early 1.6 branch

Re: [ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Michael DeHaan
This might be a good opportunity to create a MySQL facts module that returns information about a server, While you're free to do that, not sure we want this -- Trying to control over-proliferation of ansible-facts modules if possible as here the register seems pretty easy. If it returns a giant

Re: [ansible-project] Tidbits of info, Docker/Ansible

2014-06-11 Thread Michael DeHaan
Folks should also read here as the AnsibleFest presentations didn't show how to build containers with ansible, which I think is the cool part. http://www.ansible.com/blog/2014/02/12/installing-and-building-docker-with-ansible Swarm should soon replace all the manual-placement goo that things

Re: [ansible-project] environment variables ISSUE {{ lookup('env','HOME') }}

2014-06-11 Thread Marcos Cano
Well I will check of I'm running that version because that's exactly what's happening, empty variables, also the funny thing about it is that the playbook is run loclahost, when I run env in the machine I do get all the variables right. But when running the playbook some of those variables are

Re: [ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Michael Peters
I've wanted to create a mysql_query module that would probably help with a lot of things like this. It could execute an arbitrary query and then you could register the results. Would make it easier than having to manipulate mysql command line stdout since you could use structured data. I just

Re: [ansible-project] synchronize module connects to local machine as root before calling rsync

2014-06-11 Thread Chris Hoffman
Ok, well I did track down the issue into the delegate code in the core runner. By forcing the transport to local, this resolved the issue. It appears all the delegate logic deals with hostvars to make the determination on transport to use. I spent some time digging into the action plugin

[ansible-project] ControlPath too long for Unix domain socket

2014-06-11 Thread Zaven
We have been experiencing this bug consistently for some time. Is there a ticket to track this, Ansiblers? fatal: [ec2-54-xxx-yyy-zz.us-west-2.compute.amazonaws.com] = failed to transfer file to /home/ubuntu/.ansible/tmp/ansible-tmp-1402514262.96-23740295147290/source: Warning: Permanently

Re: [ansible-project] using Ansible for 100% of rails development

2014-06-11 Thread Ryan Rix
Weston Platter westonplat...@gmail.com writes: I wanted to ask if anyone out there is using Ansible to provision servers and 100% deploy their Rails (rather than using Capistrano). I saw a couple of posts/projects related to this: * https://mxey.net/deploying-rails-with-ansible/ *

Re: [ansible-project] mysql_db state=import only once

2014-06-11 Thread Paul Durivage
Nope, I'm good - I'm not super interested in MySQL so I'm not personally going to take part in writing this module. Might be useful and/or fun for someone to tackle. On Wednesday, June 11, 2014, Michael DeHaan mich...@ansible.com wrote: This might be a good opportunity to create a MySQL facts

[ansible-project] Re: Populating an EC2 Security Group rules (using ec2_group modules) with IPs (Pingdom probe servers) gathered dynamically at playbook runtime

2014-06-11 Thread Jaime Gago
Nice work around, thanks a lot for sharing, for the record I am doing something similar in other AWS oriented playbooks (e.g. to create mappings of the AWS random subnets IDs to the actual subnet CIDR I've defined in my var files) but I didn't think about using it here. It seems the