Re: [ansible-project] Ansible template not substituting if any variable not defined

2017-03-20 Thread John Gateley
Thank you Brian and Arthur. I already had the error_on_undefined_vars set to False. Based on Brian's comment I am going to switch to not having undefined variables - tlooks like my original approach is a code-smell. However, I still believe there is a bug here, probably introduced in a recent

Re: [ansible-project] Help generating device report in Ansible

2017-03-20 Thread asilver
That was it Kia.. Thank you. I should have looked at your response more closely. I missed that you had "data" as a child of hostvars. So is that true in all cases any time you define a register variable? That variable will be a child within hostvars? Thank you again. {{

Re: [ansible-project] Help generating device report in Ansible

2017-03-20 Thread Kai Stian Olstad
On 20. mars 2017 21:17, asil...@net-sense.com wrote: On Monday, March 20, 2017 at 3:51:37 PM UTC-4, Kai Stian Olstad wrote: On 20. mars 2017 20:10, asi...@net-sense.com wrote: Hello, I'm fairly new to Ansible and trying to do something very simple. I want to collect a piece of information

Re: [ansible-project] Help generating device report in Ansible

2017-03-20 Thread asilver
hostvars[i] works because that is predefined variable in ansible. However "data" is not. I tried data[i].facts.serialnumber but I get an error back thats says data is undefined. Thx On Monday, March 20, 2017 at 3:51:37 PM UTC-4, Kai Stian Olstad wrote: > > On 20. mars 2017 20:10,

[ansible-project] Failed to copy directory to host

2017-03-20 Thread Jian Gao
I am new to Ansible. I installed Anasible 2.2.1.0 and start to learn playbook. Anyway now I am having a issue to copy a directory to the target host. I tried "copy" and "synchronize" without success. Here is the playbook: --- - hosts: testvbox become: true tasks: - name: Copy Paraview

[ansible-project] Re: Aliases for hosts

2017-03-20 Thread Arthur Reyes
Listing aliases for servers in your inventory file can cause a race condition in some plays when executed multiple times per host. Avoid this. On Monday, March 20, 2017 at 12:38:19 PM UTC-5, Gabriel Forster wrote: > > I have certain servers that are called various things by different > members

[ansible-project] Help generating device report in Ansible

2017-03-20 Thread asilver
Hello, I'm fairly new to Ansible and trying to do something very simple. I want to collect a piece of information (version number) from a number a network devices and generate a simple report. - name: Get Data from devices gather_facts: False hosts: all connection: local roles:

[ansible-project] Re: Windows installer fails via Ansible

2017-03-20 Thread Justin Dugan
Thanks Jon! Hopefully this proves that delegation is properly set up. SWServer = The server where the application installer is executed DBServer = The SQL Sever [jdugan@centos7 ansible]$ ansible -m raw -a 'New-Item -path "\\DBServer\test\test" -type file -force' CDG --limit=SWServer SWServer |

[ansible-project] Aliases for hosts

2017-03-20 Thread Gabriel Forster
I have certain servers that are called various things by different members of my team. Some say "myserver1" others reference the same server by a DNS alias "orangeserver" and others reference by another alias "specialwebserver." Let's imagine that the above isn't going to change (at least not

Re: [ansible-project] Ansible : query an output array

2017-03-20 Thread Z-obaze
Thanks a lot, it was just what I needed. Le vendredi 17 mars 2017 17:51:25 UTC+1, Kai Stian Olstad a écrit : > > On 17. mars 2017 11:27, Z-obaze wrote: > > And with that output, i'd like to display the value of "yumstate" entry > for > > all of the items, here we have two items, but we could

[ansible-project] Re: Ansible template not substituting if any variable not defined

2017-03-20 Thread Arthur Reyes
Use defaults, to handle undefined variables without ignoring errors: ServerAlias: {{ foo | default('bar') }} On Saturday, March 18, 2017 at 12:50:02 PM UTC-5, John Gateley wrote: > > HI y'all, > > I switched to a new computer, so this is a clean installation of ansible > etc. > One of my

Re: [ansible-project] Ansible template not substituting if any variable not defined

2017-03-20 Thread Brian Coca
you can set: error_on_undefined_vars = False in ansible.cfg, but this will also skip any errors in templating in plays. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

[ansible-project] Re: IIS Application Pool - Specific Identity

2017-03-20 Thread 'J Hawkesworth' via Ansible Project
Yes, but its two steps at the moment and the second step isn't idempotent. Try something like this: # create the app pool first - name: Update/Create DefaultAppPool win_iis_webapppool: name: 'DefaultAppPool' state: started attributes:

[ansible-project] Re: Ansible Vault API (decrypt programmatically)

2017-03-20 Thread Syed Saad Ahmed ! Ahmed
Sit Tom Paine, Hope you are fine ! Will you please help me, i want examples of using python code for rekeying mechanism for an existing vault file ? Your help will be highly appreciated. Thanks On Saturday, September 12, 2015 at 6:34:20 AM UTC+5, Tom Paine wrote: > > Are there any examples of

[ansible-project] Concatenate strings using with_items and assign to a variable in Ansible

2017-03-20 Thread charan . sevakula
I need to save two 2 IPs to a variable in a vars_file when launching ec2_instances, which are used later during deployment. This is how I am saving a single server ip: - name: Save server public IP to vars file lineinfile: line="server_public_ip{{':'}} {{ item.public_ip }}"

[ansible-project] Re: Ansible Vault API (decrypt programmatically)

2017-03-20 Thread Syed Saad Ahmed ! Ahmed
Are there any examples of using the Ansible Python API for rekeying an existing vault file? On Saturday, September 12, 2015 at 6:34:20 AM UTC+5, Tom Paine wrote: > > Are there any examples of using the Ansible Python API to decrypt an > existing vault file? > -- You received this message

[ansible-project] Re: Ansible for Windows: strange behavior

2017-03-20 Thread Michele Viviani
Hi Matt, thanks for the suggestion. I've added ansible_winrm_operation_timeout_sec: 100 and ansible_winrm_read_timeout_sec: 120 to my settings and now it works!! Mike On Friday, March 17, 2017 at 11:17:19 AM UTC+1, Michele Viviani wrote: > > Hi, > I do have some problems using Ansible with

[ansible-project] block/rescue is not rescuing ?

2017-03-20 Thread Mike C
Hi all, im having trouble with the block/rescue functionality. Here is my code: ``` - block: - name: wget consul from artifactory get_url: url: '{{ consul_url }}' checksum: 'sha256:{{ consul_sha256 }}' dest: '{{ consul_home }}' timeout:

Re: [ansible-project] Basic Ansible Ping Module Question

2017-03-20 Thread Dick Davies
Ansibles ping: task checks the host is 'manageable' - that login works, python is recent enough and can generate json. If the host is unreachable that sounds unlikely. Can you SSH to it? On 18 March 2017 at 20:08, jerewrig12345 wrote: > I'm just learning the Ansible basics