[ansible-project] --list-roles like --list-task

2015-06-02 Thread Jeff Reter
Hello, is there something like "--list-roles" like "--list-task" i need to know with host (playbooks) will change if i change a role. Thanks -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving e

[ansible-project] su for role and password from vault

2015-06-02 Thread knacktus
Hi guys, I need to run my roles as different user. However, the users don't have login permissions. I need to su after logon with the user that executes the ansible playbook. I've already stored the different user ids and passwords in a vault. But I don't know where to point to the password.

Re: [ansible-project] Get shell environment variables on target after going thru a bastion

2015-06-02 Thread benno joy
if gather_facts are run on the target server, the hash {{ ansible_env }} should have some environment variables. also the ansible ssh connection doesnt invoke a login shell so .bashrc scripts wouldnt not be run . if you use sudo and set -i flag in sudo_flags in ansible.cfg a login shell would be in

Re: [ansible-project] wait_for, ssh config, & SOCKs

2015-06-02 Thread benno joy
Hi Chris, wait_for doesnt not use ssh/config files and will uses tcp connection to test if port 22 is open for connection and hence tries to lookup the ip via dns. maybe you could try the below to test if ssh has come up or not. local_action: shell ssh "{{item['private_dns_name'] }}" echo hello

[ansible-project] unarchive

2015-06-02 Thread knacktus
Hi guys, after upgrading from 1.8 to 1.9.1 the unarchive doesn't work any more. msg: dest '...' must be an existing dir I've found several issues in the bug tracker, but they're all closed. The problem is that there seems to be a fix or workaround, but I don't find or understand it. Or should

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Brian Coca
can you show that variable in a debug during execution? it does not look like it is being set properly. On Tue, Jun 2, 2015 at 11:55 PM, Barry Kaplan wrote: > > > On Wednesday, June 3, 2015 at 8:54:06 AM UTC+5:30, Brian Coca wrote: >> >> the ssh ip in task 3 is '{' which indicates that the [0] i

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Barry Kaplan
On Wednesday, June 3, 2015 at 8:54:06 AM UTC+5:30, Brian Coca wrote: > > the ssh ip in task 3 is '{' which indicates that the [0] is applied > to the 'template string' and not to the resulting array you expect. > This makes the 3rd task fail as it cannot ssh to '{'. > Exactly. Is that a mist

Re: [ansible-project] Getting handlers to run in-between roles

2015-06-02 Thread Brian Coca
sorry for mislead, I need to have my email clients start validating my code blurbs. On Tue, Jun 2, 2015 at 8:43 PM, Toby Corkindale wrote: > Hi > That didn't work, but you put me on the right path -- it needed to be > meta: flush_handlers > (note underscore instead of dash) > > Thanks, appreciate

Re: [ansible-project] from ansible.utils Cannot import makedirs_safe

2015-06-02 Thread Brian Coca
should be fixed now, pull and try again (i was missing path in import path for make path utility) On Tue, Jun 2, 2015 at 9:25 PM, Michael Legleux wrote: > Since my host_var and group_var s are not getting used since I updated > ansible to the latest git checkout last night, I decided to put the >

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Brian Coca
the ssh ip in task 3 is '{' which indicates that the [0] is applied to the 'template string' and not to the resulting array you expect. This makes the 3rd task fail as it cannot ssh to '{'. On Tue, Jun 2, 2015 at 9:49 PM, Barry Kaplan wrote: > 2) ssh ... -o ConnectTimeout=10 10.0.139.56 /bin/sh

[ansible-project] Get shell environment variables on target after going thru a bastion

2015-06-02 Thread Steve Orr
I access a target host thru a bastion server which requires a Yubikey password. I have setup ssh keys so I can access the target host without a password prompt once the authenticated socket on the bastion is cached. When I run setup against the target host, none of the specific environment vari

[ansible-project] corrupted output when running script module

2015-06-02 Thread dave
Hello, I'm having a problem with Ansible 1.8.4, which I'm running on a Macintosh to remotely configure a host running on Amazon AWS. The command I'm using to run a playbook is as follows: ansible-playbook playbooks/site.yml -l ec2-54-242-9-223.compute-1.amazonaws.com -v -s -i inventory/qa -e

[ansible-project] wait_for, ssh config, & SOCKs

2015-06-02 Thread fortescue
Hi, I am trying to figure out how to use wait_for to start to detect ssh on a VPC host that needs to use 2 tunnels to be reached. I cannot use the IP address as it collides with my local network. DNS also doesn't work but my tunnels work fine. I'm using SOCKs because I use a browser to acces

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Barry Kaplan
2) ssh ... -o ConnectTimeout=10 10.0.139.56 /bin/sh -c ... 3) ssh ... -o ConnectTimeout=10 { /bin/sh -c ... So you don't think that the ssh ip in the 3 task should not be the same as 2? I'm sorry Brian, but I am not all following what the miscommunication is here. -- You received

[ansible-project] from ansible.utils Cannot import makedirs_safe

2015-06-02 Thread Michael Legleux
Since my host_var and group_var s are not getting used since I updated ansible to the latest git checkout last night, I decided to put the variables directly in my inventory file. Now it seems like they might be getting read, but now I get this error: ImportError: cannot import name makedirs_safe

Re: [ansible-project] Getting handlers to run in-between roles

2015-06-02 Thread Toby Corkindale
Hi That didn't work, but you put me on the right path -- it needed to be meta: flush_handlers (note underscore instead of dash) Thanks, appreciate the help, Toby On Tue, 2 Jun 2015 at 23:52 Brian Coca wrote: > last task in each role: > > meta: flush-handlers > > On Tue, Jun 2, 2015 at 4:28 AM,

[ansible-project] Re: Issue with os_server module

2015-06-02 Thread Goldberg Eduard
Thanks. worked with Python2.7 -- 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 email

[ansible-project] Re: get name path of current playbook

2015-06-02 Thread Peter Loron
I think it is "playbook_dir". You can also get the path of the current role as "role_path". -Pete On Tuesday, June 2, 2015 at 5:12:14 AM UTC-7, Jeff Reter wrote: > > how to get the name/path of the current playbook, beeing run > > looking for something like a var: > > ansible_playbook > ansible_

[ansible-project] Weekly Ansible Community Meeting Starting

2015-06-02 Thread Toshio Kuratomi
Ansible weekly Community Meeting starting now (17:00 UTC) https://plus.google.com/hangouts/_/gzpqzn6wys6kk5vuv7mkbf6lwma Join if you'd like to talk about any PR/Issue or just want to talk about ansible's development. -Toshio -- You received this message because you are subscribed to the Google

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Brian Coca
the task fails with e 'fatal', what looks the same is the verbose output of what will be executed On Tue, Jun 2, 2015 at 12:43 PM, Barry Kaplan wrote: > > > On Tuesday, June 2, 2015 at 10:04:04 PM UTC+5:30, Brian Coca wrote: >> >> not sure what 'works' means in this context > > > "works" is that

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Barry Kaplan
On Tuesday, June 2, 2015 at 10:04:04 PM UTC+5:30, Brian Coca wrote: > > not sure what 'works' means in this context > "works" is that the third task delegates to the same host as the second task. Don't you expect the exact same output for the last two tasks? Are you seeing something that I

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Brian Coca
not sure what 'works' means in this context On Tue, Jun 2, 2015 at 12:16 PM, Barry Kaplan wrote: > What do you think would be causing the nested templating? Something deep in > variable resolution? > > The third echo is the direct version of first setting the value to a fact, > which works. > > >

[ansible-project] Re: Ansible 1.9.2 rc1 is now available for testing

2015-06-02 Thread Barry Kaplan
Been working great for me all day. -- 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 e

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Barry Kaplan
What do you think would be causing the nested templating? Something deep in variable resolution? The third echo is the direct version of first setting the value to a fact, which works. On Tuesday, June 2, 2015 at 6:56:35 PM UTC+5:30, Brian Coca wrote: > > From the output of the 3rd task it see

Re: [ansible-project] Live command logs

2015-06-02 Thread Brian Coca
ansible is designed to be a batch system so showing live logs is not something that is built in, ansible returns the logs of the work after it has finished. Async tasks can be created but you can only poll the state of the task and not it's output. -- Brian Coca -- You received this message be

Re: [ansible-project] Getting handlers to run in-between roles

2015-06-02 Thread Brian Coca
last task in each role: meta: flush-handlers On Tue, Jun 2, 2015 at 4:28 AM, Toby Wintermute wrote: > Hi, > I must be doing something wrong, but I don't understand what. > I want notified handlers to run between one role and the next. From reading > other posts here, it seems that is how it is s

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-06-02 Thread Brian Coca
>From the output of the 3rd task it seems that mongodb_replica_set_hosts[0] is being interpreted as '{' which, of course, does not resolve. This does not seem to be an array issue but of too many nested templating attempts. -- Brian Coca -- You received this message because you are subscribed

Re: [ansible-project] Unicode issues with Ansible 1.8 and up

2015-06-02 Thread Brian Coca
ansible does not embed jinja2, its just a dependency, so the underlying version depends more on how you installed ansible and pulled it in as a dependency. This is probably caused by the attempt to normalize variable management and error management in 1.8 which fixed/broke many things like this. F

Re: [ansible-project] Unicode issues with Ansible 1.8 and up

2015-06-02 Thread Andres Silva
Thanks a lot for looking into this. I reached out to AWS and they explained that the UserData is encrypted for OpsWorks instances. That is why we are seeing the garbled text that is causing the issue. I asked if there was a way to prevent this from happening but have not heard back yet. Im waiti

[ansible-project] Live command logs

2015-06-02 Thread SVC RVBRAND
Hi All, I am new to ansible and my first task is to prove this tool can help my team. I migrated some of our Capistrano recipes to ansible playbooks as a POC. Ansible works wonderfully but the issue I am facing now is I cannot get the live output message of any command even running locally, th

[ansible-project] get name path of current playbook

2015-06-02 Thread Jeff Reter
how to get the name/path of the current playbook, beeing run looking for something like a var: ansible_playbook ansible_current_playbook -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving email

Re: [ansible-project] "filter" functionality for 'when:' conditional

2015-06-02 Thread Patrick Glomski
Thanks so much for your help, Brian! I'll try to RTFM next time. Patrick On Monday, June 1, 2015 at 5:46:20 PM UTC-4, Brian Coca wrote: > > i think this is the droid you are looking for: > http://jinja.pocoo.org/docs/dev/templates/#map > > On Mon, Jun 1, 2015 at 5:12 PM, Patrick Glomski > > wr

[ansible-project] Re: can we fetch a regex match from a variable value

2015-06-02 Thread Шалыгин Константин
Read down of page . On Tuesday, June 2, 2015 at 2:27:23 PM UTC+6, Max wrote: > > Thanks for the response. > The goal is to match a regular expression and then use the value matched > for doing other things. Just testing whethe

[ansible-project] Getting handlers to run in-between roles

2015-06-02 Thread Toby Wintermute
Hi, I must be doing something wrong, but I don't understand what. I want notified handlers to run between one role and the next. From reading other posts here, it seems that is how it is supposed to work, but it's not what I'm seeing. A simplified version of my playbook layout is like this: pl

[ansible-project] Re: can we fetch a regex match from a variable value

2015-06-02 Thread Max
Thanks for the response. The goal is to match a regular expression and then use the value matched for doing other things. Just testing whether a particular string is present or not doesn't suffice for me. http://example.com:90/xyz http://dual.com.87/yjhh My script should fetch me the host name by

[ansible-project] Re: can we fetch a regex match from a variable value

2015-06-02 Thread Шалыгин Константин
- name: Debug debug: msg='facter_fqdn is {{ facter_fqdn }}' register: 'debug_result' - name: Fail fail: msg='Sample warning when fqnd != fqdn' when: facter_fqdn.find == "{{ facter_fqdn }}" - name: Fail fail: msg='Sample warning when fqdn %like% example.com' when: facter_fqdn.find('exam

[ansible-project] Re: V2 is live

2015-06-02 Thread jhawkesworth
Congratulations on reaching this milestone. Jon On Tuesday, June 2, 2015 at 2:18:42 AM UTC+1, James Cammarata wrote: > > Hi all, the transition on devel to the v2 codebase is complete. If you run > into any problems and want to switch back to using the old v1 codebase from > a git checkout, sim

[ansible-project] can we fetch a regex match from a variable value

2015-06-02 Thread Max
Suppose I've url=http://example.com:90/url and now in my ansible task I want to get the url variable by {{ url }} and then do a regex match and fetch oly the hostname i.e. example.com. Any directions on how this can be achieved would help. -- You received this message because you are subscribed

Re: [ansible-project] how to execute a task/action just when a list of items really exist

2015-06-02 Thread Esteban Freire
Hi Brian, Thank you very much for letting me know :) Cheers, Esteban El lunes, 1 de junio de 2015, 17:54:42 (UTC+2), Brian Coca escribió: > > actually, you won't be hitting that when condition, when with_ detects > an empty list it just skips the task. the when: is redundant and would > actual