Re: [ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread jn . bedag
I don't fully agree with you. Because I set "applicationname" to "{{ APPLICATIONNAME }}" when I call the role in the playbook: - include_role: name: role1 vars: applicationname: "{{ APPLICATIONNAME }}" description: "{{ DESCRIPTION }}" Problem is, that "{{ APPLICATIONNAME }}" a

[ansible-project] Re: win_scheduled_task : run the scheduled task every minute

2018-02-14 Thread Jordan Borean
In the latest release it isn't possible to do with the current win_scheduled_task module. For 2.5 the module was drastically rewritten and supports this scenario, you can find the latest docs for it here http://docs.ansible.com/ansible/devel/modules/win_scheduled_task_module.html. Using your ex

Re: [ansible-project] Jinja2 Template and Dictionary issue

2018-02-14 Thread Kai Stian Olstad
On 14.02.2018 21:54, Owen Corcoran wrote: Could i have instead of : Servers_1.1 Servers_1.2 Servers_2.1 Servers_2.2 Servers_3.1 Servers_3.2 Call each list servers The easiest to do is make haproxy_backend_servers a list of dictionaries and not a list of dictionary. So if you can change

Re: [ansible-project] Run pre/post tasks once with serial 1

2018-02-14 Thread Kai Stian Olstad
On 15.02.2018 00:08, Michael Perzel wrote: My real use case is a patching playbook. I have a collection of servers I want to patch one at a time (serial: 1) but there are a set of decommision steps I only want to run once for the entire group. Then patch the servers one by one. Then there is a

Re: [ansible-project] BUG? 'AnsibleSequence' object has no attribute 'strip'

2018-02-14 Thread Brian Coca
Actually, you should write it like this: - import_playbook: /playbooks/one-offs/bash_history.yml vars: host: "{{ host }}" - import_playbook: /playbooks/one-offs/dmesg_timestamps.yml vars: host: "{{ host }}" -- -- Brian Coca -- You received this message because you are su

Re: [ansible-project] Run pre/post tasks once with serial 1

2018-02-14 Thread Michael Perzel
My real use case is a patching playbook. I have a collection of servers I want to patch one at a time (serial: 1) but there are a set of decommision steps I only want to run once for the entire group. Then patch the servers one by one. Then there is a set of commission tasks I want to run once f

[ansible-project] Roles are download to a different directory when running ansible-galaxy install?

2018-02-14 Thread ZillaYT
Ansible v2.4.0.0 I have a requirements file that specifies the Git repo for each role that I want to use in my playbook, and I do the following to install the roles from our internal galaxy cd /path_to_playbook ansible-galaxy install -r requirements/requirements1.yml -p ./roles and I expect t

Re: [ansible-project] Run pre/post tasks once with serial 1

2018-02-14 Thread Brian Coca
you want run_once, not serial -- -- 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...@googlegroups.com. To p

[ansible-project] win_scheduled_task : run the scheduled task every minute

2018-02-14 Thread ktesr123456
Team, Is there any option to run the scheduled task every minute. in the documentation i see the frequency is either once or daily or weekly I am referring to "Advance Settings" from Trigger of Windows Scheduled task Thanks. -- You received this message because you are subscribed to the Googl

[ansible-project] Run pre/post tasks once with serial 1

2018-02-14 Thread Michael Perzel
I have a playbook where I would like to do a task once before starting a couple roles and once after roles with serial 1. I thought I could accomplish this with pre and post tasks but it looks like they are called once per server. --- - name: Pre Post Task Test hosts: "linux" gather_facts:

Re: [ansible-project] Jinja2 Template and Dictionary issue

2018-02-14 Thread Owen Corcoran
Could i have instead of : Servers_1.1 Servers_1.2 Servers_2.1 Servers_2.2 Servers_3.1 Servers_3.2 Call each list servers The reason being i dont want to have to hard code names in the jinja2 template of the elements in the lists of backends, depending on the size of the dictionary i might shin

Re: [ansible-project] BUG or Operating As Designed?

2018-02-14 Thread Brian Coca
a way to do this is having a block on whole role and a rescue that checks for the error, which allows you to make a 'skip rest' kind facility. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from t

Re: [ansible-project] BUG or Operating As Designed?

2018-02-14 Thread Matt Martz
A play encompasses `pre_tasks`, `roles`, `tasks`, and `post_tasks`. You are expecting it to end the role. Perhaps you should instead move all subsequent tasks of that role into a block or another file and use include_tasks, and then apply the `when` statement to that (but reverse the logic). On

[ansible-project] BUG or Operating As Designed?

2018-02-14 Thread John Harmon
I have the following playbook: --- - hosts: "{{ host }}" roles: - ansible_dependencies - aliases - dns_update - cpu_utilization - role: nagios install: yes - password_policy - role: disable_NetworkManager new_install: yes - ldap_users - ps1_customi

[ansible-project] Re: Trouble with win_package

2018-02-14 Thread Jordan Borean
There are a few issues you will come across; * You figured out that the path shouldn't have the end single quote, unless you are start the path with a single quote. No need to escape the backslashes unless you enclose it in double quotes * While you specify the path as .msu, win_package doesn't

Re: [ansible-project] Jinja2 Template and Dictionary issue

2018-02-14 Thread Kai Stian Olstad
On Wednesday, 14 February 2018 17.07.00 CET Owen Corcoran wrote: > keepalived_virtual_ip: > - vip_details_1: > haproxy_vip_name: "AddressCleaner_Development" > ip: "1.0.1.2" > front_end_port: 80 > haproxy_backend_servers: >- servers_1.1: > hostname: system12 >

Re: [ansible-project] Are there issue with mass deployment related to SSH?

2018-02-14 Thread Andrew Latham
I suggest you start with reading about http://docs.ansible.com/ansible/latest/intro_configuration.html#forks On Wed, Feb 14, 2018 at 10:23 AM, cmonty14 <74cmo...@gmail.com> wrote: > Hello! > > I have a question that derives from the comparison Ansible vs. Salt. > > As Ansible relies on SSH connec

[ansible-project] Re: Trouble with win_package

2018-02-14 Thread Dimitri Yioulos
path should read: path: C:\temp\windows6.1-kb3140245-x64_5b067ffb69a94a6e5f9da89ce88c65 8e52a0dec0.msu On Wednesday, February 14, 2018 at 1:16:43 PM UTC-5, Dimitri Yioulos wrote: > > All, > > I'm running version 2.3 (can't update to 2.4 just yet) and, despite what > should be super stupid simple

[ansible-project] Trouble with win_package

2018-02-14 Thread Dimitri Yioulos
All, I'm running version 2.3 (can't update to 2.4 just yet) and, despite what should be super stupid simple, I've never been able to get win_package to work. I've changed up my win_package play in every conceivable way, but no joy. Here's my basic set-up, which is taken directly from the doc:

Re: [ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread Kai Stian Olstad
On Wednesday, 14 February 2018 15.57.02 CET jn.be...@gmail.com wrote: > Hi Kai > > You used the variable in a playbook, maybe that works. But I want to make > sure that the role is not being executed when someone forgets to set the > variable. > So the trick here is: "{{ APPLICATIONNAME }}" is n

Re: [ansible-project] Extracting a substring with regex_replace fails

2018-02-14 Thread Kai Stian Olstad
On Wednesday, 14 February 2018 16.36.33 CET 'Felix Fontein' via Ansible Project wrote: > > The task seems obvious at first glance but it appears to be difficult > > to implement in this context. > > The string is: > > host_meta: " > xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>\n > rel='rest

[ansible-project] junos error

2018-02-14 Thread 'Daley Okuwa' via Ansible Project
Hello I am trying to backup config on a juniper router without success and getting an error message ansible@ansible-new:/etc/ansible$ ansible-playbook -i hosts backup_config-junos-facts.yml --user=ansible --extra-vars "ansible_sudo_pass=" PLAY [collect default set of facts] **

[ansible-project] Re: Ansible 2.5.0 Alpha 1 is available

2018-02-14 Thread mattdavi
Sorry about that- some docs reorgs in devel moved that right after we sent the release announcement, and the redirects aren't in place yet. New location is https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.5.html . -Matt On Wednesday, February 14, 2018 at 5:59:20 AM UTC-8,

[ansible-project] Re: Ansible and PowerShell 6 (Core)

2018-02-14 Thread mattdavi
We've done some experimentation with it, and it's possible, but it required "if pwsh do X, else do Y" in several of the core connection methods (around hash calculation, etc), as some .NET things have moved around since .NET 4.0 on the oldest platforms we support. Just out of curiosity: why is

[ansible-project] Re: Ansible and PowerShell 6 (Core)

2018-02-14 Thread Balaram R
https://www.virtualtothecore.com/en/configuring-windows-machines-for-ansible/ On Wednesday, February 14, 2018 at 10:19:59 PM UTC+5:30, lovi wrote: > > Hello, > > > I would like to know if it's possible to get ansible working with > powershell version 6 core : pwsh.exe on remote host with winrm ?

[ansible-project] Ansible and PowerShell 6 (Core)

2018-02-14 Thread lovi
Hello, I would like to know if it's possible to get ansible working with powershell version 6 core : pwsh.exe on remote host with winrm ? And if not is there a planning for this feature ? Regards, -- You received this message because you are subscribed to the Google Groups "Ansible Proj

[ansible-project] ansible with jenkins pipeline

2018-02-14 Thread Sidh
Hi, Anyone using ansible with jenkins pipeline ? Can you please point me to some documentation with examples ? Regards, Sidh -- 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,

[ansible-project] Are there issue with mass deployment related to SSH?

2018-02-14 Thread cmonty14
Hello! I have a question that derives from the comparison Ansible vs. Salt. As Ansible relies on SSH connection some people say that this has a downside for a scenario like - mass deployment of 1000 servers Can you confirm that there's a severe performance impact when Ansible master must

[ansible-project] Jinja2 Template and Dictionary issue

2018-02-14 Thread Owen Corcoran
Can anyone help me with the below, maybe my approach is wrong. What I’m trying to do is to create from a template a keepalived file based on the elements in a dictionary. I’ve included the code below, when its ran the error that appears is msg": "AnsibleUndefinedVaria

Re: [ansible-project] Extracting a substring with regex_replace fails

2018-02-14 Thread 'Felix Fontein' via Ansible Project
Hi, instead of using regexes, you might want to use the XML module (https://docs.ansible.com/ansible/2.4/xml_module.html) with the xmlstring argument. That should allow you to do this in a much cleaner way. Cheers, Felix > ansible 2.6.0 (devel da5cf72236) last updated 2018/02/14 14:29:49 > (GM

Re: [ansible-project] Extracting a substring with regex_replace fails

2018-02-14 Thread 'Felix Fontein' via Ansible Project
Hi, > The task seems obvious at first glance but it appears to be difficult > to implement in this context. > The string is: > host_meta: " xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>\n rel='restconf' href='/restconf'/>\n" > > I need to extract the values of rel and href into api_release

[ansible-project] Re: Extracting a substring with regex_replace fails

2018-02-14 Thread jean-christophe manciot
> > > I have the same difficulty with: ansible 2.4.3.0 (detached HEAD 8a7f9beab7) last updated 2018/02/14 16:11:16 (GMT +200) -- 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 i

[ansible-project] Extracting a substring with regex_replace fails

2018-02-14 Thread jean-christophe manciot
ansible 2.6.0 (devel da5cf72236) last updated 2018/02/14 14:29:49 (GMT +200) The task seems obvious at first glance but it appears to be difficult to implement in this context. The string is: host_meta: "\n \n" I need to extract the values of rel and href into api_release and api_root. I uns

Re: [ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread jn . bedag
Hi Kai You used the variable in a playbook, maybe that works. But I want to make sure that the role is not being executed when someone forgets to set the variable. So the trick here is: "{{ APPLICATIONNAME }}" is not set. Normaly this is a variable in vars/app1.yml Here is the full code: /vars

Re: [ansible-project] Re: Upgrade from 1.9 to 2.4 throws "recursive loop detected" error

2018-02-14 Thread K. Seshadri Iyer
Thanks. I renamed the variable. -- 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 emai

[ansible-project] Re: Looping over nested inventory items with conditional

2018-02-14 Thread Jason Gilfoil
Thanks! that got me what I needed. I made this slight modification to the item piece and i'm good to go! msg: "{{ hostvars[item].ansible_host }}" On Tuesday, February 13, 2018 at 5:30:55 PM UTC-5, flowerysong wrote: > > On Tuesday, February 13, 2018 at 4:02:57 PM UTC-5, Jason Gilfoil wrote: >> >

[ansible-project] Re: Ansible 2.5.0 Alpha 1 is available

2018-02-14 Thread Stas Fomin
https://docs.ansible.com/ansible/devel/porting_guide_2.5.html — 404 -- You received this message because you are subscribed to the Goog

[ansible-project] Re: ansible-pull query

2018-02-14 Thread Balz . aschwanden
Hi This could be solved by using a dynamic inventory script. http://docs.ansible.com/ansible/latest/intro_dynamic_inventory.html This is an executable file which has to print out json. You could use such a script do redirect your clients to the desired directory. Am Samstag, 3. Februar 2018 17

[ansible-project] Re: Ansible vmware_guest creates vmware vm, but hostname does not changes. Also creates a additional junk folder

2018-02-14 Thread Ajay Sharma
Hi Everyone, I would like to close this issue, as it is resolved. On Thursday, February 8, 2018 at 4:09:30 PM UTC+5:30, Ajay Sharma wrote: > > > > HI Everyone.

Re: [ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread Kai Stian Olstad
On 14.02.2018 13:01, jn.be...@gmail.com wrote: I was too fast with my answer. /roles/defaults/main.yml --- applicationname: "" description: "" required_vars: - applicationname But this doesn't work: - name: check required vars undefined fail: msg="Variable '{{ item }}' is null" when:

Re: [ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread jn . bedag
I was too fast with my answer. /roles/defaults/main.yml --- applicationname: "" description: "" required_vars: - applicationname This workes: - name: check required vars empty fail: msg="Variable '{{ item }}' is empty" when: vars[item] == "" with_items: "{{ required_vars }}" This to

Re: [ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread jn . bedag
Perfect, works like a charm, thank you so much! -- 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

Re: [ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread Kai Stian Olstad
On 14.02.2018 11:03, jn.be...@gmail.com wrote: Another approach: - name: check required vars fail: msg="Variable '{{ item }}' is not defined" when: item not in vars with_items: "{{required_vars}}" Workes, but you cannot check the value of the variable, just if it is not undefined. Thi

[ansible-project] Re: Upgrade from 1.9 to 2.4 throws "recursive loop detected" error

2018-02-14 Thread jn . bedag
Not sure, but maybe you run into this problem: https://github.com/ansible/ansible/issues/8603 Use a different variable, or what we do: group_vars are in capital letter. Vars within playbooks or roles are in lowercases. -- You received this message because you are subscribed to the Google Group

[ansible-project] Checking for undefined, empty or null variables

2018-02-14 Thread jn . bedag
This is my example playbook: --- - name: play1 hosts: app1 vars_files: - "vars/app1.yml" tasks: - include_role: name: role1 vars: applicationname: "{{ APPLICATIONNAME }}" description: "{{ DESCRIPTION }}" Now in the role, I want to make sure applicationname is

[ansible-project] Re: Dynamically set /etc/hosts using ansible_interfaces

2018-02-14 Thread Giovanni Tommasini
Thanks Dayton for you final solution. If I use it, I notice that the privat IP wasn't set correctly; like this: 192.168.1.1 1.2.3.4 hostname hostname.domain.com So I use this solution {% for interface in ansible_interfaces if interface != 'lo' %} {{ hostvars[inventory_hostname]['ansible_' + inter

Re: [ansible-project] letsencrypt module - account_key

2018-02-14 Thread 'Felix Fontein' via Ansible Project
Hi, > I am a little confused by what is needed in the account_key parameter. > > The docs say it is: > > *File containing the Let's Encrypt account RSA key.* > *Can be created with openssl rsa * > I know when I first setup the account it generated keys in > /etc/letsencrypt/accounts/... >

[ansible-project] Re: Dynamic Inventory using Active Directory / LDAP

2018-02-14 Thread Balz . aschwanden
We do exactly that: We run ansible in pull mode with AD as inventory. Maybe you can take a look at the dynamic inventory script we use: https://github.com/ANTS-Framework/ants/blob/master/antslib/inventory/inventory_ad (Because it is used for ansible-pull, it will only return the current host, bu