[ansible-project] Re: template failure on a rather odd looking file (for apache+logstash)

2015-01-03 Thread Dan Vaida
Can you show the contents of templates/etc/httpd/conf/httpd.conf.j2? Seems you're cat'ing the file directly on the target host. BTW, when using the template module you don't need to specify 'templates/' in the src. Same for the copy module with the 'files/'), etc. On Friday, 5 December 2014

Re: [ansible-project] Escaping special characters inside variable?

2015-01-03 Thread Tom Bamford
Hi John Python has the re.escape() method but I don't know if Ansible exposes this in the form of a Jinja2 filter (seemingly not, looking at https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/filter_plugins/core.py ). I'm curious, why both the check with grep *and* the regexp

[ansible-project] Re: Escaping special characters inside variable?

2015-01-03 Thread Dan Vaida
When you say you're sure, is that because you tried 'debug: var=result'? Furthermore, are you doing something else with Postgres' port in your iptables rule? If not, simply remove the first task and then in the second task, remove everything before '-p\ tcp...' from the regexp and you should

[ansible-project] Ad-Hoc Works; Playbook Works. Wait... No it doesn't.

2015-01-03 Thread Chris Short
This ad-hoc command works for me: ansible -s -m copy -a src=roles/pi_ddclient/files/etc/ddclient.conf dest=/etc/ddclient.conf owner=root group=root mode=0600 backup=yes daffy However when I run the playbook containing the same command (with sudo: true specified) it does not copy the file into

[ansible-project] Re: 127.0.0.1 and localhost in synchronize module

2015-01-03 Thread Dan Vaida
Here's what I do to gain some other benefits: - I let Vagrant dynamically generate the hosts file that is later used by Ansible. - the Vagrant boxes use a different subnet thus not conflicting with the corner case described above. On Wednesday, 13 August 2014 16:59:52 UTC+2, Jeppe Toustrup

[ansible-project] copy local or fetch with content

2015-01-03 Thread Akos Vandra
Hello! Are there any plans to support the content parameter in fetch similar to how it's done in copy? Would you accept a PR for it? I need to set the contents of a local file in the playbook directory. Using copy with delegation to localhost does not work unless I hardcode the location of the

Re: [ansible-project] Accessing variable data from a filter

2015-01-03 Thread Akos Vandra
I know map is an existing jinja2 filter, but as far as I see they are capable of calling methods only on the elements themselves, and they are not able to be used as I would intend to. But, please, correct me if i'm wrong. Akos On 2 January 2015 at 19:41, Brian Coca bc...@ansible.com wrote:

Re: [ansible-project] Re: Reconnect after the user is added

2015-01-03 Thread anatoly techtonik
Hi Paul, On Tue, Dec 30, 2014 at 6:51 PM, Paul Tötterman paul.totter...@gmail.com wrote: Is there a way to make Ansible reconnect to continue? I am adding user and I need to execute the rest of the operations under this user - making checkout of the project with his forwarded SSH key.

Re: [ansible-project] Re: Reconnect after the user is added

2015-01-03 Thread Paul Tötterman
Thanks for the hint. Does that mean that Ansible reconnect to remote machine after each play? (Can't test it right now) If you increase the verbosity using -v you'll see that ansible connects for each task. But it's probably easier to group tasks to be executed with a certain user as a

[ansible-project] Check file for staleness or comparing ctime to current time in Ansible

2015-01-03 Thread Mirko Friedenhagen
Hello, I want to use Ansible for updating Jenkins plugins. So I download the update information via curl. I do not want to do this every time I run the playbook but only when the downloaded file is stale, say older than one day. I know how to get the stat of the file: - name: Check Jenkins

[ansible-project] include: {{ ansible_os_family }}.yml not working

2015-01-03 Thread Francisco Reyes
Was going over different posts on how to handle different OS within a role. In this thread: https://groups.google.com/forum/#!searchin/ansible-project/group_by$20role|sort:relevance|spell:false/ansible-project/OPCESPvMppg/5ueNHQf_oSAJ I see: You can do things like - include: {{