Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-17 Thread Pavan Nr
Hi Srinivas,

i have not share , can you share the links is possible.

regards,
Pavan

On Friday, April 17, 2020 at 11:15:49 AM UTC+5:30, Srinivas Naram wrote:
>
> Did you try using items ?
>
> On Fri, Apr 17, 2020 at 11:07 AM Pavan Nr > 
> wrote:
>
>> Hi,
>>
>> Need help to create playbook, server need to reboot over night in loop, 
>> like 100 time's I need to reboot and It should stop and collect the event 
>> viewer logs.
>>
>> Do we have module already?
>>
>> Thanks,
>> Pavan
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/9a9f36c2-5df1-4dbe-aaa1-4a47f5a6c766%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/67be4617-fd5a-464b-8a41-40f91d00cdd9%40googlegroups.com.


Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-17 Thread Pavan Nr
Hi Srinivas,

i have not tried , can you share the links if possible.

regards,
Pavan

On Friday, April 17, 2020 at 11:15:49 AM UTC+5:30, Srinivas Naram wrote:
>
> Did you try using items ?
>
> On Fri, Apr 17, 2020 at 11:07 AM Pavan Nr > 
> wrote:
>
>> Hi,
>>
>> Need help to create playbook, server need to reboot over night in loop, 
>> like 100 time's I need to reboot and It should stop and collect the event 
>> viewer logs.
>>
>> Do we have module already?
>>
>> Thanks,
>> Pavan
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/9a9f36c2-5df1-4dbe-aaa1-4a47f5a6c766%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6d74ee75-c791-42bf-bdca-00cf491d7e84%40googlegroups.com.


[ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-17 Thread Kiran Kumar
Hi


I need to check status of VMware tools on vms & if VMware tools are not 
running, then reboot the vm. I have below playbook which works fine to find 
vm name & VMware tools status. Please help on how can i extract the vm name 
& take action as per status.  

Note : i have to use the VMware modules as the OS typically will be in hung 
status ( hence tools not running ) , hence avoid user OS level task ( and 
use VMware task ) 

Thanks 

---
> - hosts: localhost
>   gather_facts: false
>   connection: local
>   collections:
>   - community.vmware
>   - community.general
>   vars_files:
> - ./vars/vmware_vars.yml
>   vars:
> vm_list:
>   - vm1
>   - vm2
>   tasks:
> - name: Gather VM info
>   vmware_guest_info:
> hostname: "{{ vcenter_server }}"
> username: "{{ vcenter_user }}"
> password: "{{ vcenter_pass }}"
> datacenter: "{{ vcenter_datacenter }}"
> validate_certs: no
> name: "{{ item }}"
>   register: vm_info
>   with_items: "{{ vm_list }}"
> - name: Tools status all
>   debug:
> msg: "{{ vm_info.results  | json_query(jmesquery) }}"
>   vars:
> jmesquery: "[?instance.hw_name == '{{ item 
> }}'].instance.guest_tools_status"
>   with_items: "{{ vm_list }}"


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3473c234-0db3-4808-b73d-d9ba8460b5ee%40googlegroups.com.


Re: [ansible-project] yum repolist -v Output to Vars/Dict and use the data

2020-04-17 Thread 'Spoonless' via Ansible Project
Hi again,

Thanks for the tip in the right direction:

I now have this:

  tasks:
- name: Set the required enabled repo information as facts
  shell: "yum repolist -v | grep {{item}} | awk -F\": \" '{print $2}'"
  with_items:
- "Repo-id"
- "Repo-updated"
- "Repo-pkgs"
- "Repo-size"
- "Repo-name"
- "Repo-baseurl"
- "Repo-filename"
  register: output  
- set_fact:
repoid: "{{ output.results.0.stdout }}"
#repoupdated: "{{ output.results.1.stdout }}"
#repopkgs: "{{ output.results.2.stdout }}"
#reposize: "{{ output.results.3.stdout }}"
reponame: "{{ output.results.4.stdout }}"
repobaseurl: "{{ output.results.5.stdout }}"
repofilename: "{{ output.results.6.stdout }}"

- debug:
msg: "{{reponame}} is an illegal url"
  when: repobaseurl is search("ftp://somehostname.*";)
  


==

But..
My debug output is now showing all of the repo's and not filtering.
?

Best regards.


On Thursday, April 16, 2020 at 1:55:37 PM UTC+2, Kai Stian Olstad wrote:
>
> On Thu, Apr 16, 2020 at 03:19:33AM -0700, 'Spoonless' via Ansible Project 
> wrote: 
> > This is what I am trying to do: 
> > 
> > yum repolist -v will give me a list of the enabled repos on a system, 
> for 
> > example: 
> > 
> > Repo-id  : jenkins 
> > Repo-name: Jenkins-stable 
> > Repo-revision: 1585146777 
> > Repo-updated : Wed Mar 25 15:32:57 2020 
> > Repo-pkgs: 102 
> > Repo-size: 6.1 G 
> > Repo-baseurl : http://pkg.jenkins.io/redhat-stable/ 
> > Repo-expire  : 21,600 second(s) (last: Tue Apr 14 08:28:35 2020) 
> >   Filter : read-only:present 
> > Repo-filename: /etc/yum.repos.d/jenkins.repo 
> > 
> > Repo-id  : mongodb-org-4.2/7 
> > Repo-name: MongoDB Repository 
> > Repo-revision: 1585187010 
> > Repo-updated : Thu Mar 26 02:43:32 2020 
> > Repo-pkgs: 25 
> > Repo-size: 543 M 
> > Repo-baseurl : 
> https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/ 
> > Repo-expire  : 21,600 second(s) (last: Tue Apr 14 08:28:36 2020) 
> >   Filter : read-only:present 
> > Repo-filename: /etc/yum.repos.d/mongodb-org-4.2.repo 
> > 
> > I want to: 
> > 1: register, lets say for now, the Repo-id, Repo-name, Repo-baseurl, 
> > Repo-filename to variable/s, or a dictionary, not sure here ?. 
> > 2: Check if the Repo-baseurl of a Repo-id contains a certain url, if it 
> > does, register another variable, illegalurl = 1,  for that Repo 
> > 3: Grab the Repo-filename where the Repo-baseurl illegalurl is 1 
> > 4: Do something with that file: 
> >   a: Generate a mail with that information 
> >   b: Check if a repo file exists in a different location with a correct 
> > Repo-baseurl 
> >   c: Change the Repo-baseurl in the originating .repo file. 
> >   == I guess, if I have the variables, dictionary, facts of the 
> individual 
> > blocks of data, then I can use them to do other tasks that I need. 
> > 
> > I have tried: 
> > 
> > Individual tasks to grab the data and register a variable: 
> > example: 
> > 
> >   tasks: 
> > - name: Collect Repo id  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-id | awk -F\": \" '{print 
> $2}'" 
> >   register: echo_repoids 
> > #   - debug: 
> > #var: echo_repoids.stdout_lines 
> > 
> > - name: Collect Repo Name  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-name | awk -F\": \" '{print 
> $2}'" 
> >   register: echo_reponame 
> > #- debug: 
> > #var: echo_reponame.stdout_lines 
> > 
> > - name: Collect Repo base url  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-baseurl | awk -F\": \" '{print 
> > $2}'" 
> >   register: echo_repobaseurl 
> > #- debug: 
> > #var: echo_repobaseurl.stdout_lines 
> > 
> > - name: Collect Repo filename  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-filename | awk -F\": \" 
> '{print 
> > $2}'" 
> >   register: echo_repofilename 
> > #   - debug: 
> > #   var: echo_repofilename.stdout_lines 
>
> If you use .stdout you get the value, .stdout_lines is a list 
> where 
> the first line is the first element, so you would need to use 
> .stdout_lines.0 
>
> > I also tried: 
> > 
> >   tasks: 
> > - name: Collect the enabled Repo information 
> >   shell: "yum repolist -v | grep {{item}} | awk -F\": \" '{print 
> $2}'" 
> >   with_items: 
> > - "Repo-id" 
> > - "Repo-name" 
> > - "Repo-baseurl" 
> > - "Repo-filename" 
> >   register: output   
> > #  debug: var=output 
>
> Since you run this in a loop, the result is in results. 
>
> Repo-id is output.results.0.stdout 
> Repo-name is output.results.1.stdout 
> and so on 
>
>
> > But I do not know how to match the blocks contents of Repo-id, 
> Repo-name, 
> > Repo-baseurl, Repo-filename as keys and values so I can use them later 
> in 
> > the tasks/ playbook

Re: [ansible-project] Need help on json query call in ansible

2020-04-17 Thread Suresh Karpurapu
Can anyone help me on this request or please suggest if there any
alternative solution for my requirement?

Regards,
Suresh

On Thu, 16 Apr 2020, 4:10 pm Suresh Karpurapu, 
wrote:

> Thanks Racke, it's working for if host has single volume but same is
> failing if the host has multiple volumes. Basically, loop is getting
> failed. Please suggest if there any alternative ways
>
> # cat mounts.csv
> host,remote_path,mnt_path,python
>
> host1,nfsflr01:/volahcstg_www_masup_stg_data_01,/myasup/stg/data,/usr/bin/python2.6
>
> host1,nfsflr02:/volahcstg_www_masup_stg_app_01,/myasup/stg/app,/usr/bin/python2.6
>
> host2,nfsflr01:/volahcstg_www_masup_stg_data_01,/myasup/stg/data,/usr/bin/python2.6
>
> host2,nfsflr02:/volahcstg_www_masup_stg_app_01,/myasup/stg/app,/usr/bin/python2.6
>
>
> Result:
>
> TASK [Grouping host and volume information]
> *
> task path: /suresh/suresh_playbooks/mounts.yml:12
> creating host via 'add_host': hostname=host1
> changed: [localhost] => (item=[u'host1', [{u'python':
> u'/usr/bin/python2.6', u'host': u'host1', u'mnt_path': u'/myasup/stg/data',
> u'remote_path': u'nfsflr01:/volahcstg_www_masup_stg_data_01'}, {u'python':
> u'/usr/bin/python2.6', u'host': u'host1', u'mnt_path': u'/myasup/stg/app',
> u'remote_path': u'nfsflr02:/volahcstg_www_masup_stg_app_01'}]]) => {
> "add_host": {
> "groups": [
> "nfsgroup"
> ],
> "host_name": "host1",
> "host_vars": {
> "ansible_python_interpreter": "/usr/bin/python2.6",
> "var1": [
> "nfsflr01:/volahcstg_www_masup_stg_data_01",
> "nfsflr02:/volahcstg_www_masup_stg_app_01"
> ],
> "var2": [
> "/myasup/stg/data",
> "/myasup/stg/app"
> ]
> }
> },
> "ansible_loop_var": "item",
> "changed": true,
> "item": [
> "host1",
> [
> {
> "host": "host1",
> "mnt_path": "/myasup/stg/data",
> "python": "/usr/bin/python2.6",
> "remote_path": "nfsflr01:/volahcstg_www_masup_stg_data_01"
> },
> {
> "host": "host1",
> "mnt_path": "/myasup/stg/app",
> "python": "/usr/bin/python2.6",
> "remote_path": "nfsflr02:/volahcstg_www_masup_stg_app_01"
> }
> ]
> ]
> }
> creating host via 'add_host': hostname=host2
> changed: [localhost] => (item=[u'host2', [{u'python':
> u'/usr/bin/python2.6', u'host': u'host2', u'mnt_path': u'/myasup/stg/data',
> u'remote_path': u'nfsflr01:/volahcstg_www_masup_stg_data_01'}, {u'python':
> u'/usr/bin/python2.6', u'host': u'host2', u'mnt_path': u'/myasup/stg/app',
> u'remote_path': u'nfsflr02:/volahcstg_www_masup_stg_app_01'}]]) => {
> "add_host": {
> "groups": [
> "nfsgroup"
> ],
> "host_name": "host2",
> "host_vars": {
> "ansible_python_interpreter": "/usr/bin/python2.6",
> "var1": [
> "nfsflr01:/volahcstg_www_masup_stg_data_01",
> "nfsflr02:/volahcstg_www_masup_stg_app_01"
> ],
> "var2": [
> "/myasup/stg/data",
> "/myasup/stg/app"
> ]
> }
> },
> "ansible_loop_var": "item",
> "changed": true,
> "item": [
> "host2",
> [
> {
> "host": "host2",
> "mnt_path": "/myasup/stg/data",
> "python": "/usr/bin/python2.6",
> "remote_path": "nfsflr01:/volahcstg_www_masup_stg_data_01"
> },
> {
> "host": "host2",
> "mnt_path": "/myasup/stg/app",
> "python": "/usr/bin/python2.6",
> "remote_path": "nfsflr02:/volahcstg_www_masup_stg_app_01"
> }
> ]
> ]
> }
> META: ran handlers
> META: ran handlers
>
>
> TASK [debug output]
> *
> task path: /suresh/suresh_playbooks/mounts.yml:25
> ok: [host1] => {
> "msg": [
> "host1",
> [
> "nfsflr01:/volahcstg_www_masup_stg_data_01",
> "nfsflr02:/volahcstg_www_masup_stg_app_01"
> ],
> [
> "/myasup/stg/data",
> "/myasup/stg/app"
> ]
> ]
> }
> ok: [host2] => {
> "msg": [
> "host2",
> [
> "nfsflr01:/volahcstg_www_masup_stg_data_01",
> "nfsflr02:/volahcstg_www_masup_stg_app_01"
> ],
> [
> "/myasup/stg/data",
> "/myasup/stg/app"
> ]
> ]
> }
>
> TASK [mounting the volume in the fstab file]
> 

Re: [ansible-project] yum repolist -v Output to Vars/Dict and use the data

2020-04-17 Thread 'Spoonless' via Ansible Project

Hi,

Thanks for the tip in the right direction:

Here is what I have so far..
But, my Debug output is showing me all of the repo's and not filtering. ?

tasks:
- name: Set the required enabled repo information as facts
  shell: "yum repolist -v | grep {{item}} | awk -F\": \" '{print $2}'"
  with_items:
- "Repo-id"
- "Repo-name"
- "Repo-baseurl"
- "Repo-filename"
  register: output  
- set_fact:
repoid: "{{ output.results.0.stdout }}"
reponame: "{{ output.results.1.stdout }}"
repobaseurl: "{{ output.results.2.stdout }}"
repofilename: "{{ output.results.3.stdout }}"

- debug:
msg: "{{reponame}} is an illegal url"
  when: repobaseurl is search("ftp://somehostname.*";)

===


On Thursday, April 16, 2020 at 1:55:37 PM UTC+2, Kai Stian Olstad wrote:
>
> On Thu, Apr 16, 2020 at 03:19:33AM -0700, 'Spoonless' via Ansible Project 
> wrote: 
> > This is what I am trying to do: 
> > 
> > yum repolist -v will give me a list of the enabled repos on a system, 
> for 
> > example: 
> > 
> > Repo-id  : jenkins 
> > Repo-name: Jenkins-stable 
> > Repo-revision: 1585146777 
> > Repo-updated : Wed Mar 25 15:32:57 2020 
> > Repo-pkgs: 102 
> > Repo-size: 6.1 G 
> > Repo-baseurl : http://pkg.jenkins.io/redhat-stable/ 
> > Repo-expire  : 21,600 second(s) (last: Tue Apr 14 08:28:35 2020) 
> >   Filter : read-only:present 
> > Repo-filename: /etc/yum.repos.d/jenkins.repo 
> > 
> > Repo-id  : mongodb-org-4.2/7 
> > Repo-name: MongoDB Repository 
> > Repo-revision: 1585187010 
> > Repo-updated : Thu Mar 26 02:43:32 2020 
> > Repo-pkgs: 25 
> > Repo-size: 543 M 
> > Repo-baseurl : 
> https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/ 
> > Repo-expire  : 21,600 second(s) (last: Tue Apr 14 08:28:36 2020) 
> >   Filter : read-only:present 
> > Repo-filename: /etc/yum.repos.d/mongodb-org-4.2.repo 
> > 
> > I want to: 
> > 1: register, lets say for now, the Repo-id, Repo-name, Repo-baseurl, 
> > Repo-filename to variable/s, or a dictionary, not sure here ?. 
> > 2: Check if the Repo-baseurl of a Repo-id contains a certain url, if it 
> > does, register another variable, illegalurl = 1,  for that Repo 
> > 3: Grab the Repo-filename where the Repo-baseurl illegalurl is 1 
> > 4: Do something with that file: 
> >   a: Generate a mail with that information 
> >   b: Check if a repo file exists in a different location with a correct 
> > Repo-baseurl 
> >   c: Change the Repo-baseurl in the originating .repo file. 
> >   == I guess, if I have the variables, dictionary, facts of the 
> individual 
> > blocks of data, then I can use them to do other tasks that I need. 
> > 
> > I have tried: 
> > 
> > Individual tasks to grab the data and register a variable: 
> > example: 
> > 
> >   tasks: 
> > - name: Collect Repo id  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-id | awk -F\": \" '{print 
> $2}'" 
> >   register: echo_repoids 
> > #   - debug: 
> > #var: echo_repoids.stdout_lines 
> > 
> > - name: Collect Repo Name  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-name | awk -F\": \" '{print 
> $2}'" 
> >   register: echo_reponame 
> > #- debug: 
> > #var: echo_reponame.stdout_lines 
> > 
> > - name: Collect Repo base url  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-baseurl | awk -F\": \" '{print 
> > $2}'" 
> >   register: echo_repobaseurl 
> > #- debug: 
> > #var: echo_repobaseurl.stdout_lines 
> > 
> > - name: Collect Repo filename  from yum repolist -v 
> >   shell: "yum repolist -v | grep Repo-filename | awk -F\": \" 
> '{print 
> > $2}'" 
> >   register: echo_repofilename 
> > #   - debug: 
> > #   var: echo_repofilename.stdout_lines 
>
> If you use .stdout you get the value, .stdout_lines is a list 
> where 
> the first line is the first element, so you would need to use 
> .stdout_lines.0 
>
> > I also tried: 
> > 
> >   tasks: 
> > - name: Collect the enabled Repo information 
> >   shell: "yum repolist -v | grep {{item}} | awk -F\": \" '{print 
> $2}'" 
> >   with_items: 
> > - "Repo-id" 
> > - "Repo-name" 
> > - "Repo-baseurl" 
> > - "Repo-filename" 
> >   register: output   
> > #  debug: var=output 
>
> Since you run this in a loop, the result is in results. 
>
> Repo-id is output.results.0.stdout 
> Repo-name is output.results.1.stdout 
> and so on 
>
>
> > But I do not know how to match the blocks contents of Repo-id, 
> Repo-name, 
> > Repo-baseurl, Repo-filename as keys and values so I can use them later 
> in 
> > the tasks/ playbooks. 
>
> You could just use the variables as shown above. You could use set_fact to 
> create new variable. Something like this for the last example. 
>
> - set_fact: 
> repoid: "{{ output.results.0.stdout }}" 
> reponame: "{{ output.results.1.st

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-17 Thread Abhijeet Kasurde
---
- hosts: localhost
vars_files:
- vcenter_vars.yml
vars:
vm_list:
- test01
tasks:
- name: Get information about the virtual machine
vmware_guest_info:
validate_certs: False
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
folder: /Asia-Datacenter1/vm/
name: "{{ item }}"
datacenter: Asia-Datacenter1
register: vm_info
with_items: "{{ vm_list }}"

- name: Get Tools status
set_fact:
desired_vms: "{{ vm_info.results | json_query(jmesquery) }}"
vars:
jmesquery: "[?instance.guest_tools_status ==
'guestToolsNotRunning'].instance.hw_name"

- name: Reboot the given VM
vmware_guest_powerstate:
validate_certs: False
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
folder: /Asia-Datacenter1/vm/
name: "{{ item }}"
state: 'reboot-guest'
with_items: "{{ desired_vms }}"



On Fri, Apr 17, 2020 at 1:00 PM Kiran Kumar  wrote:

> Hi
>
>
> I need to check status of VMware tools on vms & if VMware tools are not
> running, then reboot the vm. I have below playbook which works fine to find
> vm name & VMware tools status. Please help on how can i extract the vm name
> & take action as per status.
>
> Note : i have to use the VMware modules as the OS typically will be in
> hung status ( hence tools not running ) , hence avoid user OS level task (
> and use VMware task )
>
> Thanks
>
> ---
>> - hosts: localhost
>>   gather_facts: false
>>   connection: local
>>   collections:
>>   - community.vmware
>>   - community.general
>>   vars_files:
>> - ./vars/vmware_vars.yml
>>   vars:
>> vm_list:
>>   - vm1
>>   - vm2
>>   tasks:
>> - name: Gather VM info
>>   vmware_guest_info:
>> hostname: "{{ vcenter_server }}"
>> username: "{{ vcenter_user }}"
>> password: "{{ vcenter_pass }}"
>> datacenter: "{{ vcenter_datacenter }}"
>> validate_certs: no
>> name: "{{ item }}"
>>   register: vm_info
>>   with_items: "{{ vm_list }}"
>> - name: Tools status all
>>   debug:
>> msg: "{{ vm_info.results  | json_query(jmesquery) }}"
>>   vars:
>> jmesquery: "[?instance.hw_name == '{{ item
>> }}'].instance.guest_tools_status"
>>   with_items: "{{ vm_list }}"
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3473c234-0db3-4808-b73d-d9ba8460b5ee%40googlegroups.com
> 
> .
>


-- 
Thanks,
Abhijeet Kasurde

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFwWkHpCp5uXJQ2i5sAFm4y1GS4H7hWWjk8eibuEfaf-0amZCQ%40mail.gmail.com.


[ansible-project] query on ansible

2020-04-17 Thread mahesh g o
I have below playbook:

i have put a loop, there are 8 aggr and 4 protocols: this playbook output 
is like after every 4 loop, it increments aggr and protocols. 

output of the playbook is:

svm1,svm2,svm3,svm4---aggr1 and nfs
svm5,svm6,svm7,svm8---aggr2 and iscsi
svm9,svm10,svm11,svm12---aggr3 and cifs
svm13,svm14,svm15,svm16---aggr4 and fcp

currently the ansible is failing because after 16th loop it is not finding 
any protocols.

but after 16th loop i want protcols to repeat :

expecting ouput:

svm17,svm18,svm19,svm20---aggr5 and nfs
svm21,svm22,svm23,svm24---aggr6 and iscsi
svm25,svm26,svm27,svm28---aggr7 and cifs
svm29,svm30,svm31,svm32---aggr8 and fcp



- hosts: localhost
  gather_facts: false
  vars_files:
- /etc/ansible/group_vars/host_vars

  vars:
aggr:
  - aggr_1
  - aggr_2
  - aggr_3
  - aggr_4
  - aggr_5
  - aggr_6
  - aggr_7
  - aggr_8
protocols:
  - nfs
  - iscsi
  - cifs
  - fcp
  tasks:
- name: Create SVM
  na_ontap_svm:
state: present
name: "svm{{ item }}"
root_volume: "svm{{ item }}_root_vol"
root_volume_aggregate: "{{ aggr[((item|int-1)//4)] }}"
allowed_protocols: "{{ protocols[(((item)|int-1)//4)] }}"
root_volume_security_style: mixed
hostname: "{{ aiqumip }}"
username: "{{ aiqumusername }}"
password: "{{ aiqumpassword }}"
https: false
  with_sequence: start=1 end=32

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f5197c02-a323-41f0-8e9b-d058a53e67ee%40googlegroups.com.


Re: [ansible-project] query on ansible

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 10:54 AM, mahesh g o wrote:
> I have below playbook:
> 
> i have put a loop, there are 8 aggr and 4 protocols: this playbook output is 
> like after every 4 loop, it increments aggr
> and protocols. 
> 
> output of the playbook is:
> 
> svm1,svm2,svm3,svm4---aggr1 and nfs
> svm5,svm6,svm7,svm8---aggr2 and iscsi
> svm9,svm10,svm11,svm12---aggr3 and cifs
> svm13,svm14,svm15,svm16---aggr4 and fcp
> 
> currently the ansible is failing because after 16th loop it is not finding 
> any protocols.
> 
> but after 16th loop i want protcols to repeat :
> 
> expecting ouput:
> 
> svm17,svm18,svm19,svm20---aggr5 and nfs
> svm21,svm22,svm23,svm24---aggr6 and iscsi
> svm25,svm26,svm27,svm28---aggr7 and cifs
> svm29,svm30,svm31,svm32---aggr8 and fcp
> 
> 
> 
> - hosts: localhost
>   gather_facts: false
>   vars_files:
>     - /etc/ansible/group_vars/host_vars
> 
>   vars:
>     aggr:
>       - aggr_1
>       - aggr_2
>       - aggr_3
>       - aggr_4
>       - aggr_5
>       - aggr_6
>       - aggr_7
>       - aggr_8
>     protocols:
>       - nfs
>       - iscsi
>       - cifs
>       - fcp
>   tasks:
>     - name: Create SVM
>       na_ontap_svm:
>         state: present
>         name: "svm{{ item }}"
>         root_volume: "svm{{ item }}_root_vol"
>         root_volume_aggregate: "{{ aggr[((item|int-1)//4)] }}"
>         allowed_protocols: "{{ protocols[(((item)|int-1)//4)] }}"
>         root_volume_security_style: mixed
>         hostname: "{{ aiqumip }}"
>         username: "{{ aiqumusername }}"
>         password: "{{ aiqumpassword }}"
>         https: false
>       with_sequence: start=1 end=32

There is better way to handle all permutations. Replace with_sequence:

  loop: "{{ aggr | product(protocols) | list }}"
  loop_control:
index_var: "loop_index"

Then adjust your module parameters:

  name: "svm{{ loop_index + 1 }}"
  root_volume: "svm{{ loop_index + 1 }}_root_vol"
  root_volume_aggregate: "{{ item[0] }}"
  allowed_protocols: "{{ item[1] }}"

That should do the trick.

Regards
   Racke

-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b3e2187e-0099-3db4-7375-94a1ba2fb0a5%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-17 Thread Srinivas Naram
https://docs.ansible.com/ansible/latest/plugins/lookup/items.html

On Fri, Apr 17, 2020 at 1:00 PM Pavan Nr  wrote:

> Hi Srinivas,
>
> i have not tried , can you share the links if possible.
>
> regards,
> Pavan
>
> On Friday, April 17, 2020 at 11:15:49 AM UTC+5:30, Srinivas Naram wrote:
>>
>> Did you try using items ?
>>
>> On Fri, Apr 17, 2020 at 11:07 AM Pavan Nr  wrote:
>>
>>> Hi,
>>>
>>> Need help to create playbook, server need to reboot over night in loop,
>>> like 100 time's I need to reboot and It should stop and collect the event
>>> viewer logs.
>>>
>>> Do we have module already?
>>>
>>> Thanks,
>>> Pavan
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/9a9f36c2-5df1-4dbe-aaa1-4a47f5a6c766%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/6d74ee75-c791-42bf-bdca-00cf491d7e84%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG-N3P6AaC-P4A%3DJGNskLyAjNpTSY3K-2aVrNWwbvP4PJW_rFA%40mail.gmail.com.


[ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
Thank u very much ...it worked.

I need one more helpthe aggr is coming from the playbook1. every time i 
run that playbook1 individually and i enter the aggr array in  playbook2.
 so how do i get the output of the  playbook1 in the form of array so that 
i dont have to enter the aggr array in the  playbook2.

playbook2: is the one i shared earlier.


playbook1:
 tasks:
- name: Create Aggregates and wait 5 minutes until aggregate is online
  na_ontap_aggregate:
state: absent
service_state: online
name: "aggr_{{item }}"
disk_count: 5
wait_for_online: True
nodes: "{{ node[((item|int-1)//2)] }}"
time_out: 300
hostname: "{{ aiqumip }}"
username: "{{ aiqumusername }}"
password: "{{ aiqumpassword }}"
validate_certs: false
with_sequence: start=1 end=8


On Friday, 17 April 2020 14:24:51 UTC+5:30, mahesh g o wrote:
>
> I have below playbook:
>
> i have put a loop, there are 8 aggr and 4 protocols: this playbook output 
> is like after every 4 loop, it increments aggr and protocols. 
>
> output of the playbook is:
>
> svm1,svm2,svm3,svm4---aggr1 and nfs
> svm5,svm6,svm7,svm8---aggr2 and iscsi
> svm9,svm10,svm11,svm12---aggr3 and cifs
> svm13,svm14,svm15,svm16---aggr4 and fcp
>
> currently the ansible is failing because after 16th loop it is not finding 
> any protocols.
>
> but after 16th loop i want protcols to repeat :
>
> expecting ouput:
>
> svm17,svm18,svm19,svm20---aggr5 and nfs
> svm21,svm22,svm23,svm24---aggr6 and iscsi
> svm25,svm26,svm27,svm28---aggr7 and cifs
> svm29,svm30,svm31,svm32---aggr8 and fcp
>
>
>
> - hosts: localhost
>   gather_facts: false
>   vars_files:
> - /etc/ansible/group_vars/host_vars
>
>   vars:
> aggr:
>   - aggr_1
>   - aggr_2
>   - aggr_3
>   - aggr_4
>   - aggr_5
>   - aggr_6
>   - aggr_7
>   - aggr_8
> protocols:
>   - nfs
>   - iscsi
>   - cifs
>   - fcp
>   tasks:
> - name: Create SVM
>   na_ontap_svm:
> state: present
> name: "svm{{ item }}"
> root_volume: "svm{{ item }}_root_vol"
> root_volume_aggregate: "{{ aggr[((item|int-1)//4)] }}"
> allowed_protocols: "{{ protocols[(((item)|int-1)//4)] }}"
> root_volume_security_style: mixed
> hostname: "{{ aiqumip }}"
> username: "{{ aiqumusername }}"
> password: "{{ aiqumpassword }}"
> https: false
>   with_sequence: start=1 end=32
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7538e252-68a8-4b49-94c5-19ec6f6c3b59%40googlegroups.com.


Re: [ansible-project] Re: query on ansible

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 12:55 PM, mahesh g o wrote:
> Thank u very much ...it worked.
> 

You are welcome.

> I need one more helpthe aggr is coming from the playbook1. every time i 
> run that playbook1 individually and i enter
> the aggr array in  playbook2.
>  so how do i get the output of the  playbook1 in the form of array so that i 
> dont have to enter the aggr array in the 
> playbook2.
> 
> playbook2: is the one i shared earlier.
> 

First question would be why do you have two separate playbooks?

Regards
Racke

> 
> playbook1:
>  tasks:
>     - name: Create Aggregates and wait 5 minutes until aggregate is online
>       na_ontap_aggregate:
>         state: absent
>         service_state: online
>         name: "aggr_{{item }}"
>         disk_count: 5
>         wait_for_online: True
>         nodes: "{{ node[((item|int-1)//2)] }}"
>         time_out: 300
>         hostname: "{{ aiqumip }}"
>         username: "{{ aiqumusername }}"
>         password: "{{ aiqumpassword }}"
>         validate_certs: false
>         with_sequence: start=1 end=8
> 
> 
> On Friday, 17 April 2020 14:24:51 UTC+5:30, mahesh g o wrote:
> 
> I have below playbook:
> 
> i have put a loop, there are 8 aggr and 4 protocols: this playbook output 
> is like after every 4 loop, it increments
> aggr and protocols. 
> 
> output of the playbook is:
> 
> svm1,svm2,svm3,svm4---aggr1 and nfs
> svm5,svm6,svm7,svm8---aggr2 and iscsi
> svm9,svm10,svm11,svm12---aggr3 and cifs
> svm13,svm14,svm15,svm16---aggr4 and fcp
> 
> currently the ansible is failing because after 16th loop it is not 
> finding any protocols.
> 
> but after 16th loop i want protcols to repeat :
> 
> expecting ouput:
> 
> svm17,svm18,svm19,svm20---aggr5 and nfs
> svm21,svm22,svm23,svm24---aggr6 and iscsi
> svm25,svm26,svm27,svm28---aggr7 and cifs
> svm29,svm30,svm31,svm32---aggr8 and fcp
> 
> 
> 
> - hosts: localhost
>   gather_facts: false
>   vars_files:
>     - /etc/ansible/group_vars/host_vars
> 
>   vars:
>     aggr:
>       - aggr_1
>       - aggr_2
>       - aggr_3
>       - aggr_4
>       - aggr_5
>       - aggr_6
>       - aggr_7
>       - aggr_8
>     protocols:
>       - nfs
>       - iscsi
>       - cifs
>       - fcp
>   tasks:
>     - name: Create SVM
>       na_ontap_svm:
>         state: present
>         name: "svm{{ item }}"
>         root_volume: "svm{{ item }}_root_vol"
>         root_volume_aggregate: "{{ aggr[((item|int-1)//4)] }}"
>         allowed_protocols: "{{ protocols[(((item)|int-1)//4)] }}"
>         root_volume_security_style: mixed
>         hostname: "{{ aiqumip }}"
>         username: "{{ aiqumusername }}"
>         password: "{{ aiqumpassword }}"
>         https: false
>       with_sequence: start=1 end=32
> 
> -- 
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7538e252-68a8-4b49-94c5-19ec6f6c3b59%40googlegroups.com
> .


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a38254da-9ae7-1373-cecd-633577620c6d%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


Re: [ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o

I am newbie to ansiblei have to create many objects like 
this(aggr,svm,volumes,luns,policies,network interfaces) so i have created 
playbook for each objects and thought of stitching it together.

On Friday, 17 April 2020 16:29:18 UTC+5:30, Stefan Hornburg (Racke) wrote:
>
> On 4/17/20 12:55 PM, mahesh g o wrote: 
> > Thank u very much ...it worked. 
> > 
>
> You are welcome. 
>
> > I need one more helpthe aggr is coming from the playbook1. every 
> time i run that playbook1 individually and i enter 
> > the aggr array in  playbook2. 
> >  so how do i get the output of the  playbook1 in the form of array so 
> that i dont have to enter the aggr array in the  
> > playbook2. 
> > 
> > playbook2: is the one i shared earlier. 
> > 
>
> First question would be why do you have two separate playbooks? 
>
> Regards 
> Racke 
>
> > 
> > playbook1: 
> >  tasks: 
> > - name: Create Aggregates and wait 5 minutes until aggregate is 
> online 
> >   na_ontap_aggregate: 
> > state: absent 
> > service_state: online 
> > name: "aggr_{{item }}" 
> > disk_count: 5 
> > wait_for_online: True 
> > nodes: "{{ node[((item|int-1)//2)] }}" 
> > time_out: 300 
> > hostname: "{{ aiqumip }}" 
> > username: "{{ aiqumusername }}" 
> > password: "{{ aiqumpassword }}" 
> > validate_certs: false 
> > with_sequence: start=1 end=8 
> > 
> > 
> > On Friday, 17 April 2020 14:24:51 UTC+5:30, mahesh g o wrote: 
> > 
> > I have below playbook: 
> > 
> > i have put a loop, there are 8 aggr and 4 protocols: this playbook 
> output is like after every 4 loop, it increments 
> > aggr and protocols.  
> > 
> > output of the playbook is: 
> > 
> > svm1,svm2,svm3,svm4---aggr1 and nfs 
> > svm5,svm6,svm7,svm8---aggr2 and iscsi 
> > svm9,svm10,svm11,svm12---aggr3 and cifs 
> > svm13,svm14,svm15,svm16---aggr4 and fcp 
> > 
> > currently the ansible is failing because after 16th loop it is not 
> finding any protocols. 
> > 
> > but after 16th loop i want protcols to repeat : 
> > 
> > expecting ouput: 
> > 
> > svm17,svm18,svm19,svm20---aggr5 and nfs 
> > svm21,svm22,svm23,svm24---aggr6 and iscsi 
> > svm25,svm26,svm27,svm28---aggr7 and cifs 
> > svm29,svm30,svm31,svm32---aggr8 and fcp 
> > 
> > 
> > 
> > - hosts: localhost 
> >   gather_facts: false 
> >   vars_files: 
> > - /etc/ansible/group_vars/host_vars 
> > 
> >   vars: 
> > aggr: 
> >   - aggr_1 
> >   - aggr_2 
> >   - aggr_3 
> >   - aggr_4 
> >   - aggr_5 
> >   - aggr_6 
> >   - aggr_7 
> >   - aggr_8 
> > protocols: 
> >   - nfs 
> >   - iscsi 
> >   - cifs 
> >   - fcp 
> >   tasks: 
> > - name: Create SVM 
> >   na_ontap_svm: 
> > state: present 
> > name: "svm{{ item }}" 
> > root_volume: "svm{{ item }}_root_vol" 
> > root_volume_aggregate: "{{ aggr[((item|int-1)//4)] }}" 
> > allowed_protocols: "{{ protocols[(((item)|int-1)//4)] }}" 
> > root_volume_security_style: mixed 
> > hostname: "{{ aiqumip }}" 
> > username: "{{ aiqumusername }}" 
> > password: "{{ aiqumpassword }}" 
> > https: false 
> >   with_sequence: start=1 end=32 
> > 
> > -- 
> > 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...@googlegroups.com   ansible-project+unsubscr...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/7538e252-68a8-4b49-94c5-19ec6f6c3b59%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/ansible-project/7538e252-68a8-4b49-94c5-19ec6f6c3b59%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
>
>
> -- 
> Ecommerce and Linux consulting + Perl and web application programming. 
> Debian and Sympa administration. Provisioning with Ansible. 
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/089025ef-6868-4e37-8eaa-44d069e72bf1%40googlegroups.com.


Re: [ansible-project] Re: query on ansible

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 1:08 PM, mahesh g o wrote:
> 
> I am newbie to ansiblei have to create many objects like 
> this(aggr,svm,volumes,luns,policies,network interfaces) so
> i have created playbook for each objects and thought of stitching it together.

Yes it is good idea to split up tasks logically, but not a good idea to use 
separate playbooks:

You can group them in task files,.e.g.

   tasks:
 - import_tasks: aggr.yml
 - import_tasks: svm.yml

Regards
 Racke

> 
> On Friday, 17 April 2020 16:29:18 UTC+5:30, Stefan Hornburg (Racke) wrote:
> 
> On 4/17/20 12:55 PM, mahesh g o wrote:
> > Thank u very much ...it worked.
> >
> 
> You are welcome.
> 
> > I need one more helpthe aggr is coming from the playbook1. every 
> time i run that playbook1 individually and i
> enter
> > the aggr array in  playbook2.
> >  so how do i get the output of the  playbook1 in the form of array so 
> that i dont have to enter the aggr array in
> the 
> > playbook2.
> >
> > playbook2: is the one i shared earlier.
> >
> 
> First question would be why do you have two separate playbooks?
> 
> Regards
>         Racke
> 
> >
> > playbook1:
> >  tasks:
> >     - name: Create Aggregates and wait 5 minutes until aggregate is 
> online
> >       na_ontap_aggregate:
> >         state: absent
> >         service_state: online
> >         name: "aggr_{{item }}"
> >         disk_count: 5
> >         wait_for_online: True
> >         nodes: "{{ node[((item|int-1)//2)] }}"
> >         time_out: 300
> >         hostname: "{{ aiqumip }}"
> >         username: "{{ aiqumusername }}"
> >         password: "{{ aiqumpassword }}"
> >         validate_certs: false
> >         with_sequence: start=1 end=8
> >
> >
> > On Friday, 17 April 2020 14:24:51 UTC+5:30, mahesh g o wrote:
> >
> >     I have below playbook:
> >
> >     i have put a loop, there are 8 aggr and 4 protocols: this playbook 
> output is like after every 4 loop, it
> increments
> >     aggr and protocols. 
> >
> >     output of the playbook is:
> >
> >     svm1,svm2,svm3,svm4---aggr1 and nfs
> >     svm5,svm6,svm7,svm8---aggr2 and iscsi
> >     svm9,svm10,svm11,svm12---aggr3 and cifs
> >     svm13,svm14,svm15,svm16---aggr4 and fcp
> >
> >     currently the ansible is failing because after 16th loop it is not 
> finding any protocols.
> >
> >     but after 16th loop i want protcols to repeat :
> >
> >     expecting ouput:
> >
> >     svm17,svm18,svm19,svm20---aggr5 and nfs
> >     svm21,svm22,svm23,svm24---aggr6 and iscsi
> >     svm25,svm26,svm27,svm28---aggr7 and cifs
> >     svm29,svm30,svm31,svm32---aggr8 and fcp
> >
> >
> >
> >     - hosts: localhost
> >       gather_facts: false
> >       vars_files:
> >         - /etc/ansible/group_vars/host_vars
> >
> >       vars:
> >         aggr:
> >           - aggr_1
> >           - aggr_2
> >           - aggr_3
> >           - aggr_4
> >           - aggr_5
> >           - aggr_6
> >           - aggr_7
> >           - aggr_8
> >         protocols:
> >           - nfs
> >           - iscsi
> >           - cifs
> >           - fcp
> >       tasks:
> >         - name: Create SVM
> >           na_ontap_svm:
> >             state: present
> >             name: "svm{{ item }}"
> >             root_volume: "svm{{ item }}_root_vol"
> >             root_volume_aggregate: "{{ aggr[((item|int-1)//4)] }}"
> >             allowed_protocols: "{{ protocols[(((item)|int-1)//4)] }}"
> >             root_volume_security_style: mixed
> >             hostname: "{{ aiqumip }}"
> >             username: "{{ aiqumusername }}"
> >             password: "{{ aiqumpassword }}"
> >             https: false
> >           with_sequence: start=1 end=32
> >
> > --
> > 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...@googlegroups.com  
> .
> > To view this discussion on the web visit
> > 
> https://groups.google.com/d/msgid/ansible-project/7538e252-68a8-4b49-94c5-19ec6f6c3b59%40googlegroups.com
> 
> 
> >
> 
>  
> >.
> 
> 
> 
> -- 
> Ec

Re: [ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
okay, so if i use them as tasks, will svm.yml takes aggr array from
aggr.yml??

On Fri, Apr 17, 2020 at 4:42 PM Stefan Hornburg (Racke) 
wrote:

> On 4/17/20 1:08 PM, mahesh g o wrote:
> >
> > I am newbie to ansiblei have to create many objects like
> this(aggr,svm,volumes,luns,policies,network interfaces) so
> > i have created playbook for each objects and thought of stitching it
> together.
>
> Yes it is good idea to split up tasks logically, but not a good idea to
> use separate playbooks:
>
> You can group them in task files,.e.g.
>
>tasks:
>  - import_tasks: aggr.yml
>  - import_tasks: svm.yml
>
> Regards
>  Racke
>
> >
> > On Friday, 17 April 2020 16:29:18 UTC+5:30, Stefan Hornburg (Racke)
> wrote:
> >
> > On 4/17/20 12:55 PM, mahesh g o wrote:
> > > Thank u very much ...it worked.
> > >
> >
> > You are welcome.
> >
> > > I need one more helpthe aggr is coming from the playbook1.
> every time i run that playbook1 individually and i
> > enter
> > > the aggr array in  playbook2.
> > >  so how do i get the output of the  playbook1 in the form of array
> so that i dont have to enter the aggr array in
> > the
> > > playbook2.
> > >
> > > playbook2: is the one i shared earlier.
> > >
> >
> > First question would be why do you have two separate playbooks?
> >
> > Regards
> > Racke
> >
> > >
> > > playbook1:
> > >  tasks:
> > > - name: Create Aggregates and wait 5 minutes until aggregate
> is online
> > >   na_ontap_aggregate:
> > > state: absent
> > > service_state: online
> > > name: "aggr_{{item }}"
> > > disk_count: 5
> > > wait_for_online: True
> > > nodes: "{{ node[((item|int-1)//2)] }}"
> > > time_out: 300
> > > hostname: "{{ aiqumip }}"
> > > username: "{{ aiqumusername }}"
> > > password: "{{ aiqumpassword }}"
> > > validate_certs: false
> > > with_sequence: start=1 end=8
> > >
> > >
> > > On Friday, 17 April 2020 14:24:51 UTC+5:30, mahesh g o wrote:
> > >
> > > I have below playbook:
> > >
> > > i have put a loop, there are 8 aggr and 4 protocols: this
> playbook output is like after every 4 loop, it
> > increments
> > > aggr and protocols.
> > >
> > > output of the playbook is:
> > >
> > > svm1,svm2,svm3,svm4---aggr1 and nfs
> > > svm5,svm6,svm7,svm8---aggr2 and iscsi
> > > svm9,svm10,svm11,svm12---aggr3 and cifs
> > > svm13,svm14,svm15,svm16---aggr4 and fcp
> > >
> > > currently the ansible is failing because after 16th loop it is
> not finding any protocols.
> > >
> > > but after 16th loop i want protcols to repeat :
> > >
> > > expecting ouput:
> > >
> > > svm17,svm18,svm19,svm20---aggr5 and nfs
> > > svm21,svm22,svm23,svm24---aggr6 and iscsi
> > > svm25,svm26,svm27,svm28---aggr7 and cifs
> > > svm29,svm30,svm31,svm32---aggr8 and fcp
> > >
> > >
> > >
> > > - hosts: localhost
> > >   gather_facts: false
> > >   vars_files:
> > > - /etc/ansible/group_vars/host_vars
> > >
> > >   vars:
> > > aggr:
> > >   - aggr_1
> > >   - aggr_2
> > >   - aggr_3
> > >   - aggr_4
> > >   - aggr_5
> > >   - aggr_6
> > >   - aggr_7
> > >   - aggr_8
> > > protocols:
> > >   - nfs
> > >   - iscsi
> > >   - cifs
> > >   - fcp
> > >   tasks:
> > > - name: Create SVM
> > >   na_ontap_svm:
> > > state: present
> > > name: "svm{{ item }}"
> > > root_volume: "svm{{ item }}_root_vol"
> > > root_volume_aggregate: "{{ aggr[((item|int-1)//4)] }}"
> > > allowed_protocols: "{{ protocols[(((item)|int-1)//4)]
> }}"
> > > root_volume_security_style: mixed
> > > hostname: "{{ aiqumip }}"
> > > username: "{{ aiqumusername }}"
> > > password: "{{ aiqumpassword }}"
> > > https: false
> > >   with_sequence: start=1 end=32
> > >
> > > --
> > > 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...@googlegroups.com   ansible-project+unsubscr...@googlegroups.com >.
> > > To view this discussion on the web visit
> > >
> https://groups.google.com/d/msgid/ansible-project/7538e252-68a8-4b49-94c5-19ec6f6c3b59%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/ansible-project/7538e252-68a8-4b49-94

[ansible-project] Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich
this block working fine in Linux ! 
i trying to use aws_s3 to download package and using fall back to download 
from web if its fail 
but im getting error which is hard to understand and pin point the couse of 
the error :
i present only the prablematic code as it is pard of very big ansible 
project :

 
   - name: Download package
  block:
- name: Download package from S3
  aws_s3:
bucket: s3_pack
object: "{{ package_url | regex_replace('^.*\\.[a-zA-Z]+\/', 
'') }}"
dest: "{{ ansible_env.HOME }}/"
mode: get
  rescue:
- name: Download package from FTP
  get_url:
url_username: x
url_password: x
dest: "{{ ansible_env.HOME }}/"
url: "{{ package_url }}"



and this is the error:

 
   TASK [package_deploy : Download package from S3] 

task path: /main.yml:74
Friday 17 April 2020  09:44:09 + (0:00:01.608)   0:04:08.479 
**
<10.0.6.69> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 
5986 TO 10.0.6.69
checking if winrm_host 10.0.6.69 is an IPv6 address
EXEC (via pipeline wrapper)
Using module file /home
//lib64/python3.6/dist-packages/ansible/modules/cloud/amazon/aws_s3.py
EXEC (via pipeline wrapper)
EXEC (via pipeline wrapper)
fatal: [10.0.6.69]: FAILED! => changed=false
  module_stderr: |-
Exception calling "Create" with "1" argument(s): "At line:4 char:21
+ def _ansiballz_main():
+ ~
An expression was expected after '('.
At line:12 char:27
+ except (AttributeError, OSError):
+   ~
Missing argument in parameter list.
At line:14 char:7
+ if scriptdir is not None:
+   ~
Missing '(' after 'if' in if statement.
At line:21 char:7
+ if sys.version_info < (3,):
+   ~
Missing '(' after 'if' in if statement.
At line:21 char:30
+ if sys.version_info < (3,):
+  ~
Missing expression after ','.
At line:21 char:25
+ if sys.version_info < (3,):
+ ~
The '<' operator is reserved for future use.
At line:23 char:32
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)
+~
Missing expression after ','.
At line:23 char:33
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)
+ ~
Unexpected token 'imp.PY_SOURCE' in expression or statement.
At line:23 char:32
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)
+~
Missing closing ')' in expression.
At line:23 char:46
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)
+  ~
Unexpected token ')' in expression or statement.
Not all parse errors were reported.  Correct the reported errors 
and try again."
At line:6 char:1
+ $exec_wrapper = [ScriptBlock]::Create($split_parts[0])
+ ~~
+ CategoryInfo  : NotSpecified: (:) [], 
MethodInvocationException
+ FullyQualifiedErrorId : ParseException

The expression after '&' in a pipeline element produced an object 
that was not valid. It must result in a command
name, a script block, or a CommandInfo object.
At line:7 char:2
+ &$exec_wrapper
+  ~
+ CategoryInfo  : InvalidOperation: (:) [], 
RuntimeException
+ FullyQualifiedErrorId : BadExpression
  module_stdout: ''
  msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
  rc: 1

TASK [package_deploy : Download package from FTP] 
***
task path: /main.yml:81
Friday 17 April 2020  09:44:12 + (0:00:02.549)   0:04:11.028 
**
Using module file /home
//lib64/python3.6/dist-packages/ansible/modules/net_tools/basics/get_url.py
<10.0.6.69> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 
5986 TO 10.0.6.69
checking if winrm_host 10.0.6.69 is an IPv6 address
EXEC (via pipeline wrapper)
fatal: [10.0.6.69]: FAILED! => changed=false
  module_stderr: |-
Exception calling "Create" with "1" argument(s): "At line:4 char:21
+ def _ansiballz_main():
+  

[ansible-project] Re: vpshere: how to change port group for 2nd NIC on VM via ansible

2020-04-17 Thread JerryB
Hi

Maybe this module will fix this:
https://docs.ansible.com/ansible/latest/modules/vmware_guest_network_module.html

Regards Jerry

On Monday, September 24, 2018 at 1:10:03 PM UTC+2, Ansible Madness wrote:
>
> So seems the vmware_guest module is in fact ok - however there appears to 
> be no way to specify the NIC but have to rely on the order of the list and 
> perform the port group change to each Adapter
>
> example:
>
>-  vmware_guest:
>  .
>  .
>  networks:
>  - name: management
>  - name: changeme
>
> Good enough for my needs
>
> Cheers
>
>
>
> On Monday, 24 September 2018 12:51:32 UTC+2, Ansible Madness wrote:
>>
>>
>> Scenario: VM on ESXi with 2 NICS
>> Network_adapter1: Fixed port group/VLAN
>> Network_adapter2: Variable port group/VLAN
>>
>> So all i am trying to achieve with ansible is to modify the port 
>> group/VLAN of Network_adapter2, is this even possible?
>>
>> I looked at 
>> https://docs.ansible.com/ansible/latest/modules/vmware_guest_module.html#vmware-guest-module
>>  
>> (networks section), but don't really think this will achieve what i require
>>
>> In vsphere this can be achieve din the powershell with something like 
>> 'set-networkadapter -Portgroup "XXX"' for the interface in question
>>
>> Many thanks for anyone with experience here.
>>
>> Cheers
>> Rod
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a213b5dc-85f7-4468-a424-f626da6a5fc3%40googlegroups.com.


[ansible-project] Aruba_command no output to my Bash

2020-04-17 Thread 'Mac' via Ansible Project
Hi 
As a newbie to Ansible i have simple question
for my understanding , if  do a "show version" via a Playbook on any 
Network device i will get the output to the bash is started the playbook 
right ?
for Example i to a 

~# ansible-playbook play.yml -i /etc/ansible/hosts 


PLAY [aruba_ap] 
**


TASK [run show version on remote devices] 


*[WARNING]: Platform linux on host 192.168.100.11 is using the discovered 
Python interpreter at /usr/bin/python, but future installation of another 
Python interpreter could change this. See*

*https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html
 
for more information.*

ok: [192.168.100.11]


PLAY RECAP 
***

192.168.100.11 : ok=1changed=0unreachable=0
failed=0skipped=0rescued=0ignored=0   


~#

i would expect the output from the "show version" somewhere after "ok: 
[192.168.100.11]"but that's not the Case. 

My Playbook looks like this

---

-

  connection: local

  hosts: aruba_ap

  gather_facts: no

  tasks:

- name: "run show version on remote devices"

  aruba_command:

commands:

 - show version


so what do i have to add to the playbook (or somewhere else )to get the 
output of the show commands immediately after the command was send on a per 
host view?

Regards Markus




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f2395eec-3ad9-45b0-8c51-b744a335e658%40googlegroups.com.


[ansible-project] REST API to add host to inventory for Ansible Tower is Not working!

2020-04-17 Thread Vivek Mandal
Hi,
   I have been trying to execute a REST API to
Add a host to an inventory.Below is the API.

/api/v2/inventories/{id}/hosts/

Unfortunately, This API doesn't work. It gives the response as 200(Ok). But 
only displays the existing host. Its the same response when you run GET method 
for the same API call. Can someone please help me rectifying the error.

Thanks,
Vivek

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e3ddd049-7dbc-467f-9621-261676e990aa%40googlegroups.com.


Re: [ansible-project] REST API to add host to inventory for Ansible Tower is Not working!

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 3:40 PM, Vivek Mandal wrote:
> Hi,
>I have been trying to execute a REST API to
> Add a host to an inventory.Below is the API.
> 
> /api/v2/inventories/{id}/hosts/
> 
> Unfortunately, This API doesn't work. It gives the response as 200(Ok). But 
> only displays the existing host. Its the same response when you run GET 
> method for the same API call. Can someone please help me rectifying the error.
> 
> Thanks,
> Vivek
> 

Hello Vivek,

this list is for Ansible only, not for Tower or AWX.

Please contact Redhat support.

Regards
 Racke

-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/618896d4-212f-88af-5207-d21a34f923a6%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


[ansible-project] Loop functionality is failing when i use add_host module inventory in other playbook

2020-04-17 Thread Suresh Karpurapu
Hi Ansible team,

I am using the CSV file as below for nfs volume migration as we have 1000 
servers with 100 volumes. Hence, i would like to make to host inventory 
using add_host file instead using inventory file. However, the loop is 
failing when i use add_host module, if the server has more than one volume . 
would anyone please help me on this request as i would like to mount all 
the volumes on respective servers as per CSV input?

# cat mounts.csv
host,remote_path,mnt_path,python
host1,nfsflr01:/volahcstg_www_masup_stg_data_01,/myasup/stg/data,/usr/bin/python2.6
host1,nfsflr02:/volahcstg_www_masup_stg_app_01,/myasup/stg/app,/usr/bin/python2.6
host2,nfsflr01:/volahcstg_www_masup_stg_data_01,/myasup/stg/data,/usr/bin/python2.6
host2,nfsflr02:/volahcstg_www_masup_stg_app_01,/myasup/stg/app,/usr/bin/python2.6


# cat mounts.yml
---
- name: mount the nfsshare in client side
  hosts: localhost
  gather_facts: false
  become: yes
  tasks:
- name: reading volume info from csv
  read_csv:
path: "{{ playbook_dir }}/mounts.csv"
  register: sources
- name: Grouping host and volume information
  add_host:
name: "{{ item.0 }}"
groups: nfsgroup
var1: "{{ item.1|json_query('[].remote_path') }}"
var2: "{{ item.1|json_query('[].mnt_path') }}"
ansible_python_interpreter: "{{ item.1.0.python }}"
  loop: "{{ sources.list|groupby('host') }}"
- name: list the volumes
  hosts: nfsgroup
  become: yes
  gather_facts: false
  tasks:
- name: debug output
  debug:
msg:
  - "{{ inventory_hostname }}"
  - "{{ var1 }}"
  - "{{ var2 }}"
- name: mounting the volume in the fstab file
  hosts: nfsgroup
  gather_facts: false
  become: yes
  tasks:
- name: mounting the volume in the fstab file
  mount:
fstype: nfs
opts: 
"rw,bg,hard,rsize=65536,wsize=65536,vers=3,actimeo=0,nointr,suid,timeo=600,tcp"
dump: "0"
passno: "0"
src: "{{ var1[0] }}"
path: "{{ var2[0] }}"
state: mounted
  delegate_to: "{{ inventory_hostname }}"
...


Result:


TASK [Grouping host and volume information] 
*
task path: /suresh/suresh_playbooks/mounts.yml:12

creating host via 'add_host': hostname=host1
changed: [localhost] => (item=[u'host1', [{u'python': 
u'/usr/bin/python2.6', u'host': u'host1', u'mnt_path': u'/myasup/stg/data', 
u'remote_path': u'nfsflr01:/volahcstg_www_masup_stg_data_01'}, {u'python': 
u'/usr/bin/python2.6', u'host': u'host1', u'mnt_path': u'/myasup/stg/app', 
u'remote_path': u'nfsflr02:/volahcstg_www_masup_stg_app_01'}]]) => {

"add_host": {
"groups": [
"nfsgroup"
],
"host_name": "host1",
"host_vars": {
"ansible_python_interpreter": "/usr/bin/python2.6",
"var1": [
"nfsflr01:/volahcstg_www_masup_stg_data_01",
"nfsflr02:/volahcstg_www_masup_stg_app_01"
],
"var2": [
"/myasup/stg/data",
"/myasup/stg/app"
]

}
},
"ansible_loop_var": "item",
"changed": true,
"item": [
"host1",
[
{
"host": "host1",
"mnt_path": "/myasup/stg/data",
"python": "/usr/bin/python2.6",
"remote_path": "nfsflr01:/volahcstg_www_masup_stg_data_01"
},
{
"host": "host1",
"mnt_path": "/myasup/stg/app",
"python": "/usr/bin/python2.6",
"remote_path": "nfsflr02:/volahcstg_www_masup_stg_app_01"
}
]
]

}
creating host via 'add_host': hostname=host2
changed: [localhost] => (item=[u'host2', [{u'python': 
u'/usr/bin/python2.6', u'host': u'host2', u'mnt_path': u'/myasup/stg/data', 
u'remote_path': u'nfsflr01:/volahcstg_www_masup_stg_data_01'}, {u'python': 
u'/usr/bin/python2.6', u'host': u'host2', u'mnt_path': u'/myasup/stg/app', 
u'remote_path': u'nfsflr02:/volahcstg_www_masup_stg_app_01'}]]) => {

"add_host": {
"groups": [
"nfsgroup"
],
"host_name": "host2",
"host_vars": {
"ansible_python_interpreter": "/usr/bin/python2.6",
"var1": [
"nfsflr01:/volahcstg_www_masup_stg_data_01",
"nfsflr02:/volahcstg_www_masup_stg_app_01"
],
"var2": [
"/myasup/stg/data",
"/myasup/stg/app"
]

}
},
"ansible_loop_var": "item",
"changed": true,
"item": [
"host2",
[
{
"host": "host2",
"mnt_path": "/myasup/stg/data",
"python": "/usr/bin/python2.6",
"remote_path": "nfsflr01:/volahcstg_www_masup_stg_data_01"
},
{
   

[ansible-project] Re: [HOSTVARS][MERGED] Unexpected behavior with merge variables of different host which are in several groups

2020-04-17 Thread Baptiste Doublet
Hi,

That did the job:
etcd_cluster: # recommendation: 3 or 5-7 nodes 
  hosts: 
demo_postgres1: 
etcd_ip: '***' 

I don't know why I used vars, maybe because I read a lot of ansible 
documentation like How to build your inventory and that cursed my brain ^^

atlanta:
  hosts:
host1:
host2:
  vars:
ntp_server: ntp.atlanta.example.com
proxy: proxy.atlanta.example.com


Thanks again Racke !

Le mardi 14 avril 2020 11:39:36 UTC+2, Baptiste Doublet a écrit :
>
> Hi Everybody,
>
> I have a problem that I can't resolve on my own.
> I want to deploy an etcd cluster with postgresql on the same servers
> I have three servers and this is my inventory file:
>
> ```
> all:
> children:
> etcd_cluster: # recommendation: 3 or 5-7 nodes
> hosts:
> demo_postgres1:
> vars:
> etcd_ip: '***'
> demo_postgres2:
> vars:
> etcd_ip: '***'
> demo_postgres3:
> vars:
> etcd_ip: '***'
> master:
> hosts:
> demo_postgres1:
> vars:
> postgres_ip: '***'
> postgresql_exists: 'false'
> replica:
> hosts:
> demo_postgres2:
> vars:
> postgres_ip: '***'
> postgresql_exists: 'false'
> demo_postgres3:
> vars:
> postgres_ip: '***'
> postgresql_exists: 'false'
> balancers:
> hosts:
> demo_haproxy1:
> vars:
> haproxy_ip: '***'
> demo_haproxy2:
> vars:
> haproxy_ip: '***'
> demo:
> vars:
> ansible_ssh_common_args: "-F ../../ssh_config/demo_config"
> children:
> balancers:
> etcd_cluster: 
> postgres_cluster:
> children:
> master:
> replica:
> ```
> I have the demo_postgres[0-3] servers that run etcd and postgres. Just to 
> prepare an external instance for etcd cluster, I have separated its in two 
> distinct groups: etcd_cluster and postgres_cluster.
> I have etcd_ip vars and postgres_ip vars respectively on these groups.
>
> My problem is when I run my playbook with hosts: etcd_cluster and I print 
> hostvars, I get the hostvars of postgres_cluster:
>
> ```
> PLAY [etcd_cluster] 
> ***
>
> TASK [Gathering Facts] 
> 
> ok: [demo_postgres1]
> ok: [demo_postgres3]
> ok: [demo_postgres2]
>
> TASK [Ansible | List all known variables and facts] 
> ***
> ok: [demo_postgres1] => {
> "hostvars[inventory_hostname]['vars']": {
> "postgres_ip": "***",
> "postgresql_exists": "false"
> }
> }
> ok: [demo_postgres2] => {
> "hostvars[inventory_hostname]['vars']": {
> "postgres_ip": "***",
> "postgresql_exists": "false"
> }
> }
> ok: [demo_postgres3] => {
> "hostvars[inventory_hostname]['vars']": {
> "postgres_ip": "***",
> "postgresql_exists": "false"
> }
> }
>
> ```
> I didn't find any information about the merging of hostvars when the host 
> is in multiple groups and when I have tested to remove the postgres_cluster 
> group, I get the correct hostvars:
>
> ```
> PLAY [etcd_cluster] 
> ***
>
> TASK [Gathering Facts] 
> 
> ok: [demo_postgres1]
> ok: [demo_postgres3]
> ok: [demo_postgres2]
>
> TASK [Ansible | List all known variables and facts] 
> ***
> ok: [demo_postgres1] => {
> "hostvars[inventory_hostname]['vars']": {
> "etcd_ip": "***"
> }
> }
> ok: [demo_postgres2] => {
> "hostvars[inventory_hostname]['vars']": {
> "etcd_ip": "***"
> }
> }
> ok: [demo_postgres3] => {
> "hostvars[inventory_hostname]['vars']": {
> "etcd_ip": "***"
> }
> }
> ```
>
> I would expect that my etcd_ip was merged with postgres_ip ? I can resolve 
> this by adding the etcd_ip in postgres_cluster hostvars but I want to 
> understand why merge is not working.
>
> If you need more information, feel free to ask.
>
> Best regards,
>
> BDO
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c455f9f0-ff4a-4d15-b7c1-d0f9ff06bc37%40googlegroups.com.


Re: [ansible-project] Re: [HOSTVARS][MERGED] Unexpected behavior with merge variables of different host which are in several groups

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 4:54 PM, Baptiste Doublet wrote:
> Hi,
> 
> That did the job:
> etcd_cluster: # recommendation: 3 or 5-7 nodes
>       hosts:
>         demo_postgres1:
>             etcd_ip: '***'
> 
> I don't know why I used vars, maybe because I read a lot of ansible 
> documentation like How to build your inventory and
> that cursed my brain ^^
> 

While the documentation covers a lot of good thing, it doesn't note the 
differences between group variables (with vars:
) and host vars (without vars:).

In order to avoid confusion, you can use separate files for the host variables.

Regards
 Racke

> atlanta:
>   hosts:
> host1:
> host2:
>   vars:
> ntp_server: ntp.atlanta.example.com
> proxy: proxy.atlanta.example.com
> 
> 
> Thanks again Racke !
> 
> Le mardi 14 avril 2020 11:39:36 UTC+2, Baptiste Doublet a écrit :
> 
> Hi Everybody,
> 
> I have a problem that I can't resolve on my own.
> I want to deploy an etcd cluster with postgresql on the same servers
> I have three servers and this is my inventory file:
> 
> ```
> all:
> children:
> etcd_cluster: # recommendation: 3 or 5-7 nodes
> hosts:
> demo_postgres1:
> vars:
> etcd_ip: '***'
> demo_postgres2:
> vars:
> etcd_ip: '***'
> demo_postgres3:
> vars:
> etcd_ip: '***'
> master:
> hosts:
> demo_postgres1:
> vars:
> postgres_ip: '***'
> postgresql_exists: 'false'
> replica:
> hosts:
> demo_postgres2:
> vars:
> postgres_ip: '***'
> postgresql_exists: 'false'
> demo_postgres3:
> vars:
> postgres_ip: '***'
> postgresql_exists: 'false'
> balancers:
> hosts:
> demo_haproxy1:
> vars:
> haproxy_ip: '***'
> demo_haproxy2:
> vars:
> haproxy_ip: '***'
> demo:
> vars:
> ansible_ssh_common_args: "-F ../../ssh_config/demo_config"
> children:
> balancers:
> etcd_cluster:
> postgres_cluster:
> children:
> master:
> replica:
> ```
> I have the demo_postgres[0-3] servers that run etcd and postgres. Just to 
> prepare an external instance for etcd
> cluster, I have separated its in two distinct groups: etcd_cluster and 
> postgres_cluster.
> I have etcd_ip vars and postgres_ip varsrespectivelyon these groups.
> 
> My problem is when I run my playbook with hosts: etcd_cluster and I print 
> hostvars, I get the hostvars of
> postgres_cluster:
> 
> ```
> PLAY [etcd_cluster]
> 
> ***
> 
> TASK [Gathering Facts]
> 
> 
> ok: [demo_postgres1]
> ok: [demo_postgres3]
> ok: [demo_postgres2]
> 
> TASK [Ansible | List all known variables and facts]
> 
> ***
> ok: [demo_postgres1] => {
>     "hostvars[inventory_hostname]['vars']": {
>     "postgres_ip": "***",
>     "postgresql_exists": "false"
>     }
> }
> ok: [demo_postgres2] => {
>     "hostvars[inventory_hostname]['vars']": {
>     "postgres_ip": "***",
>     "postgresql_exists": "false"
>     }
> }
> ok: [demo_postgres3] => {
>     "hostvars[inventory_hostname]['vars']": {
>     "postgres_ip": "***",
>     "postgresql_exists": "false"
>     }
> }
> 
> ```
> I didn't find any information about the merging of hostvars when the host 
> is in multiple groups and when I have
> tested to remove the postgres_cluster group, I get the correct hostvars:
> 
> ```
> PLAY [etcd_cluster]
> 
> ***
> 
> TASK [Gathering Facts]
> 
> 
> ok: [demo_postgres1]
> ok: [demo_postgres3]
> ok: [demo_postgres2]
> 
> TASK [Ansible | List all known variables and facts]
> 
> ***
> ok: [demo_postgres1] => {
>     "hostvars[inventory_hostname]['vars']": {
>     "etcd_ip": "***"
>     }
> }
> ok: [demo_postgres2] => {
>     "hostvars[inventory_hostname]['vars']": {
>     "etcd_ip": "***"
>     }
> }
> ok: [demo_postgres3] => {
>     "hostvars[inventor

[ansible-project] need to run powershell script without copying to target host

2020-04-17 Thread Pavan Nr
Hi All,

i have machien Ansible running in RHEL 7
Target host: Windows server 2019

i was able run powershell script by copying from RHEL to windows ,working 
fine 

- name: Copy a single file
win_copy:
  src: "{{ playbook_dir }}/files/test.ps1"
  dest: C:\Temp\test.ps1

  - name: Run a script
win_shell: C:\temp\test.ps1

---
but without copying can we run powershell scripts directly from Ansible 
Engine?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55204ccd-e1b2-473f-a076-c9c55219375d%40googlegroups.com.


[ansible-project] Ansible running script with wrong user

2020-04-17 Thread George James
I have the below task in ansible, but when I take a look at the process 
using `ps aux | grep nginx`, I see that the process is being run by the 
root user instead of the nginx user is there a way I can fix this.


- name: Install Nginx Ubuntu
hosts: all
remote_user: "{{ NGINX_USER }}"
become: yes
become_method: sudo
gather_facts: no
connection: ssh
vars_files:
- ../vars/global.yaml
tasks:
- name: Start NGINX
become: true
become_user: "{{ NGINX_USER }}"
become_method: sudo
systemd:
state: started
name: nginx

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/96ce3613-6d7f-4ddb-8667-fba44494490f%40googlegroups.com.


[ansible-project] New Ansible releases 2.9.7, 2.8.11, and 2.7.17 [Revised]

2020-04-17 Thread Matt Clay
This is an updated version of the original release announcement.
It has been updated to include CVE details in the "What's new" section.

Hi all- we're happy to announce that the general release of Ansible 2.9.7,
2.8.11, and 2.7.17 are now available!


How do you get it?
--

$ pip install ansible==2.9.7 --user
or
$ pip install ansible==2.8.11 --user
or
$ pip install ansible==2.7.17 --user

The tar.gz of the releases can be found here:

* 2.9.7
  https://releases.ansible.com/ansible/ansible-2.9.7.tar.gz
  SHA256: 7222ce925536a25b2912364e13b03a3e21dbf2f96799ebff304f48509324de7b
* 2.8.11
  https://releases.ansible.com/ansible/ansible-2.8.11.tar.gz
  SHA256: 156caa8b6c60b9f0d5c7d57ee0f4e46d8e226147b58546be6a8ac52925a9c191
* 2.7.17
  https://releases.ansible.com/ansible/ansible-2.7.17.tar.gz
  SHA256: 9fdb79c43f7ad972dc7ccff8a4e9553d623e52dc80b802c619568d3c38f94ccc


What's new in 2.9.7, 2.8.11, and 2.7.17
---

These releases are security and maintenance releases containing numerous 
bugfixes.

CVEs fixed in these releases:

CVE-2020-1733  - ansible: insecure temporary directory when running 
become_user from become directive
CVE-2020-1735  - ansible: path injection on dest parameter in fetch module
CVE-2020-1737  - ansible: Extract-Zip function in win_unzip module does not 
check extracted path
CVE-2020-1739  - ansible: svn module leaks password when specified as a 
parameter
CVE-2020-1740  - ansible: secrets readable after ansible-vault edit
CVE-2020-1746  - ansible: information disclosure issue in ldap_attr and 
ldap_entry modules
CVE-2020-1753  - ansible: kubectl connection plugin leaks sensitive 
information [1]
CVE-2020-10684 - ansible: code injection when using ansible_facts as a 
subkey
CVE-2020-10685 - ansible: modules which use files encrypted with vault are 
not properly cleaned up
CVE-2020-10691 - ansible: archive traversal vulnerability in ansible-galaxy 
collection install [2]

Notes:

[1] CVE-2020-1753  - Resolved in documentation. Only resolved in Ansible 
2.9.
[2] CVE-2020-10691 - Affects only Ansible 2.9.

The full changelogs are at:

* 2.9.7
  
https://github.com/ansible/ansible/blob/stable-2.9/changelogs/CHANGELOG-v2.9.rst
* 2.8.11
  
https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst
* 2.7.17
  
https://github.com/ansible/ansible/blob/stable-2.7/changelogs/CHANGELOG-v2.7.rst


What's the schedule for future maintenance releases?


Future maintenance releases will occur approximately every 3 weeks.  So 
expect
the next one around 2020-05-07.


Porting Help


We've published a porting guide at
https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.9.html 
to
help migrate your content to 2.9.


If you discover any errors or if any of your working playbooks break when 
you
upgrade to 2.9.7, please use the following link to report the regression:

  https://github.com/ansible/ansible/issues/new/choose

In your issue, be sure to mention the Ansible version that works and the one
that doesn't.

Thanks!

-Matt Clay

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/09fde3ae-32d4-4943-add8-6a0a15ee6812%40googlegroups.com.


[ansible-project] Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Jordan Borean
You can’t run Python modules on Windows so this was never designed to work on 
those hosts.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/94c36de4-65cc-44b3-9329-5e3aa75edd2e%40googlegroups.com.


[ansible-project] Ansible Permissions issues

2020-04-17 Thread George James
In the below playbook, I specify that ansible should run with the nginx 
user, but at the end when the task is run and I check in the process, I see 
that the last process runs with root.

Also, when I try to override this by adding become nginx on that last user, 
the scripts stops working and eventually shows a timeout.

I have the below playbook, the problem is that last task that is supposed 
to start the process does not run the process as the NGINX_USER, it always 
runs as root, which was never specified anywhere. I check with `ps aux | 
grep nginx`. And when it does this I get a `Forbidden error`.

And when I try to force it to become user like in the commented out code, 
it gets stuck and won't complete.

How do I ensure that ansbile always runs with the correct users. I am not 
sure how to fix this.


   


- name: Install Nginx Ubuntu
  hosts: all
  remote_user: "{{ NGINX_USER }}"
  become: yes
  become_method: sudo
  gather_facts: no
  connection: ssh
  vars:
NGINX_VERSION: nginx-1.17.10
NGINX_SBIN_PATH: /usr/sbin/
NGINX_ERROR_LOG_PATH: /var/log/nginx/error.log
NGINX_HTTP_LOG_PATH: /var/log/nginx/access.log
NGINX_PID_PATH: /var/run/nginx.pid
  vars_files:
- ../vars/global.yaml
  tasks:
- name: Check if Nginx Exists
  stat: path=/etc/init.d/nginx
  register: nginx_status

- name: Stop nginx Service
  service: name=nginx state=stopped
  when: nginx_status.stat.exists
  register: service_stopped

- name: Make sure a systemd is not running
  systemd:
state: stopped
name: nginx

- name: Install aptitude using apt
  apt:
name: aptitude
state: latest
update_cache: yes
force_apt_get: yes

- name: Update apt repo
  apt:
update_cache: yes
cache_valid_time: 3600
  
- name: Install required system packages
  apt: name={{ item }} state=latest update_cache=yes
  loop:
[
  "build-essential",
  "libpcre3",
  "libpcre3-dev",
  "zlib1g",
  "zlib1g-dev",
  "libssl-dev",
]
  
- name: Download nginx source
  get_url:
url: "http://nginx.org/download/{{ NGINX_VERSION }}.tar.gz"
dest: "/tmp/{{ NGINX_VERSION }}.tar.gz"

- name: Unpacking NGINX
  unarchive:
copy: no
dest: /tmp/
src: "/tmp/{{ NGINX_VERSION }}.tar.gz"
  
- name: Configure NGINX source with custom modules
  command: "./configure  --prefix=/nginx --sbin-path={{ 
NGINX_SBIN_PATH }} --error-log-path={{ NGINX_ERROR_LOG_PATH }} 
--http-log-path={{ NGINX_HTTP_LOG_PATH }} --with-pcre
  --pid-path={{ NGINX_PID_PATH }} --with-http_ssl_module 
--with-http_v2_module"
  args:
chdir: "/tmp/{{ NGINX_VERSION }}"
  
- name: Make NGINX
  become: yes
  shell: make && make install
  args:
chdir: "/tmp/{{ NGINX_VERSION }}"
  
- name: Create directories"
  file:
path: "{{ item.dir }}"
state: directory
owner: "{{ item.owner }}"
group: "{{ item.group }}"
mode: "{{ item.mode }}"
  with_items:
- { dir: "/usr/local/nginx/html", owner: "{{ SYSTEM_USER }}", 
group: "{{ SYSTEM_USER_GROUP }}", mode: 755}
- { dir: "/nginx", owner: "{{ NGINX_USER }}", group: "{{ 
NGINX_USER }}", mode: 755}
  
- name: Copy nginx files
  copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ NGINX_USER }}"
group: "{{ NGINX_USER }}"
mode: 755
  with_items:
# - { src: "./conf/nginx.conf", dest: "{{ NGINX_CONF_PATH }}" }
- { src: "./www/", dest: "/nginx/html" }
- { src: "./scripts/nginx.service", dest: "/lib/systemd/system/
nginx.service" }

- name: Start NGINX
  # become: true
  # become_user: "{{ NGINX_USER }}"
  # become_method: sudo
  systemd:
state: started
name: nginx


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/bf8b7f5e-e115-4393-be22-5efbc4cd9700%40googlegroups.com.


[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich
didn't know that , 
How do i connect to s3 and download file using user/password ? 


On Friday, April 17, 2020 at 9:51:56 PM UTC+3, Jordan Borean wrote:
>
> You can’t run Python modules on Windows so this was never designed to work 
> on those hosts.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/736d083e-76a3-4752-b826-90dbb1bad5a9%40googlegroups.com.


[ansible-project] Re: need to run powershell script without copying to target host

2020-04-17 Thread Jordan Borean
The proper way is to use the script module

- name: run script
  script: test.ps1

It will automatically try and find 'test.ps1' in various folder, the files 
folder adjacent to the playbook is one of them, copy it across, execute, 
then delete the file all in 1 go. If you truly don't want to copy across 
the file then your only option is to read the script using the lookup 
plugin and use it with win_shell

- name: run script in memory
  win_shell: '{{ lookup("file", "test.ps1") }}'

If this is a really large script you might read some command line length 
limits so it's not always possible to do this.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/72a3b823-dcc1-4932-94f0-9e681e4a577f%40googlegroups.com.


[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich

also why the fall back dosn't work ? why does't it download from the web 
i mean the  rescue block.

On Friday, April 17, 2020 at 10:22:18 PM UTC+3, Meir Yanovich wrote:
>
> didn't know that , 
> How do i connect to s3 and download file using user/password ? 
>
>
> On Friday, April 17, 2020 at 9:51:56 PM UTC+3, Jordan Borean wrote:
>>
>> You can’t run Python modules on Windows so this was never designed to 
>> work on those hosts.
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/966b1c9a-77dc-4b13-af5c-efd9b27ca6e0%40googlegroups.com.


[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Jordan Borean
Because get_url is also a Python module 
https://docs.ansible.com/ansible/latest/user_guide/windows_faq.html#can-i-run-python-modules-on-windows-hosts.

The alternative for you is to either use win_get_url, or download the file 
on the controller using the Python modules and use win_copy to copy it 
across.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/760ce24f-6d55-40dd-84d3-b4eafbfb3367%40googlegroups.com.


[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich
ok i found this question that has been ask before 
https://github.com/ansible/ansible/issues/34135

can you point me to some example using downloading the backet localy and 
then copy it to windows ?

On Friday, April 17, 2020 at 9:51:56 PM UTC+3, Jordan Borean wrote:
>
> You can’t run Python modules on Windows so this was never designed to work 
> on those hosts.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a8e2aca1-67e2-4723-9bc3-d7095f3dcfd6%40googlegroups.com.


Re: [ansible-project] Re: need to run powershell script without copying to target host

2020-04-17 Thread Pavan Nr
Thanks Jordan, very informative, I will try options which you mentioned.

On Sat, 18 Apr, 2020, 12:53 AM Jordan Borean,  wrote:

> The proper way is to use the script module
>
> - name: run script
>   script: test.ps1
>
> It will automatically try and find 'test.ps1' in various folder, the files
> folder adjacent to the playbook is one of them, copy it across, execute,
> then delete the file all in 1 go. If you truly don't want to copy across
> the file then your only option is to read the script using the lookup
> plugin and use it with win_shell
>
> - name: run script in memory
>   win_shell: '{{ lookup("file", "test.ps1") }}'
>
> If this is a really large script you might read some command line length
> limits so it's not always possible to do this.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/72a3b823-dcc1-4932-94f0-9e681e4a577f%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGwKPnf%2B5f2mrJ4hk_PD_WDuXdX9RNjp-cFMPod5n19b9f5CNg%40mail.gmail.com.


[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Jordan Borean
Read through that issue you linked and you will see it.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/586d3144-e53a-45c5-956b-ea78889b7dd5%40googlegroups.com.


[ansible-project] how to use suexec su in ansible

2020-04-17 Thread Pradeep Tiwari
Hi All, 

I did look at various privilege escalation tools available but i dont see 
suexec listed there. Could you please guide me how to achieve this become method

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/34c25de0-628a-4de6-9d77-867287d932de%40googlegroups.com.


[ansible-project] Try to put 1 Ansible facts from multiple servers into one list

2020-04-17 Thread Gregory Skelton
I feel this should be easy. 

I'm trying to put a fact I set on each server into one central list. 
sat_id is the Big List
sat_id_raw is the variable that I set earlier in the automation. 

What am I missing here?
Thanks in advance

name: Put all of the var into a big list

  set_fact:

sat_id: "{{ sat_id }} + ['{{ sat_id_raw }}']"

  delegate_to: localhost

 

- name: Print object type

  debug:

var: sat_id

  delegate_to: localhost

 

 

TASK [Facts-list : Put all of the vars into a big list] 
*

ok: [MY-SERVER1 -> localhost] => {

"ansible_facts": {

"sat_id": [

"15929"

]

},

"changed": false

}

ok: [MY-SERVER2 -> localhost] => {

"ansible_facts": {

"sat_id": [

"13409"

]

},

"changed": false

}

 

TASK [Facts-list : Print object type] 
***

task path: 
/data/grskelt/satellite-devel/satellite-contentviews-list/tasks/main.yml:96

ok: [MY-SERVER1 -> localhost] => {

"sat_id": [

"15929"

]

}

ok: [MY-SERVER2 -> localhost] => {

"sat_id": [

"13409"

]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/829bacc7-12b8-439d-8770-7cf956da2e9c%40googlegroups.com.


[ansible-project] Combine 2 dictionary in ansible / jinja2 (simple)

2020-04-17 Thread Tom Cheung

Hi friends,

I want to use ansible to merge below 2 dictionary to become 1.
I have been stucking for few days already. Headache.

I have 2 variables now.

*1. variable "my_directories":*

{
"directoryA": [
"/bar/foo/file1.txt",
"/bar/foo/file2.txt"
],
"directoryB": [
"/bar/baz/file3.txt",
"/bar/baz/file4.txt",
"/bar/baz/file5.txt"
]
}


*2. variable "my_filecontents":*

{
"/bar/foo/file1.txt": "file1Content",
"/bar/foo/file2.txt": "file2Content",
"/bar/baz/file3.txt": "file3Content",
"/bar/baz/file4.txt": "file4Content",
"/bar/baz/file5.txt": "file5Content"
}


i want to merge it to become:

*Result variable: "my_result"*

{
"directoryA": {
"/bar/foo/file1.txt": "file1Content",
"/bar/foo/file2.txt": "file2Content"
},
"directoryB": {
"/bar/baz/file3.txt": "file3Content",
"/bar/baz/file4.txt": "file4Content",
"/bar/baz/file5.txt": "file5Content"
}
}




The directories and files could be dynamic.
I tried so many codes but still did not work.

Thank you!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/08952920-f57a-4b18-a979-b8d0eae84e12%40googlegroups.com.