[ansible-project] What is recommended version???

2018-05-08 Thread java_cat33
Hi - I'm completely new to Ansible (and not too familiar with Linux). What is the recommended Ansible version? If I download via apt-get or pip by default it is downloading the latest version (2.5.2) - isn't this a dev version? Is it recommended to specify and download 2.4? Thanks! -- You re

[ansible-project] Waiting for OS customization to complete

2018-05-08 Thread Josu Vilda
A question, We have templates that have been saved with sysprep. As I can with Ansible, after deploying the templates, wait for OS customization of sysprep to be completed. I have seen the following article for powercli, but for Ansible ?? https://blogs.vmware.com/PowerCLI/2012/08/waiting-for-o

[ansible-project] Convert an XML to JSON using ansible

2018-05-08 Thread Madushan Chathuranga
Hi, Is there a filter or any work around to convert an XML to JSON using 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+u

RE: [ansible-project] Re: if-elseif-if

2018-05-08 Thread Ali Khawaja
I tried all the suggestions but it did not work. With the following in my config file: sp_ver: 2016 and with following code: sp = ‘abc’ When: sp_ver | int == 2016 sp = ‘def’ When: sp_ver == “2016” Both variations did not work. Jordan mentioned on the irc channel a nice solution which was

Re: [ansible-project] What is recommended version???

2018-05-08 Thread Stephen John Smoogen
On 8 May 2018 at 04:34, java_cat33 wrote: > Hi - I'm completely new to Ansible (and not too familiar with Linux). What > is the recommended Ansible version? > > If I download via apt-get or pip by default it is downloading the latest > version (2.5.2) - isn't this a dev version? > > Is it recommen

[ansible-project] Variable disappears...

2018-05-08 Thread David Villasmil
Hello all, I've got a playbook that does: - name: Get db cluster endpoint shell: "aws --region=us-east-1 rds describe-db-clusters --db-cluster-identifier {{ cluster }}-kam-db" register: aws_cluster_res - set_fact: myvar: "{{ aws_cluster_res.stdout | from_json }}" - set_fact: endpoint: "{{ myva

[ansible-project] Re: Variable disappears...

2018-05-08 Thread Fatima Elfakih
Hi > 1- which version of ansible you use? > 2- which include module you use? import_*/include_*/include? -- 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

[ansible-project] Re: Variable disappears...

2018-05-08 Thread David Villasmil
Thanks for replying: $ ansible-playbook --version ansible-playbook 2.5.2 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/admin/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/dist-packages

[ansible-project] Re: What is recommended version???

2018-05-08 Thread Tony Chia
2.5.x is the latest stable version. It is not a dev version. It's best to use the latest version when starting out On Tuesday, May 8, 2018 at 1:34:45 AM UTC-7, java_cat33 wrote: > > Hi - I'm completely new to Ansible (and not too familiar with Linux). What > is the recommended Ansible version?

[ansible-project] Re: Variable disappears...

2018-05-08 Thread Tony Chia
Is the "replace" task in the same play as the "set_fact" play? It's best if you could provide a reproducible full playbook. You can add debug task between where it's defined and the "replace" task to see when it starts to "disappears" On Tuesday, May 8, 2018 at 8:04:03 AM UTC-7, David Villasmi

[ansible-project] gce.py - toggling between GCE projects

2018-05-08 Thread Michael Bubb
Hello - We are using gce.py / gce.ini in our inventory and it works nicely. One glitch is that I have not found a great way to toggle between projects so I simlink to the gce.ini file I need: ls -lia /etc/ansible/hosts/gce.ini /etc/ansible/hosts/gce.ini -> /etc/ansible/admin_vars/gce/gceiniDEV

Re: [ansible-project] Re: Variable disappears...

2018-05-08 Thread David Villasmil
My playbook has 2 "tasks": I first gather some info, including the hosts to work on, then add them with add_hosts, and then start again some new tasks, could this be it? There are some vars set on the cli that are not lost, could those be global and the ones set in the playbook not be global? On T

[ansible-project] Re: Convert an XML to JSON using ansible

2018-05-08 Thread Ronald Lawhorn
On Tuesday, May 8, 2018 at 7:43:52 AM UTC-4, Madushan Chathuranga wrote: > > Hi, > > There is an xml module > (https://docs.ansible.com/ansible/2.4/xml_module.html) that would allow you > to extract elements of the target and output them through a Json filter > however without further logical

[ansible-project] Re: Convert an XML to JSON using ansible

2018-05-08 Thread Vince Skahan
On Tuesday, May 8, 2018 at 4:43:52 AM UTC-7, Madushan Chathuranga wrote: > > Is there a filter or any work around to convert an XML to JSON using > ansible? > > Why would you possibly want to use 'ansible' to do that ? There are a zillion ways to do it in various languages if you do a little goo

[ansible-project] Re: Variable disappears...

2018-05-08 Thread David Villasmil
It's confirmed, if you set a variable on a playbook, and add_host and make new tasks, this variable is not "forwarded" to the next tasks On Tuesday, May 8, 2018 at 5:04:03 PM UTC+2, David Villasmil wrote: > > Hello all, > > I've got a playbook that does: > > - name: Get db cluster endpoint > shel

[ansible-project] Re: Convert an XML to JSON using ansible

2018-05-08 Thread Madushan Chathuranga
Hi, Thank you very much for the response. First let me explain what I'm trying to do here and then what I have done so far. I'm trying to call and rest api which I'm using URI module to do that. Success response of this api returns a xml response not json. But my end user needs the output from

Re: [ansible-project] Re: Convert an XML to JSON using ansible

2018-05-08 Thread Matt Martz
The problem is that there is no single standard for converting XML to JSON. The following site shows that there are at least 7 conversion methods to convert XML to JSON: http://wiki.open311.org/JSON_and_XML_Conversion/ Is it possible that the API you are calling would utilize a `Accept: applicat

[ansible-project] Re: Variable disappears...

2018-05-08 Thread Jordan Borean
Without seeing the full playbook it is hard to actually confirm what you are doing but it sounds like you have 2 plays in your playbook, 1 to get the host info and add it, the other to run tasks on that new host. When you run set_fact or register in a play, that variable/fact is only registered

Re: [ansible-project] What is recommended version???

2018-05-08 Thread java_cat33
I was just going off the following link. https://docs.ansible.com/ansible/2.4/release_and_maintenance.html On Wednesday, May 9, 2018 at 2:19:57 AM UTC+12, Smooge wrote: > > On 8 May 2018 at 04:34, java_cat33 > > wrote: > > Hi - I'm completely new to Ansible (and not too familiar with Linux

Re: [ansible-project] What is recommended version???

2018-05-08 Thread Jordan Borean
That link is specifically for the docs of the 2.4 version. To always get the latest docs, change 2.4 to latest like so http://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html. Thanks Jordan -- You received this message because you are subscribed to the Google

[ansible-project] Re: What is recommended version???

2018-05-08 Thread java_cat33
Thanks Jordan - nice one. I went off the first Google hit which happened to be 2.4 :-) Cheers for your help. On Tuesday, May 8, 2018 at 8:34:45 PM UTC+12, java_cat33 wrote: > > Hi - I'm completely new to Ansible (and not too familiar with Linux). What > is the recommended Ansible version? > > I

[ansible-project] Re: What is recommended version???

2018-05-08 Thread Jordan Borean
The docs side is somewhat new so some pages in Google might be pointed towards older versions. Making sure the URL is set to latest will always be the latest version while setting to devel will point to the current devel version. Thanks Jordan -- You received this message because you are sub

Re: [ansible-project] Convert an XML to JSON using ansible

2018-05-08 Thread Pshem Kowalczyk
Hi, THe quickest way is to create your own filter: 1. Create a 'filter_plugins' directory (in the same directory as you playbook or roles). 2. Create a xml2json.py file in that directory with the following content: ## cut below class FilterModule(object): def filters(self):

Re: [ansible-project] Re: Variable disappears...

2018-05-08 Thread David Villasmil
Hello Jordan, That's exactly my problem! Now i understand why it's not on the second play. I get the variable again on the second play and it's working properly. Thanks a lot for the exaplanation! David On Tue, May 8, 2018, 22:00 Jordan Borean wrote: > Without seeing the full playbook it is ha

[ansible-project] Deprecation warnings

2018-05-08 Thread Mathias Buresch
Hey there, I am running Ansible 2.5.2 now. Already with version 2.4 I got some deprecation warning and so on. Do I have to adjust all roles by myself or is there a magic script which can find those issues and fix them automatically? 😉 Cheers, Mathias -- You received this message becau

[ansible-project] Why do I have to split up this set_fact into multiple? or am I doing something incorrect?

2018-05-08 Thread Marcos Georgopoulos
Hi can someone please explain why the following two seperate 'set_fact's work. - name : combine network and wildcard set_fact: net_mask: "{{ '{{network}}/{{wildcard}}' }}" when: ansible_network_os == 'asa' - name : determine netmask from wildcard set_fact:

[ansible-project] Re: Unable to Ping Ansible Hosts in Inventory from Azure Cloudshell

2018-05-08 Thread f . floimair . commend
By default Azure VMs do not answer pings (Microsoft blocks that). So this is not ansible's fault. Use something else to "ping" your VM instead. Am Montag, 7. Mai 2018 19:36:01 UTC+2 schrieb Carlton Patterson: > > Hello Community, > > I have created a Centos host in Azure and added the hosts to my