[ansible-project] Re: Trying to run script from inside directory

2015-05-08 Thread Yassen Damyanov
On Friday, May 8, 2015 at 12:04:52 AM UTC+3, John Oliver wrote: > > I'm using 'unarchive' to extract a tarball to /tmp/ Inside, I have a > shell script with includes references to relative paths. This made my > script fail as it was looking for the files relative to whatever directory > it's

[ansible-project] Re: detecting version of syslog-ng

2015-05-08 Thread Yassen Damyanov
On Wednesday, May 6, 2015 at 4:33:43 PM UTC+3, Randy Bush wrote: > > have a playbook bit to distribute syslog-ng.conf to a bunch of servers, > some running syslog-ng 3.3 and some running 3.5. so there are two > different configuration files. > > is there a way to detect which version a host i

[ansible-project] Re: detecting version of syslog-ng

2015-05-08 Thread Yassen Damyanov
Randy, FYI: the output of that script (after beautifying it a bit): { "changed": false, "rc": 0, "ansible_facts": { "rsyslog_ver": "5.8.6," } } (The trailing comma in the rsyslog_ver value is redundant but you should get the idea.) -- You received this message because y

[ansible-project] Re: Trying to run script from inside directory

2015-05-08 Thread Yassen Damyanov
On Friday, May 8, 2015 at 12:31:04 PM UTC+3, Yassen Damyanov wrote: > > > On Friday, May 8, 2015 at 12:04:52 AM UTC+3, John Oliver wrote: >> >> I'm using 'unarchive' to extract a tarball to /tmp/ Inside, I have a >> shell script with includes references to relative paths. This made my >> scri

Re: [ansible-project] Combine with_items with when.

2015-05-08 Thread Jonas Rottmann
Hi, Without quotes I get the same error without quotes... - name: Vhosts apache config template: src=apache_vhost.j2 dest=/etc/apache2/sites-available/{{ item.domain }}.conf with_items: apache.vhosts when: ansible_os_family == 'Debian' and item.state == 'availible' tags: - apache n

[ansible-project] Re: simple rails app (login shell command)

2015-05-08 Thread Yassen Damyanov
On Monday, May 4, 2015 at 4:13:13 PM UTC+3, Ivan Müller wrote: > > Hi there before all thanks fot the amazing work that you already done > > Is only one thing that keep make me noise when I use Ansible, normally I > use RVM to handle different versions of ruby and every time that i need to > r

Re: [ansible-project] Role default vars not being read?

2015-05-08 Thread Jerry Steele
That's the puppy! Thanks for the insight. That template syntax doesn't seem to be documented anywhere that I can see. Might be useful if it was... Thanks Jerry On Thursday, 7 May 2015 17:06:40 UTC+1, Brian Coca wrote: > > not sure why you expect those vars to be part of host, your definition

[ansible-project] Toggle verbosity when running playbooks through the Ansible playbook API.

2015-05-08 Thread Ayaz Ahmed Khan
Hi When I execute a playbook through the playbook Python API, is there a way to toggle the verbosity of the output? I have enabled logging for Ansible by configuring the `log_path` variable as well as by using a `log_plays` callback, but have not succeeded in achieving very verbose output of A

Re: [ansible-project] Re: Super long delay with playbook

2015-05-08 Thread Brian Coca
it sounds like the ansible process is dieing but the sockets are not being closed, can you check dmesg to see if there are any resource issues? On Thu, May 7, 2015 at 4:16 PM, John Oliver wrote: > This is odd. I can ssh into the host in question, no problem. In the logs, > I get: > > May 7 13:

Re: [ansible-project] bad PATH when running "apt" module

2015-05-08 Thread Brian Coca
The first one I would look at is sudo (/etc/sudoers), as it normally resets all env variables for a user. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send

Re: [ansible-project] bad PATH when running "apt" module

2015-05-08 Thread Alex Peters
On Friday, 8 May 2015 23:27:09 UTC+10, Brian Coca wrote: > > The first one I would look at is sudo (/etc/sudoers), as it normally > resets all env variables for a user. > The contents of my /etc/sudoers and /etc/sudoers.d/* files are: Defaults env_reset Defaults mail_badpass Defaults secure_pa

Re: [ansible-project] bad PATH when running "apt" module

2015-05-08 Thread Brian Coca
try: sudo sh -c 'echo $PATH' su can readd path info, the above is closer to what ansible does (it uses sudo -u not sudo su). -- Brian Coca -- 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] bad PATH when running "apt" module

2015-05-08 Thread Alex Peters
On Fri, 8 May 2015 11:55 pm Brian Coca wrote: try: sudo sh -c 'echo $PATH' su can readd path info, the above is closer to what ansible does (it uses sudo -u not sudo su). $ sudo sh -c 'echo $PATH' /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/opt/vc/bin -- You

Re: [ansible-project] Role default vars not being read?

2015-05-08 Thread Brian Coca
The templates are jinja2, you can find the documentations at http://jinja.pocoo.org/docs/dev/ -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [ansible-project] Want to use private_key_file as varable in template file.

2015-05-08 Thread Brian Coca
something like: lookup('pipe', 'grep private_key_file /etc/ansible/ansible.cfg|cut -f2 -d"="') -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email t

[ansible-project] no_log with bin/ansible ?

2015-05-08 Thread Ken Anderson
Is there any way to use no_log with ansible ad-hoc commands? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To

Re: [ansible-project] Error Submitting a job

2015-05-08 Thread Brian Coca
>From that error it looks like there is no python at /usr/bin/python at the target host, normally this is due to not having python install or having it in an alternate location (which you can direct ansible to with the ansiblie_python_interpreter variable). On Thu, May 7, 2015 at 11:13 AM, Oscar B

[ansible-project] Problem using fetch and with_items

2015-05-08 Thread Jeff Potts
I can successfully fetch a file with an explicit src. However, when I try to use with_items, I am getting a "remote file does not exist" error. It doesn't matter whether I use a hard-coded list for with_items or a variable. Here is the playbook: --- - hosts: '{{ hosts }}' tasks: - name: Li

Re: [ansible-project] Problem using fetch and with_items

2015-05-08 Thread Brian Coca
try src={{item}} $var was removed from ansible several versions back. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+uns

Re: [ansible-project] Problem using fetch and with_items

2015-05-08 Thread Jeff Potts
That worked, thanks. On Friday, May 8, 2015 at 11:11:42 AM UTC-5, Brian Coca wrote: > > try > src={{item}} > > $var was removed from ansible several versions back. > > > > -- > Brian Coca > -- You received this message because you are subscribed to the Google Groups "Ansible Project" gro

Re: [ansible-project] Combine with_items with when.

2015-05-08 Thread Brian Coca
does every list entry in apache.vhosts have 'state'? -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegro

Re: [ansible-project] no_log with bin/ansible ?

2015-05-08 Thread Brian Coca
not currently. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send emai

Re: [ansible-project] ansible testserver -m ping -vvvv: FAILED => SSH Error: debug1: Calling cleanup 0x8078582(0x0)

2015-05-08 Thread dusank
Brian, when do you think you'll find enough time to look into it? On Thursday, May 7, 2015 at 6:31:59 PM UTC+2, Brian Coca wrote: > > downloaded, but not tested, I have not had the time yet. > > On Thu, May 7, 2015 at 12:31 PM, dusank > > wrote: > > > > Brian, have you been finally able to rep

[ansible-project] include_vars and hash-behaviour

2015-05-08 Thread Michail Alexakis
Hello list, I have encountered some not expected results when i tried to include (with include_vars) multiple var files in the beginning of a play. I normally use the "merge" hash behavior (ansible.cfg) because it seems more natural to me: i usually have highly nested variable dicts and i wis

[ansible-project] Re: Openstack - auto_floating_ip

2015-05-08 Thread Jonathan Davila
Hey guys, for now I'd suggest using the modules currently in the pull request queue, the ones made by emonty. https://github.com/ansible/ansible-modules-core/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+openstack Just download any or all of them into your $PLAYBOOK_ROOT/library directory and you s

[ansible-project] Get output of command that includes many quotes?

2015-05-08 Thread John Oliver
I want to register a variable with my java version. I can get that with: java -version 2>&1 | head -1 | awk 'BEGIN { FS = "\"" } ; { print $2 }' That gives me the result I want: 1.8.0_45 But I cannot make this happen in ansible :-( I'm going crazy with quotes and escapes. I've tried: - na

Re: [ansible-project] Get output of command that includes many quotes?

2015-05-08 Thread Matt Martz
Because I would rather use jinja2 than piping through a bunch of shell commands: - name: Run java -version command: java -version register: java_version_out changed_when: false - name: Set java_version var set_fact: java_version="{{ java_version_out.stderr.splitlin

[ansible-project] Output of script & newline

2015-05-08 Thread John Oliver
ansible 1.9.0.1 - name: Get java version script: /tmp/javaver.sh register: java_ver - name: Touch test file copy: dest="/tmp/{{ java_ver.stdout }}" content="test" TASK: [Show output from installer] ok: [flamingo] => { "

Re: [ansible-project] Get output of command that includes many quotes?

2015-05-08 Thread John Oliver
Nice! However, your regex is also killing the underscore, and I need that. I'm starting to monkey around with this, but I just don't know jinja, and I bet you'll have the right magic sauce before I can puzzle it out :-) Thanks! On Friday, May 8, 2015 at 2:45:21 PM UTC-7, Matt Martz wrote: > >

Re: [ansible-project] Output of script & newline

2015-05-08 Thread Matt Martz
Use the |trim jinja2 filter to strip whitespace off of the ends. On Fri, May 8, 2015 at 4:55 PM, John Oliver wrote: > ansible 1.9.0.1 > > - name: Get java version > script: /tmp/javaver.sh > register: java_ver > > - name: Touch test file > copy: dest="/tmp/{{ java_ver.stdout }}"

Re: [ansible-project] Get output of command that includes many quotes?

2015-05-08 Thread Matt Martz
You can add the underscore to the list of allowed characters in the regex_replace: regex_replace('[^\d_.]+', '') On Fri, May 8, 2015 at 5:03 PM, John Oliver wrote: > Nice! However, your regex is also killing the underscore, and I need > that. I'm starting to monkey around with this, but I jus

[ansible-project] fetch module fails checksum when remote user's shell is set to /bin/tcsh

2015-05-08 Thread breatheoften
I created an issue reporting what appears to me to be a bug in the fetch module -- the fetch module succeeds in grabbing the remote file and then always fails its checksum test if the remote user's login shell is set to /bin/tcsh -- but works when the remote user's login shell is set to /bin/ba

Re: [ansible-project] fetch module fails checksum when remote user's shell is set to /bin/tcsh

2015-05-08 Thread Brian Coca
hi, im the bot that closed the issue, in the response you might have missed the answer: set ansible_shell_type=csh group/host var for this host and checksumming should work again. Different shell families need different quoting. On Fri, May 8, 2015 at 8:25 PM, breatheoften wrote: > I created an

Re: [ansible-project] fetch module fails checksum when remote user's shell is set to /bin/tcsh

2015-05-08 Thread Ben Cohen
Ah ok, yeah I didn't see the above answer in the response on the issue ... I'm surprised this isn't a faq. Thanks, Ben On Fri, May 8, 2015 at 5:27 PM, Brian Coca wrote: > hi, im the bot that closed the issue, in the response you might have > missed the answer: > > set ansible_shell_type=csh gro

Re: [ansible-project] Re: detecting version of syslog-ng

2015-05-08 Thread Randy Bush
ok, for the record, here is what i ended up with --- - hosts: ubuntu:debian tasks: - name: run syslog-ng --version command: syslog-ng --version register: ver_out changed_when: false - name: set ver set_fact: ver="{{ ver_out.stdout.splitlines()[0]|regex_replace('[^\d.]+',

Re: [ansible-project] Want to use private_key_file as varable in template file.

2015-05-08 Thread t goto
Sounds like a plan! :) I willl try this method, thanks! 2015年5月8日金曜日 23時46分28秒 UTC+9 Brian Coca: > > something like: > lookup('pipe', 'grep private_key_file /etc/ansible/ansible.cfg|cut -f2 > -d"="') > > > -- > Brian Coca > -- You received this message because you are subscribed to the Goog