Re: [ansible-project] Re: Simple cisco IOS show version

2018-01-22 Thread Claudia de Luna
Using Ansible ios_facts module Here is a simple playbook to gather ios facts. I took the output and pasted it into one of the may JSON lint/editors on line to easily see the structure and then added a debug statement for the key:value pair I wanted. Version in this case. --- - hosts: cisco

Re: [ansible-project] Re: Simple cisco IOS show version

2018-01-22 Thread Claudia de Luna
Hi Surjeet, It might help to understand if you think of your variable "version" as a dictionary of lists of dictionaries. Think of it as a data structure that you need to decompose to understand. If you take the output you get when you run your playbook and paste it into something like https:

[ansible-project] Re: vsphere_guest module doesn't receve datastore value

2018-01-22 Thread Sebastien Desbois
Hello, When deploying from a template, this parameter will no be used. Your VM will be deployed in the same datastore as the template. This deployment is just a clone that will take by default all the parameters CPU / RAM / Disks of the template. For my part, since I like complicated things, aft

[ansible-project] Re: Get all groups from parent group

2018-01-22 Thread starflighter . one
I solved it myself: > - group_by: > key: > "dist_{{ansible_distribution.lower()}}-{{ansible_distribution_major_version}}" > > - name: Hostname der Server pro Distribution > debug: var="groups['{{ item }}']" > with_items: "{{ groups.keys()|select('match', 'dist_.*')|list }}" >

Re: [ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-22 Thread Mike Klebolt
Thanks Matt. I was able to get everything functioning using the `block` method. Do you know if this will be revisited in a future release because I grew to like the include functionality prior to ebf971f? > -- You received this message because you are subscribed to the Google Groups "Ansib

[ansible-project] Re: nxos_acl module

2018-01-22 Thread Claudia de Luna
HI Julien, I confess I've not used this module for ACL management for many of the reasons you note. Also, the idempotency works at the ACL level but the module at the ACE level and that always worried me. I can see myself checking for one ACE and basically turning my ACL into a one line ACL.

[ansible-project] Dynamic GlusterFS Configuration (Looping)

2018-01-22 Thread Shaun Dolan
All, I'm trying to loop over play_hosts to build out my cluster in a glusterfs configuration ansible/ruby block. I'm not sure of the best way to do this, but would like any feedback you can provide. I didn't believe with_items would work in this situation, because I'm trying to inject x number

[ansible-project] Re: Dynamic GlusterFS Configuration (Looping)

2018-01-22 Thread Shaun Dolan
More simply put, I'm trying to iterate over the "cluster:" key values and not the "gluster_volume". On Monday, January 22, 2018 at 9:35:25 AM UTC-6, Shaun Dolan wrote: > > All, > > I'm trying to loop over play_hosts to build out my cluster in a glusterfs > configuration ansible/ruby block. I'm

Re: [ansible-project] Dynamic GlusterFS Configuration (Looping)

2018-01-22 Thread Kai Stian Olstad
On Monday, 22 January 2018 16.35.25 CET Shaun Dolan wrote: > Here is what I've tried (am I headed down the right path?): > - name: create gluster volume > gluster_volume: > state: present > name: gluster0 > bricks: /bricks/brick1/g1 > rebalance: yes > replicas: yes > clust

[ansible-project] How to do math in Ansible?

2018-01-22 Thread ZillaYT
I have an Ansible task that aims to upgrade our Gitlab application. I want the user to ONLY be able to upgrade 1 major release. For example, I want to enable a 8.x to 9.x upgrade, but not an 8.x to 10.x upgrade. I'm aware of the version_compare module, which I use, but need more than what it doe

Re: [ansible-project] Dynamic GlusterFS Configuration (Looping)

2018-01-22 Thread Shaun Dolan
Thank you Kai. Someone around the office just provided me the filter to_json... that was the missing link. Appreciate your prompt response. On Monday, January 22, 2018 at 10:18:50 AM UTC-6, Kai Stian Olstad wrote: > > On Monday, 22 January 2018 16.35.25 CET Shaun Dolan wrote: > > Here is what

Re: [ansible-project] How to do math in Ansible?

2018-01-22 Thread Matt Martz
Probably something like: - name: Ensure M_upgrade - M_installed = 1 assert: that: - M_upgrade|int - M_installed|int == 1 On Mon, Jan 22, 2018 at 11:18 AM, ZillaYT wrote: > I have an Ansible task that aims to upgrade our Gitlab application. I want > the user to ONLY be able to upgrad

Re: [ansible-project] Dynamic GlusterFS Configuration (Looping)

2018-01-22 Thread Shaun Dolan
I don't believe IP was required, my gluster volume is working with dns name entries from play_hosts. "{{ play_hosts | to_json }}" On Monday, January 22, 2018 at 11:30:29 AM UTC-6, Shaun Dolan wrote: > > Thank you Kai. Someone around the office just provided me the filter > to_json... that was t

Re: [ansible-project] How to do math in Ansible?

2018-01-22 Thread Kai Stian Olstad
On Monday, 22 January 2018 18.18.34 CET ZillaYT wrote: > I have an Ansible task that aims to upgrade our Gitlab application. I want > the user to ONLY be able to upgrade 1 major release. For example, I want to > enable a 8.x to 9.x upgrade, but not an 8.x to 10.x upgrade. I'm aware of > the vers

Re: [ansible-project] How to do math in Ansible?

2018-01-22 Thread ZillaYT
I'm using yum (RHEL). However with this approach, don't you have to update the file when the major version changes? On Monday, January 22, 2018 at 12:33:07 PM UTC-5, Kai Stian Olstad wrote: > > On Monday, 22 January 2018 18.18.34 CET ZillaYT wrote: > > I have an Ansible task that aims to upgrade

Re: [ansible-project] How to do math in Ansible?

2018-01-22 Thread ZillaYT
Thanks, I'l try this On Monday, January 22, 2018 at 12:31:12 PM UTC-5, Matt Martz wrote: > > Probably something like: > > - name: Ensure M_upgrade - M_installed = 1 > assert: > that: > - M_upgrade|int - M_installed|int == 1 > > On Mon, Jan 22, 2018 at 11:18 AM, ZillaYT > > wrote: > >

[ansible-project] How to make ansible read a json file on remote host?

2018-01-22 Thread ZillaYT
I following the technique suggested in how to read json file using ansible suggestion in Stackoverflow, and I do this - set_fact: version_file: "{{ lookup('file','/opt/gitlab/version-manifest.json') | from_j

Re: [ansible-project] How to make ansible read a json file on remote host?

2018-01-22 Thread Matt Martz
lookups only execute on the local ansible controller. You will need to use something such as the slurp module to fetch the contents of the file. - slurp: path: /opt/gitlab/version-manifest.json register: version_file - set_fact: installed_version: "{{ (version_file.content|b64decode|fr

[ansible-project] Service Not Stopping

2018-01-22 Thread Heather Luna
Hello! It appears that Ansible is seeing the splunkd service as stopped although when I check the status on my test box, it's running. I use the same play earlier in the playbook to stop the service and it successfully changes. I'm stuck as to why it's seeing it as stopped when it's not.

[ansible-project] Service Not Stopping

2018-01-22 Thread Heather Luna
Hello! It appears that Ansible is seeing the splunkd service as stopped although when I check the status on my test box, it's running. I use the same play earlier in the playbook to stop the service and it successfully changes. I'm stuck as to why it's seeing it as stopped when it's not.

Re: [ansible-project] How to make ansible read a json file on remote host?

2018-01-22 Thread ZillaYT
I didn't know that about lookups. The code you provided worked! Thanks! On Monday, January 22, 2018 at 3:21:45 PM UTC-5, Matt Martz wrote: > > lookups only execute on the local ansible controller. > > You will need to use something such as the slurp module to fetch the > contents of the file. > >

[ansible-project] Re: Service Not Stopping

2018-01-22 Thread Heather Luna
UPDATE: A more direct approach of - name: Stopping Splunkd Service in Preperation for Splunk Directory Removal win_command: splunk stop args: chdir: 'C:\Program Files\SplunkUniversalForwarder\bin' Yields the results I'd expect. Still confused as to why the win_service module wa

[ansible-project] Change ROOT password on MAC OSX

2018-01-22 Thread Nirav Doshi
I am trying to change the 'root' user password on a mac osx system. I am not sure if the users module can handle changing the password for the root user. Could someone please shed some light on the topic. Thank you. -- You received this message because you are subscribed to the Google Groups

[ansible-project] What should be the proper way to use include_tasks in ansible 2.5

2018-01-22 Thread chipcha
Hi all, Following the discussion in issue #35065: included include_role fails to escalate since ebf971f (see also https://groups.google.com/forum/#%21searchin/ansible-project/chipcha%7Csort:date/ansible-project/2-A3BVF02X4/USl6hixDDQAJ) My issue is related to include_tasks. I understood that fo

Re: [ansible-project] What should be the proper way to use include_tasks in ansible 2.5

2018-01-22 Thread Matt Martz
I've recently started work on this specific topic for the 2.5 porting guide which you can find at https://github.com/ansible/ansible/pull/35199 On Mon, Jan 22, 2018 at 4:32 PM, chipcha wrote: > Hi all, > > Following the discussion in issue #35065: included include_role fails to > escalate since

[ansible-project] Questions regarding "when: condition"

2018-01-22 Thread John Harmon
The commented section of the following code works. I was trying to simplify it by adding with_items; however, it seems to change the way it is evaluated?... at least that is my guess based on the verbosity: skipping: [ansible-oel6] => (item=ansible) => { "changed": false, "item": "ansib

Re: [ansible-project] Questions regarding "when: condition"

2018-01-22 Thread Matt Martz
Using `with_items` like you are, you would need to use `search(item)` without the quotes around item. Otherwise "item" is treated as the string item, instead of the variable called item. On Mon, Jan 22, 2018 at 4:55 PM, John Harmon wrote: > The commented section of the following code works. I

Re: [ansible-project] Questions regarding "when: condition"

2018-01-22 Thread John Harmon
That is good to know, but I made the change and still experience the issue; however, with that info I changed it to the following which works for the first section: when: item in ansible_hostname On Monday, January 22, 2018 at 3:58:53 PM UTC-7, Matt Martz wrote: > > Using `with_items` like yo

[ansible-project] Re: Service Not Stopping

2018-01-22 Thread Jordan Borean
That sounds weird, sounds like the service was stopped but was eventually restarted once win_service was finished. Maybe there is another service that ensures it stays running and using splunk.exe to stop the service stops them all. You can test it out by running Stop-Service -Name Splunkd lo

[ansible-project] Ansible FortiOS config backup to target node error

2018-01-22 Thread James Liew
Hi all, I am having issues with backing up a Forti64VM(Fortigate VM appliance) running FortiOS 5.6.2 in my environment via Ansible Tower. The errors below:

[ansible-project] Any tips on working with SQL Express on Windows

2018-01-22 Thread Justin Seiser
I'm looking to start a project working against an Amazon image with SQL Express preinstalled. I know that it comes with windows auth. I know I can also configure the authentication mode to use a SA account. My real issue is that this will have to be done with powershell, and I can't not find a p

Re: [ansible-project] Re: Simple cisco IOS show version

2018-01-22 Thread Surjeet Singh
Hi Claudia de Luna, thank you for your response. *following your **instruction i tried to collect the host name using **regular **expression used by peter and i can collect ios version.* *another question is triggered here after looking on your playbook**:-* register: facts_output - debug

[ansible-project] Re: How to force win_unzip to overwrite a existing file?

2018-01-22 Thread 'J Hawkesworth' via Ansible Project
If it makes sense for what you are doing, you can allways make sure that the zip is removed by running a win file state: absent first, like this. - name: ensure old zip is removed win_file: state: absent path: C:\path\to\zipfile.zip On Thursday, January 18, 2018 at 11:49:44 PM UTC, J