Re: [ansible-project] do-until with uri module

2016-05-20 Thread Matt Martz
That is a little more complicated: result['json']|default(dict())['ok']|default(0) There are other ways too, but effectively you have to do it at each level. On Friday, May 20, 2016, Marcus Morris wrote: > One more question: > > How do I use default for a variable more than one level down? >

Re: [ansible-project] do-until with uri module

2016-05-20 Thread Marcus Morris
One more question: How do I use default for a variable more than one level down? such as result['json']['ok'] | default(0) == 1 that gives me FAILED! => { "failed": true, "msg": "ERROR! The conditional check 'result['json']['ok']|default(0) == 1' failed. The error was: ERROR! error while ev

Re: [ansible-project] Block & Playbooks

2016-05-20 Thread Brian Coca
​inside plays, block can only contain tasks. -- -- 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...@googlegr

[ansible-project] How to write a interface for multiple node with different ips using ansible

2016-05-20 Thread satheesh prabhakaran
I am trying out creating bridges and adding ips to bridges in multiple servers which need to be interconnected for Openstack Ansible Deployment. I am stucking in configuring bridges with different ips. -- You received this message because you are subscribed to the Google Groups "Ansible Projec

Re: [ansible-project] do-until with uri module

2016-05-20 Thread Matt Martz
Maybe use the |default filter like: until: result['status']|default(0) == 200 On Fri, May 20, 2016 at 2:57 PM, Marcus Morris wrote: > So I am running 'canary' tests post CI and pre deployment to test if the > newest code runs without error in a real environment. > > The tests are just hitting a

Re: [ansible-project] do-until with uri module

2016-05-20 Thread Marcus Morris
that worked! You're amazing. On Friday, May 20, 2016 at 2:59:13 PM UTC-5, Matt Martz wrote: > > Maybe use the |default filter like: > > until: result['status']|default(0) == 200 > > On Fri, May 20, 2016 at 2:57 PM, Marcus Morris > wrote: > >> So I am running 'canary' tests post CI and pre deploym

[ansible-project] do-until with uri module

2016-05-20 Thread Marcus Morris
So I am running 'canary' tests post CI and pre deployment to test if the newest code runs without error in a real environment. The tests are just hitting a url and checking that it returns 200. Sometimes it takes a little bit for the process I'm testing against to become available which means

[ansible-project] Checking the presence of some CA certificate on a remote Linux host

2016-05-20 Thread Mischa ter Smitten
This role might be helpful: https://github.com/Oefenweb/ansible-ca-certificates -- 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...@go

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
DING! That worked. Thank you so much! On Friday, May 20, 2016 at 11:56:12 AM UTC-5, Brian Coca wrote: > > you are mixing notations > > {{ hostvars['server1']['timestamp']['stdout'] }} > > > -- > Brian Coca > -- You received this message because you are subscribed to the Google Groups "

Re: [ansible-project] Installing Apache through Ansible

2016-05-20 Thread Kai Stian Olstad
On 20. mai 2016 18:44, Perry Hoekstra wrote: Thanks for the response but the issue with that solution is this is all dynamic and automated so there would be no person to respond. You could set ansible_become_pass if you can have the sudo password in clear text or add "ec2-user ALL=(ALL) NOPAS

Re: [ansible-project] Getting more information back from Ansible (Specifically Yum)

2016-05-20 Thread Brian Coca
we can add 'diff' support to the yum module, I believe we just did to the apt module. -- 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] Vars and register passing on to include playbooks

2016-05-20 Thread Brian Coca
you are mixing notations {{ hostvars['server1']['timestamp']['stdout'] }} -- 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-pro

Re: [ansible-project] Installing Apache through Ansible

2016-05-20 Thread Perry Hoekstra
Kai: Thanks for the response but the issue with that solution is this is all dynamic and automated so there would be no person to respond. I have had to do some ENV things in order for each of the processes that need it to see the *.pem file generated at the beginning of the Ansible process t

[ansible-project] Ansible vars precedence

2016-05-20 Thread antony . perigault
Hello, Related to this issue https://github.com/ansible/ansible/issues/14067 Before ansible 2.0 inventory group vars are load after script group vars. For people that use ansible tower to manage inventories ansible 2.0 behavior is a big problem. Is a bug or a feature ? -- You received this me

Re: [ansible-project] Checking the presence of some CA certificate on a remote Linux host

2016-05-20 Thread Kai Stian Olstad
On 20. mai 2016 15:25, jean-christophe manciot wrote: I need to download & install the CA certificate *only if it is not present on the remote host*. Does anyone know how to achieve the CA certificate presence check with Ansible? That will be used to populate a variable used for something along t

Re: [ansible-project] Installing Apache through Ansible

2016-05-20 Thread Kai Stian Olstad
On 19. mai 2016 19:46, Perry Hoekstra wrote: The 'ec2_apache' role allocates an ec2 instance and the first task within the apache/main.yml looks like this: - name: confirm using the latest Apache server become: yes become_method: sudo yum: name: httpd state: latest This is where t

[ansible-project] cant remove a role from galaxy

2016-05-20 Thread Rob Cousins
Hi i have a problem removing one of my roles from galaxy First i uploaded a role called ovirt_host_add Then renamed this to ovirt_hosted_engine_install in my git repo. Then re imported the role in galaxy Now i am left with two roles in galaxy. ovirt_host_add ovirt_hosted_engine_install Both po

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
When I do this: {{ hostvars['server1']['timestamp.stdout'] }} as in: - name: "Backup {{ proddbname }} Database" mysql_db: "state=dump name={{ proddbname }} target={{ homedir }}{{ proddbname }}{{ hostvars['server01']['timestamp.stdout'] }}.sql.gz" It gives me the error fatal: [prod

[ansible-project] Group ec2 instances and local machines together

2016-05-20 Thread Josh Smift
We wrote a sort of meta-inventory script to do this kind of thing; https://github.com/caredotcom/ansible-quartermaster might be useful (as is, as an example, as a warning, etc :^). (Wanting AWS things things with tag_whatever_foo, and static things in group 'foo', to both end up in the same Ansibl

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Brian Coca
hostvars are not accessible at the play level, but should be accessible within the play. -- 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

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
So in order to access this var/register from server01, I could do something like in playbook-01.yml: --- - hosts: "{{ hostvars['server01']['proddbhost'] }}" (When I do that I get "ERROR! 'hostvars' is undefined" On Friday, May 20, 2016 at 8:30:48 AM UTC-5, Brian Coca wrote: > > vars don't the

Re: [ansible-project] Ansible support for pmrun in become_method

2016-05-20 Thread Brian Coca
No current plans, I did not know about pmrun until right now. We do try to cover as many of these systems as rational, it is hard with some of these proprietary systems as it requires a license to test and the setups can be wildly different and incompatible with each other when it comes to command

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Brian Coca
vars don't they are play specific, host vars (facts and registered vars) do persist, but they are associated to the specific host. So in subsequent plays you might need to do hostvars['server01']['timestamp'] to get the var if they are not also targetting server01. -- Brian Coca -- Yo

[ansible-project] Checking the presence of some CA certificate on a remote Linux host

2016-05-20 Thread jean-christophe manciot
Hello guys, I need to download & install the CA certificate *only if it is not present on the remote host*. Does anyone know how to achieve the CA certificate presence check with Ansible? That will be used to populate a variable used for something along those lines: - name: Downloading the C

[ansible-project] Checking the presence of some CA certificate on a remote Linux host

2016-05-20 Thread jean-christophe manciot
Hello guys, I need to download & install the CA certificate *only if it is not present on the remote host*. Does anyone know how to achieve the CA certificate presence check with Ansible? That will be used to populate a variable used for something along those lines: - name: Downloading the C

Re: [ansible-project] No module named markupsafe

2016-05-20 Thread Matt Martz
Markupsafe is a dependency of jinja2 and not Ansible. There must have been an issues with installing dependencies with pip that had gone unnoticed. On Friday, May 20, 2016, Wawrzek Niewodniczanski wrote: > Hi, > > I just hit a problem with Ansible installed with pip. I cannot even get > ansible

[ansible-project] No module named markupsafe

2016-05-20 Thread Wawrzek Niewodniczanski
Hi, I just hit a problem with Ansible installed with pip. I cannot even get ansible version (see the bottom), but it is version 2.0.2.0 @ Ubuntu 14.04.4 LTS pip list | grep ansible ansible (2.0.2.0) Installing markupsafe resolve the problem sudo pip install markupsafe Initial error message a

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
--- - hosts: server01 remote_user: jlouthan vars: proddbhost: proddb01 tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' register: timestamp run_once: true - name: Get current datestamp loc

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
indented var: that is a copy/paste mistake. So those vars and register will not persist to any of the other include playbooks? On Friday, May 20, 2016 at 7:49:18 AM UTC-5, Brian Coca wrote: > > So vars seems to be incorrectly indented, also you should not need to add > 'bash' to command > > The

[ansible-project] Re: Group ec2 instances and local machines together

2016-05-20 Thread Alexey Vazhnov
Yes, just put your static inventory and EC2 dynamic inventory script in one folder. On Friday, May 20, 2016 at 5:45:13 PM UTC+5, Alex Braun wrote: > > I want to run a playbook with some group_vars on some Amazon EC2 instances > and on some local machines. Is there some way that I can group EC2

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Brian Coca
So vars seems to be incorrectly indented, also you should not need to add 'bash' to command The registered var should persist but it is available only through the server01 host. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project

[ansible-project] Group ec2 instances and local machines together

2016-05-20 Thread Alex Braun
I want to run a playbook with some group_vars on some Amazon EC2 instances and on some local machines. Is there some way that I can group EC2 instances (by tag) and local machines under the same inventory group? For instance: inventory/dev.yml ``` macbookpro ansible_ssh_host=1.2.3.4 [dev] mac

[ansible-project] Getting more information back from Ansible (Specifically Yum)

2016-05-20 Thread Mike McCormick
Hey Guys, I'm in the earlier stages of an Ansible deployment. I have one question perhaps someone can help with. I'm currently firing off an email internally for playbooks as per the mail modules examples . What I'd *really *like to

[ansible-project] Installing Apache through Ansible

2016-05-20 Thread Perry Hoekstra
I am attempting to create an EC2 instance in one role and installing Apache on it in the next role. The pertinent playbook entry looks like this: # Configure and deploy Apache - hosts: localhost connection: local remote_user: ec2-user gather_facts: false roles: - ec2_apache - ap

[ansible-project] Ansible support for pmrun in become_method

2016-05-20 Thread Taeho Kgil
Hi, Is there a plan to support pmrun options in the become_method for Ansible? Thanks -- 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+unsub

Re: [ansible-project] Ansible 2 group_vars order

2016-05-20 Thread antony . perigault
Nobody know the group load order ? I can't imagine a random load ? An ansible developer to help me ? Le jeudi 19 mai 2016 09:15:44 UTC+2, antony.p...@polyconseil.fr a écrit : > > My question is about this part of doc: > > If multiple groups have the same variable, the last one loaded wins > > Wh