Re: [ansible-project] List all variables only defined in hosts file corresponding to a host

2020-06-10 Thread Dick Visser
I don't think you can filter host vars based on where they're set

On Thu, 11 Jun 2020 at 07:09, utkarsh srivastava <
utkarsh.srivastav...@gmail.com> wrote:

> Hi
>
> I want to list all variable and it's value defined in hosts file
> corresponding to a host
> for example:
>
> [hostgroup1]
> host1 variable1=value1   variable2=value2  variable3=value3
>
> so i want to list all variables defined
> like
> variable1: value1
> variable2: value2
> variable3: value3
>
> I am using
>
> - debug:
>msg: "{{ hostvars[inventory_hostname] }}"
>
> but in this case, On console output i am getting predefined variables as
> well related to that host along with manual defined variables
>
>
> Any help would be appreciated
>
> Thanks in advance.
>
> --
> 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/3ba35e6c-1477-44e9-b9ba-d7e5a8fc32e1o%40googlegroups.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwNt0Sfn6wr0guy5_mhQTZ%2BOsXBoLqmxGOtDgDQLHXvGnQ%40mail.gmail.com.


[ansible-project] List all variables only defined in hosts file corresponding to a host

2020-06-10 Thread utkarsh srivastava
Hi 

I want to list all variable and it's value defined in hosts file 
corresponding to a host
for example:

[hostgroup1]
host1 variable1=value1   variable2=value2  variable3=value3

so i want to list all variables defined 
like
variable1: value1
variable2: value2
variable3: value3

I am using 

- debug:
   msg: "{{ hostvars[inventory_hostname] }}"

but in this case, On console output i am getting predefined variables as 
well related to that host along with manual defined variables


Any help would be appreciated

Thanks in advance. 

-- 
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/3ba35e6c-1477-44e9-b9ba-d7e5a8fc32e1o%40googlegroups.com.


Re: [ansible-project] ansible vmware 0:7 reserved scsi controller card

2020-06-10 Thread Dick Visser
Well then just remove 7 from that list if that can't be used. Also there
are duplicates - even if that isn't a problem you can optimize the loop by
removing those. See
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#set-theory-filters

On Thu, 11 Jun 2020 at 05:16, Bhanu Prakash  wrote:

> This are dynamic values like this
>
> [5,4,3,2,5,4]
>
> as it's in loop it creates disks accordingly ..
>
> On Thursday, 11 June 2020 01:20:13 UTC+5:30, Dick Visser wrote:
>>
>> What does your 'storage' variable look like?
>>
>> On Wed, 10 Jun 2020 at 18:53, Bhanu Prakash  wrote:
>>
> Hello Team,
>>>
>>> I need to add 15 disks , I am getting error because of  0:7 reservation.
>>>
>>> Is there any automation ..please find my below code and help
>>>
>>> - name: Add disks
>>> vmware_guest_disk:
>>>hostname: "{{location}}"
>>>username: "{{vcenteruser}}"
>>>password: "{{vcenterpass}}"
>>>validate_certs: no
>>>datacenter: "{{datacentername}}"
>>>name: "{{hostname}}"
>>>disk:
>>>  - size_gb: "{{ item }}"
>>>type: thin
>>>datastore: "{{datastoredetails}}"
>>>state: present
>>>scsi_controller: 0
>>>unit_number: "{{ my_idx + 1 }}"
>>>scsi_type: 'paravirtual'
>>> loop: "{{ storage }}"
>>> loop_control:
>>>   index_var: my_idx
>>> delegate_to: localhost
>>>
>>> --
>>> 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/e17ebdd8-fad4-42e2-a7f5-f31dd619362fo%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> Sent from a mobile device - please excuse the brevity, spelling and
>> punctuation.
>>
> --
> 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/f531c82c-187e-4e9d-84f0-eb095dc073e5o%40googlegroups.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwM8x3KcPTSknTdSboqxOUFw8Z-6%3DAaNCLCKdeA4W56gTQ%40mail.gmail.com.


Re: [ansible-project] ansible vmware 0:7 reserved scsi controller card

2020-06-10 Thread Bhanu Prakash
This are dynamic values like this 

[5,4,3,2,5,4]

as it's in loop it creates disks accordingly ..

On Thursday, 11 June 2020 01:20:13 UTC+5:30, Dick Visser wrote:
>
> What does your 'storage' variable look like?
>
> On Wed, 10 Jun 2020 at 18:53, Bhanu Prakash  > wrote:
>
>> Hello Team,
>>
>> I need to add 15 disks , I am getting error because of  0:7 reservation.
>>
>> Is there any automation ..please find my below code and help 
>>
>> - name: Add disks
>> vmware_guest_disk:
>>hostname: "{{location}}"
>>username: "{{vcenteruser}}"
>>password: "{{vcenterpass}}"
>>validate_certs: no
>>datacenter: "{{datacentername}}"
>>name: "{{hostname}}"
>>disk:
>>  - size_gb: "{{ item }}"
>>type: thin
>>datastore: "{{datastoredetails}}"
>>state: present
>>scsi_controller: 0
>>unit_number: "{{ my_idx + 1 }}"
>>scsi_type: 'paravirtual'
>> loop: "{{ storage }}"
>> loop_control:
>>   index_var: my_idx
>> delegate_to: localhost
>>
>> -- 
>> 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/e17ebdd8-fad4-42e2-a7f5-f31dd619362fo%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
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/f531c82c-187e-4e9d-84f0-eb095dc073e5o%40googlegroups.com.


[ansible-project] VM not joining domain

2020-06-10 Thread David Foley
Did you check the windows Event logs for the Active Directory 

-- 
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/64defabf-bc9f-43e3-82fc-fd48e567e25ao%40googlegroups.com.


Re: [ansible-project] The vault password file /home/user./vault was not found

2020-06-10 Thread ssn7819
Thank you Brian that worked.

On Wednesday, June 10, 2020 at 4:43:49 PM UTC-4, Brian Coca wrote:
>
> I suspect you have the vault secrets file configured somewhere, use: 
>
> ansible-config dump --only-changed 
>
> to find out where 
> -- 
> -- 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/544ac801-44d6-4899-a706-16668fa84f83o%40googlegroups.com.


Re: [ansible-project] The vault password file /home/user./vault was not found

2020-06-10 Thread Brian Coca
I suspect you have the vault secrets file configured somewhere, use:

ansible-config dump --only-changed

to find out where
-- 
--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7f5M9wtb41svx3py4CgpdPx7xF0sJpk8oGg3n525n%2BdGg%40mail.gmail.com.


Re: [ansible-project] simplify always the same conditionals - evaluate contents of a string in conditionals (changed_when, failed_when, ...)

2020-06-10 Thread Brian Coca
instead of set_fact (which forces static evaluation BEFORE the task,
use `vars:` which is lazy evaluation (on us). Also you are using
templating in the wrong places.


failed_when: my_failed_when|bool
vars:

my_failed_when: "{{'meta' not in r or r['meta']['status'] == 'error'}}"


--
--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7cUgV-w-nuX%2BLMR_E4gZ8oZpUiDLSzYzfbBr0%3D0_MP3YQ%40mail.gmail.com.


[ansible-project] The vault password file /home/user./vault was not found

2020-06-10 Thread ssn7819

Hi Guys

Initially I was using a vault file to store sensitive information and pass 
them in.
It was working. Now I removed any reference to the vault file as I wanted 
to test something else.
Now I keep getting the below error 

ERROR The vault password file /home/user./vault was not found

Below is the actual command I used to run the ansible playbook

*Actual command*
anisble-playbook -i $HOST_FILE playbbok.yml --extra-vars "target_hosts=$2"

*Things that I have checked*
there is no reference to the pass word file in ansible.cfg

Any pointer is highly appreciated.
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d7866a02-9a7b-4b39-a477-b96b744cfb70o%40googlegroups.com.


Re: [ansible-project] Re: how to pass same variable value multiple times in a list

2020-06-10 Thread Brian Coca
mserver and domain are not lists, lists use [ ]  as delimiters not  { }

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


Re: [ansible-project] ansible vmware 0:7 reserved scsi controller card

2020-06-10 Thread Dick Visser
What does your 'storage' variable look like?

On Wed, 10 Jun 2020 at 18:53, Bhanu Prakash  wrote:

> Hello Team,
>
> I need to add 15 disks , I am getting error because of  0:7 reservation.
>
> Is there any automation ..please find my below code and help
>
> - name: Add disks
> vmware_guest_disk:
>hostname: "{{location}}"
>username: "{{vcenteruser}}"
>password: "{{vcenterpass}}"
>validate_certs: no
>datacenter: "{{datacentername}}"
>name: "{{hostname}}"
>disk:
>  - size_gb: "{{ item }}"
>type: thin
>datastore: "{{datastoredetails}}"
>state: present
>scsi_controller: 0
>unit_number: "{{ my_idx + 1 }}"
>scsi_type: 'paravirtual'
> loop: "{{ storage }}"
> loop_control:
>   index_var: my_idx
> delegate_to: localhost
>
> --
> 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/e17ebdd8-fad4-42e2-a7f5-f31dd619362fo%40googlegroups.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwMSp7X4-s7bues2wjKjObdtE%2Byyo4HoG0vdFXk7JP5jWw%40mail.gmail.com.


[ansible-project] Re: Cisco MDS | nxos_zone_zoneset

2020-06-10 Thread Jesse Lyon
I think I found the offending "Check" thats causing my headache.

 # Step1: execute show zone status and get
shZoneStatusObj = ShowZoneStatus(module, vsan)
sw_default_zone = shZoneStatusObj.getDefaultZone()
sw_mode = shZoneStatusObj.getMode()
sw_smart_zoning = shZoneStatusObj.getSmartZoningStatus()if 
sw_smart_zoning.lower() == "Enabled".lower():
sw_smart_zoning_bool = True
else:
sw_smart_zoning_bool = Falseif 
shZoneStatusObj.isVsanAbsent():
module.fail_json(msg='Vsan ' + str(vsan) + ' is not present in the 
switch. Hence cannot procced.')if shZoneStatusObj.isLocked():
module.fail_json(msg='zone has acquired clock on the switch for 
vsan ' + str(vsan) + '. Hence cannot procced.')


Referencing the ShowZoneStatus module that its calling 
Looks like its mishandling the output from this command...
def update(self):

output = self.execute_show_zone_status_cmd().split("\n")

patfordefzone = "VSAN: " + str(self.vsan) + r" 
default-zone:\s+(\S+).*"
patformode = r".*mode:\s+(\S+).*"
patforsession = r".*session:\s+(\S+).*"
patforsz = r".*smart-zoning:\s+(\S+).*"
for line in output:
if "is not configured" in line:
self.vsanAbsent = True
break
mdefz = re.match(patfordefzone, line.strip())
mmode = re.match(patformode, line.strip())
msession = re.match(patforsession, line.strip())
msz = re.match(patforsz, line.strip())

if mdefz:
self.default_zone = mdefz.group(1)
if mmode:
self.mode = mmode.group(1)
if msession:
self.session = msession.group(1)
if self.session != "none":
self.locked = True
if msz:
self.sz = msz.group(1)

def isLocked(self):
return self.locked





On Tuesday, June 9, 2020 at 3:22:34 PM UTC-4, Jesse Lyon wrote:
>
> Alrighty
>
> So I've run into a bit of a head scratcher
>
> New MDS deployment, right? 
> all of 0 customers running across it so far,
> 2 admins poking at it, one being myself trying to get Ansible playbooks to 
> play nicely with this new pair.
>
> Playbook functions on old MDS's without an incident. that is one MINOR 
> code version behind (like .1a to .2)
>
> The error:  
> "msg": "zone has acquired lock on the switch for vsan 101. Hence cannot 
> procced.",
> some redactions have been made.
>
> playbook: 
> ---
> - hosts: sansw01
>   name: create zones
>   connection: network_cli
>   gather_facts: no
>   vars:
> host: 10.20.64.38
> ansible_ssh_pass: REDACTED
> iusername: ansibleuser
> ipassword: "{{ ansible_ssh_pass }}"
> transport: cli
> zoneset_name: "zs101"
> devices:
>   - da: 'host01_875a'
>   - da: 'host02_88ba'
>   - da: 'host04_8742'
>
> storage:
>   - dpure04_ct00
>   - dpure04_ct11
> zone: []
> zones: []
> zone_names: []
>   tasks:
> - name: import vars
>   include_vars: /etc/ansible/host_vars/10.20.64.111.yml
>
> - name: zn creation
>   set_fact:
> zone_names: "{{ zone_names + [dat.0.da~'_'~dat.1] }}"
>   loop: "{{ devices | product(storage) | list }}"
>   loop_control:
> loop_var: dat
>
> - name: set zones fact
>   set_fact:
> zones: "{{ zones + zone }}"
>   loop: "{{ devices | product(storage) | list }}"
>   loop_control:
> loop_var: dev
>   vars:
> zone:
>   - name: "{{ dev.0.da~'_'~dev.1 }}"
> members:
>   - {device-alias: '{{ dev.0.da }}'}
>   - {device-alias: '{{ dev.1 }}'}
> - name: Zone it.
>   loop: "{{ zone_names | list }}"
>   loop_control:
> index_var: zn
>   nxos_zone_zoneset:
> zone_zoneset_details:
>   - vsan: 101
> mode: enhanced
> zone: "{{ zones }}"
> zoneset:
>   - name: "{{ zoneset_name }}"
> members:
>- {name: "{{ zone_names[zn] }}"}
>
>
>
>
> switch details
> Software
>   BIOS:  version 3.7.0
>   kickstart: version 8.4(2)
>   system:version 8.4(2)
>   BIOS compile time:   04/01/2019
>   kickstart image file is: bootflash:
> ///m9700-sf3ek9-kickstart-mz.8.4.2.bin
>   kickstart compile time:  4/30/2020 12:00:00 [04/29/2020 13:51:55]
>   system image file is:bootflash:///m9700-sf3ek9-mz.8.4.2.bin
>   system compile time: 4/30/2020 12:00:00 [04/29/2020 15:18:16]
>
>
> Hardware
>   cisco MDS 9706 (6 Slot) Chassis ("Supervisor Module-3")
>   Intel(R) Xeon(R) CPU C5528 @ 2.13GHz with 8167828 kB of memory.
>   Processor Board ID JAE23250YDL
>
>   Device name: H1PDSANSW01
>   bootflash:4059136 kB
>   slot0:  0 kB (expansion flash)
>
> Kernel uptime is 13 day(s), 2 hour(s), 23 minute(s), 11 second(s)
>
> Last 

[ansible-project] VM not joining domain

2020-06-10 Thread Tony Wong
any idea why my Vm is not joining domain? Credentials are correct

---
# Deploy a VM from a template using Ansible 'vmware_guest' module
- name: Deploy VM from template
  vmware_guest:
hostname: '{{ deploy_vsphere_host }}'
username: '{{ deploy_vsphere_user }}'
password: '{{ deploy_vsphere_password }}'
validate_certs: no
datacenter: '{{ deploy_vsphere_datacenter }}'
cluster: '{{ deploy_vsphere_cluster }}'
#resource_pool: '{{ deploy_vsphere_resourcepool }}'
folder: '{{ deploy_vsphere_folder }}'
name: '{{ inventory_hostname }}'
state: poweredon
guest_id: '{{ guest_id }}'
annotation: "{{ guest_notes }}"
disk:
- size_gb: 60
  type: thin
  datastore: '{{ deploy_vsphere_datastore }}'
networks:
- name: '{{ guest_network }}'
  ip: '{{ guest_custom_ip }}'
  netmask: '{{ guest_netmask }}'
  gateway: '{{ guest_gateway }}'
  dns_servers:
  - '{{ guest_dns_server }}'
  start_connected: yes
hardware:
  memory_mb: '{{ guest_memory }}'
  num_cpus: '{{ guest_vcpu }}'
customization:
  dns_servers:
  - '{{ guest_dns_server }}'
  domain : '{{ guest_domain_name }}'
  hostname: '{{ inventory_hostname }}'
  joindomain: '{{ guest_domain_name }}'
  domainadmin: '{{ domain_admin }}'
  domainadminpassword: ' {{ domain_admin_pass }}'
template: '{{ guest_template }}'
wait_for_ip_address: yes
state: poweredon
  delegate_to: localhost

-- 
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/CALmkhkpCZ5PE2oaY0_bVYgHKM8Hw3%2Bk6AU5vF9Zewik_t2w0fg%40mail.gmail.com.


[ansible-project] ansible vmware 0:7 reserved scsi controller card

2020-06-10 Thread Bhanu Prakash
Hello Team,

I need to add 15 disks , I am getting error because of  0:7 reservation.

Is there any automation ..please find my below code and help 

- name: Add disks
vmware_guest_disk:
   hostname: "{{location}}"
   username: "{{vcenteruser}}"
   password: "{{vcenterpass}}"
   validate_certs: no
   datacenter: "{{datacentername}}"
   name: "{{hostname}}"
   disk:
 - size_gb: "{{ item }}"
   type: thin
   datastore: "{{datastoredetails}}"
   state: present
   scsi_controller: 0
   unit_number: "{{ my_idx + 1 }}"
   scsi_type: 'paravirtual'
loop: "{{ storage }}"
loop_control:
  index_var: my_idx
delegate_to: localhost

-- 
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/e17ebdd8-fad4-42e2-a7f5-f31dd619362fo%40googlegroups.com.


Re: [ansible-project] Cisco MDS | nxos_zone_zoneset

2020-06-10 Thread Jesse Lyon
Updated the modules for MDS to most current release via github.
No success.

On Tuesday, June 9, 2020 at 3:39:21 PM UTC-4, Jesse Lyon wrote:
>
> It's in the OG post.
>
> I can't get it to post /w the code, so here we go.
> https://pastebin.com/ziMcfTSt
>
> On Tuesday, June 9, 2020 at 3:28:13 PM UTC-4, oxido A wrote:
>>
>> And What happens when you  -The admin execute :
>>
>> show zone status  ?? 
>>
>>
>>
>> El mar., 9 jun. 2020 a las 14:22, Jesse Lyon () 
>> escribió:
>>
>>> Alrighty
>>>
>>> So I've run into a bit of a head scratcher
>>>
>>> New MDS deployment, right? 
>>> all of 0 customers running across it so far,
>>> 2 admins poking at it, one being myself trying to get Ansible playbooks 
>>> to play nicely with this new pair.
>>>
>>> Playbook functions on old MDS's without an incident. that is one MINOR 
>>> code version behind (like .1a to .2)
>>>
>>> The error:  
>>> "msg": "zone has acquired lock on the switch for vsan 101. Hence cannot 
>>> procced.",
>>> some redactions have been made.
>>>
>>> playbook: 
>>> ---
>>> - hosts: sansw01
>>>   name: create zones
>>>   connection: network_cli
>>>   gather_facts: no
>>>   vars:
>>> host: 10.20.64.38
>>> ansible_ssh_pass: REDACTED
>>> iusername: ansibleuser
>>> ipassword: "{{ ansible_ssh_pass }}"
>>> transport: cli
>>> zoneset_name: "zs101"
>>> devices:
>>>   - da: 'host01_875a'
>>>   - da: 'host02_88ba'
>>>   - da: 'host04_8742'
>>>
>>> storage:
>>>   - dpure04_ct00
>>>   - dpure04_ct11
>>> zone: []
>>> zones: []
>>> zone_names: []
>>>   tasks:
>>> - name: import vars
>>>   include_vars: /etc/ansible/host_vars/10.20.64.111.yml
>>>
>>> - name: zn creation
>>>   set_fact:
>>> zone_names: "{{ zone_names + [dat.0.da~'_'~dat.1] }}"
>>>   loop: "{{ devices | product(storage) | list }}"
>>>   loop_control:
>>> loop_var: dat
>>>
>>> - name: set zones fact
>>>   set_fact:
>>> zones: "{{ zones + zone }}"
>>>   loop: "{{ devices | product(storage) | list }}"
>>>   loop_control:
>>> loop_var: dev
>>>   vars:
>>> zone:
>>>   - name: "{{ dev.0.da~'_'~dev.1 }}"
>>> members:
>>>   - {device-alias: '{{ dev.0.da }}'}
>>>   - {device-alias: '{{ dev.1 }}'}
>>> - name: Zone it.
>>>   loop: "{{ zone_names | list }}"
>>>   loop_control:
>>> index_var: zn
>>>   nxos_zone_zoneset:
>>> zone_zoneset_details:
>>>   - vsan: 101
>>> mode: enhanced
>>> zone: "{{ zones }}"
>>> zoneset:
>>>   - name: "{{ zoneset_name }}"
>>> members:
>>>- {name: "{{ zone_names[zn] }}"}
>>>
>>>
>>>
>>>
>>> switch details
>>> Software
>>>   BIOS:  version 3.7.0
>>>   kickstart: version 8.4(2)
>>>   system:version 8.4(2)
>>>   BIOS compile time:   04/01/2019
>>>   kickstart image file is: bootflash:
>>> ///m9700-sf3ek9-kickstart-mz.8.4.2.bin
>>>   kickstart compile time:  4/30/2020 12:00:00 [04/29/2020 13:51:55]
>>>   system image file is:bootflash:///m9700-sf3ek9-mz.8.4.2.bin
>>>   system compile time: 4/30/2020 12:00:00 [04/29/2020 15:18:16]
>>>
>>>
>>> Hardware
>>>   cisco MDS 9706 (6 Slot) Chassis ("Supervisor Module-3")
>>>   Intel(R) Xeon(R) CPU C5528 @ 2.13GHz with 8167828 kB of memory.
>>>   Processor Board ID JAE23250YDL
>>>
>>>   Device name: H1PDSANSW01
>>>   bootflash:4059136 kB
>>>   slot0:  0 kB (expansion flash)
>>>
>>> Kernel uptime is 13 day(s), 2 hour(s), 23 minute(s), 11 second(s)
>>>
>>> Last reset
>>>   Reason: Reset due to install
>>>   System version: 8.2(1)
>>>   Service:
>>>
>>> plugin
>>>   Core Plugin, Ethernet Plugin
>>>
>>> Active Package(s)
>>>
>>> FC2 throttle is Enabled
>>> Zoneset activate sanity threshold value in bytes: 3000
>>> SWNAME(config)# sh zone status vsan 101
>>> VSAN: 101 default-zone: deny distribute: full Interop: default
>>> mode: enhanced merge-control: allow
>>> session:  none
>>> single-session: disabled
>>> hard-zoning: enabled broadcast: unsupported
>>> smart-zoning: disabled
>>> rscn-format: fabric-address
>>> activation overwrite control: disabled
>>> Default zone:
>>> qos: none broadcast: unsupported ronly: unsupported
>>> Full Zoning Database :
>>> DB size: 260 bytes
>>> Zonesets:  1 Zones: 1 Aliases: 0 Attribute-groups: 1
>>> Active Zoning Database :
>>> DB Size: 68 bytes
>>> Name: zs101 Zonesets: 1 Zones: 1
>>> Current Total Zone DB Usage: 328 / 400 bytes (0 % used)
>>> Pending (Session) DB size:
>>> Full DB Copy size: 0 bytes
>>> Active DB Copy size: 0 bytes
>>> SFC size: 0 / 400 bytes (0 % used)
>>> Status: Set zoning mode complete at 14:51:15 EDT Jun  9 2020
>>>
>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop 

[ansible-project] Re: Answer to prompt not passing when used cli_command module

2020-06-10 Thread Mohanraj B
I changed the prompt in the ansible-playbook like below, it worked fine.

prompt:
  - "save"
  - "reload"


On Wednesday, June 10, 2020 at 5:49:06 PM UTC+5:30, Mohanraj B wrote:
>
> Hello,
>
> I am trying to upgrade cat9k switch using ansible, facing issues when 
> trying to run the command "install Activate".
>
> *when run "install Activate" command manually in cat9k switch, I am 
> getting the prompt within in 30 seconds like below.*
>
> cat9k-1#install Activate 
> install_activate: START Wed Jun 10 05:05:50 PDT 2020
> install_activate: Activating PACKAGE
>
>
> *Jun 10 20:01:52.230: %INSTALL-5-INSTALL_START_INFO: Switch 1 R0/0: 
> install_engine: Started install activateFollowing packages shall be 
> activated:
> /flash/cat9k-wlc.16.06.05.SPA.pkg
> /flash/cat9k-webui.16.06.05.SPA.pkg
> /flash/cat9k-srdriver.16.06.05.SPA.pkg
> /flash/cat9k-sipspa.16.06.05.SPA.pkg
> /flash/cat9k-sipbase.16.06.05.SPA.pkg
> /flash/cat9k-rpboot.16.06.05.SPA.pkg
> /flash/cat9k-rpbase.16.06.05.SPA.pkg
> /flash/cat9k-guestshell.16.06.05.SPA.pkg
> /flash/cat9k-espbase.16.06.05.SPA.pkg
> /flash/cat9k-cc_srdriver.16.06.05.SPA.pkg
>
>
> This operation requires a reload of the system. Do you want to proceed? [y
> /n]
>
>
>
>
>
> *Below is the playbook snippet:*
>
> - name: Run install activate
>   cli_command:
> command: install Activate
> prompt: 
>   - Press Quit(q) to exit, you may save configuration and re-enter 
> the command. [y/n/q]
>   - This operation requires a reload of the system. Do you want to 
> proceed? [y/n]
> answer:
>   - n
>   vars:
> ansible_command_timeout: 300
>
>
>
>
>
> *verbose output: ansible-playbook -vvv -i hosts site.yaml snippet.*
>
> The full traceback is:
> WARNING: The below traceback may *not* be related to the actual failure.
>   File 
> "/tmp/ansible_cli_command_payload_6575kN/ansible_cli_command_payload.zip/ansible/modules/network/cli/cli_command.py"
> , line 167, in main
>   File 
> "/tmp/ansible_cli_command_payload_6575kN/ansible_cli_command_payload.zip/ansible/module_utils/connection.py"
> , line 185, in __rpc__
> raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), 
> code=code)
> fatal: [66.220.26.111]: FAILED! => {
> "changed": false, 
> "invocation": {
> "module_args": {
> "answer": [
> "n"
> ], 
> "check_all": false, 
> "command": "install Activate", 
> "newline": true, 
> "prompt": [
> "Press Quit(q) to exit, you may save configuration and 
> re-enter the command. [y/n/q]", 
> "This operation requires a reload of the system. Do you 
> want to proceed? [y/n]"
> ], 
> "sendonly": false
> }
> }, 
> "msg": "command timeout triggered, timeout value is 300 secs.\nSee 
> the timeout setting options in the Network Debug and Troubleshooting Guide."
> }
>
>
>
> How to fix this issue?
>
> Thanks,
> Mohan
>

-- 
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/4abe3ca0-4b1f-4096-9f13-e2644f0d834ao%40googlegroups.com.


[ansible-project] Answer to prompt not passing when used cli_command module

2020-06-10 Thread Mohanraj B
Hello,

I am trying to upgrade cat9k switch using ansible, facing issues when 
trying to run the command "install Activate".

*when run "install Activate" command manually in cat9k switch, I am getting 
the prompt within in 30 seconds like below.*

cat9k-1#install Activate 
install_activate: START Wed Jun 10 05:05:50 PDT 2020
install_activate: Activating PACKAGE


*Jun 10 20:01:52.230: %INSTALL-5-INSTALL_START_INFO: Switch 1 R0/0: 
install_engine: Started install activateFollowing packages shall be 
activated:
/flash/cat9k-wlc.16.06.05.SPA.pkg
/flash/cat9k-webui.16.06.05.SPA.pkg
/flash/cat9k-srdriver.16.06.05.SPA.pkg
/flash/cat9k-sipspa.16.06.05.SPA.pkg
/flash/cat9k-sipbase.16.06.05.SPA.pkg
/flash/cat9k-rpboot.16.06.05.SPA.pkg
/flash/cat9k-rpbase.16.06.05.SPA.pkg
/flash/cat9k-guestshell.16.06.05.SPA.pkg
/flash/cat9k-espbase.16.06.05.SPA.pkg
/flash/cat9k-cc_srdriver.16.06.05.SPA.pkg


This operation requires a reload of the system. Do you want to proceed? [y/n
]





*Below is the playbook snippet:*

- name: Run install activate
  cli_command:
command: install Activate
prompt: 
  - Press Quit(q) to exit, you may save configuration and re-enter the 
command. [y/n/q]
  - This operation requires a reload of the system. Do you want to 
proceed? [y/n]
answer:
  - n
  vars:
ansible_command_timeout: 300





*verbose output: ansible-playbook -vvv -i hosts site.yaml snippet.*

The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File 
"/tmp/ansible_cli_command_payload_6575kN/ansible_cli_command_payload.zip/ansible/modules/network/cli/cli_command.py"
, line 167, in main
  File 
"/tmp/ansible_cli_command_payload_6575kN/ansible_cli_command_payload.zip/ansible/module_utils/connection.py"
, line 185, in __rpc__
raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), 
code=code)
fatal: [66.220.26.111]: FAILED! => {
"changed": false, 
"invocation": {
"module_args": {
"answer": [
"n"
], 
"check_all": false, 
"command": "install Activate", 
"newline": true, 
"prompt": [
"Press Quit(q) to exit, you may save configuration and 
re-enter the command. [y/n/q]", 
"This operation requires a reload of the system. Do you 
want to proceed? [y/n]"
], 
"sendonly": false
}
}, 
"msg": "command timeout triggered, timeout value is 300 secs.\nSee the 
timeout setting options in the Network Debug and Troubleshooting Guide."
}



How to fix this issue?

Thanks,
Mohan

-- 
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/2790d3b8-f521-46ec-aa54-e043ecc52a86o%40googlegroups.com.


Re: [ansible-project] What does the output from the dynamic inventory software look like?

2020-06-10 Thread Vladimir Botka
> >   - hosts: localhost 
> > tasks: 
> >   - add_host: 
> >   hostname: "{{ remote_host }}" 
> >   groups: my_group_01 
> >   sw: "{{ pkg }}" 
> >
> >   - hosts: my_group_01 
> > tasks: 
> >   - debug: 
> >   msg: Install {{ sw }} on {{ inventory_hostname }} 

On Wed, 10 Jun 2020 03:48:16 -0700 (PDT)
Martin Ward  wrote:

> - hosts: localhost
>   ...
>   tasks:
> - name: Add remote host to new server list
>   add_host:
> name: "{{ remote_host }}"
> groups: server_list
>
> - hosts: server_list
>   become: True
>   roles:
>   - role: common
>   - role: "{{ pkg }}"
> 
> but it fails with "ERROR! 'pkg' is undefined"

In my example the variable "sw" in the "debug" task works because it was
declared in the first play's task "add_host". In your code the variable "pkg"
is in the "hostvars" of localhost only. See "hostvars"
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#caching-facts

-- 
Vladimir Botka

-- 
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/20200610141636.06de7edc%40gmail.com.


pgpUVN9_nJ8wa.pgp
Description: OpenPGP digital signature


Re: [ansible-project] Resizing the Vmware VMDK Through Ansible script

2020-06-10 Thread Tony Wong
Interested in this too.  I got a windows VM with only C drive. I want to
resize from 60GB to 70GB

how do i set up the playbook

On Tue, Jun 9, 2020 at 10:18 PM Abhijeet Kasurde 
wrote:

> What kind of tasks do you need to run on the OS level? You can either use
> `vmware_vm_shell` to run command or add that VM as ansible host using
> `add_host` and run command in subsequent plays.
>
> On Wed, Jun 10, 2020 at 10:44 AM JC JC  wrote:
>
>> HI Abhijeet,
>>
>>
>>
>> Thanks a lot for your script, I need one more help that after VM HDD
>> space increased on VM level, we need to perform some task on OS level to
>> see the additional disk space, do you have any ansible script or any help
>> from you.
>>
>> Cheers
>> Shiva Shankar S
>>
>> On Tue, 9 Jun 2020 at 16:36, Abhijeet Kasurde 
>> wrote:
>>
>>> Hi Shiva,
>>>
>>> You can do like this -
>>>
>>> ---
>>> - hosts: localhost
>>>   gather_facts: false
>>>   vars_files:
>>> - vcenter_vars.yml
>>>   tasks:
>>>   - name: Resize to 10GB from 4GB
>>> vmware_guest_disk:
>>>   validate_certs: False
>>>   hostname: '{{ vcenter_hostname }}'
>>>   username: '{{ vcenter_username }}'
>>>   password: '{{ vcenter_password }}'
>>>   datacenter: Asia-Datacenter1
>>>   name: vm_8046
>>>   disk:
>>> - datastore: "ds_171_2"
>>>   scsi_controller: 0
>>>   scsi_type: 'paravirtual'
>>>   size_gb: 10
>>>   state: present
>>>   unit_number: 0
>>>
>>> TASK [Resize to 10GB from 4GB]
>>> **
>>> task path:
>>> /Volumes/data/src/playbooks/vmware/vmware_guest_disk_resize.yml:7
>>> redirecting (type: modules) ansible.builtin.vmware_guest_disk to
>>> community.vmware.vmware_guest_disk
>>> changed: [localhost] => {"changed": true, "disk_changes": {"0": "Disk
>>> size increased."}, "disk_data": {"0": {"backing_datastore": "ds_171_2",
>>> "backing_disk_mode": "persistent", "backing_eagerlyscrub": false,
>>> "backing_filename": "[ds_171_2] vm_8046/vm_8046.vmdk",
>>> "backing_thinprovisioned": false, "backing_writethrough": false,
>>> "capacity_in_bytes": 10737418240, "capacity_in_kb": 10485760,
>>> "controller_key": 1000, "iolimit_limit": -1, "iolimit_shares_level":
>>> "normal", "iolimit_shares_limit": 1000, "key": 2000, "label": "Hard disk
>>> 1", "shares_level": "normal", "shares_limit": 1000, "summary": "10,485,760
>>> KB", "unit_number": 0}}}
>>>
>>>
>>> If you have multiple disks, you need to gather information about all
>>> disk and pass it to vmware_guest_disk before making any changes.
>>>
>>> You can take the help of this playbook
>>> https://github.com/Akasurde/ansible-reproducers/blob/master/55999/i55999.yml.
>>> (This playbook adds a new disk to configuration, but can be modified to
>>> resize disk as well)
>>>
>>> On Tue, Jun 9, 2020 at 11:48 AM JC JC  wrote:
>>>
 Hi Team,



 I'm looking for ansible script to resize my Existing Virtual machine
 Primary Hard disk (VMDK).



 Cheers

 Shiva Shankar S

 --
 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/43fc8a33-8db1-46bb-8875-ca8333c3caeeo%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/CAFwWkHro90sG79kxBkKsFgG-Bchne0v6q0TnLnEtiOn4_6hGWw%40mail.gmail.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/CANGdo7_U_4sFoY_izPFRwAbWgUEMeYEv8kw4Y8MDo0g%2Bv6-mnw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Thanks,
> Abhijeet Kasurde
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible 

Re: [ansible-project] What does the output from the dynamic inventory software look like?

2020-06-10 Thread Martin Ward
Thanks for the response Vladimir. I had actually found and tried using that 
code, it works fine for a single prompt but not for two, or at least not 
where there second input variable is used in a role name. I was after:

---
- hosts: localhost
  connection: local
  gather_facts: false
  vars_prompt:
  - name: "remote_host"
prompt: "Enter remote IP address"
private: no

  - name: "pkg"
prompt: "Enter package name"
private: no
  tasks:
- name: Add remote host to new server list
  add_host:
name: "{{ remote_host }}"
groups: server_list
   
- hosts: server_list
  become: True
  roles:
  - role: common
  - role: "{{ pkg }}"

but it fails with "ERROR! 'pkg' is undefined"

Still, hopefully this dynamic inventory will give me a better way to 
resolve this problem.

|\/|artin


On Tuesday, 9 June 2020 21:53:38 UTC+1, Vladimir Botka wrote:
>
> On Tue, 9 Jun 2020 13:20:19 -0700 (PDT) 
> Martin Ward > wrote: 
>
> > ... ideally after prompting the user for this information. 
> > ... ask the user for the IP address of the remote server and also the 
> > software they want to install? 
>
> This is an example of the playbook you might be looking for, I think 
>
>   - hosts: localhost 
> gather_facts: false 
>   vars_prompt: 
>   - name: "remote_host" 
> prompt: "Enter FQDN or OP of the remote host" 
> private: no 
>   - name: "pkg" 
> prompt: "Enter name of the package" 
> private: no 
> tasks: 
>   - add_host: 
>   hostname: "{{ remote_host }}" 
>   groups: my_group_01 
>   sw: "{{ pkg }}" 
>
>   - hosts: my_group_01 
> tasks: 
>   - debug: 
>   msg: Install {{ sw }} on {{ inventory_hostname }} 
>
> gives 
>
>   shell> ansible-playbook pb.yml 
>   Enter FQDN or OP of the remote host: test_01 
>   Enter name of the package: apache 
>
>   PLAY [localhost] * 
>
>   TASK [add_host] ** 
>   changed: [localhost] 
>
>   PLAY [my_group_01] *** 
>
>   TASK [Gathering Facts] *** 
>   ok: [test_01] 
>
>   TASK [debug] * 
>   ok: [test_01] => { 
>   "msg": "Install apache on test_01" 
>   } 
>
>   PLAY RECAP *** 
>   localhost: ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 
>   ignored=0 
>   test_01  : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 
>   ignored=0 
>
>
> -- 
> Vladimir Botka 
>

-- 
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/550b3bb9-f234-4673-9fc9-983f58ba9292o%40googlegroups.com.


Re: [ansible-project] What does the output from the dynamic inventory software look like?

2020-06-10 Thread Martin Ward
Thanks Matt, that looks exactly like what I need.

|\/|artin

On Tuesday, 9 June 2020 21:25:29 UTC+1, Matt Martz wrote:
>
> This is largely documented at 
> https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html#developing-inventory-scripts
>
> Additionally there is a JSON schema file describing the JSON data 
> structure for inventory scripts located at 
> https://github.com/ansible/ansible/blob/devel/examples/inventory_script_schema.json
>
> On Tue, Jun 9, 2020 at 3:20 PM Martin Ward > 
> wrote:
>
>> Hi,
>>
>> I am running Ansible 2.9.7 and am looking at the dynamic inventory 
>> scripts. I don't have any of the various software listed (AWS, OpenStack 
>> etc) in the examples section and I need something where I can automatically 
>> set the remote IP address at the time that the playbook is executed, 
>> ideally after prompting the user for this information.
>>
>> I have managed to craft together a simple Python script with hard-coded 
>> data (for test purposes) but I cannot fathom the output, other than it 
>> should be in JSON format. Nor can I find this documented anywhere.
>>
>> Does anyone have any ideas, suggestions or pointers?
>>
>> Failing that, can you suggest a way to do what I want, ask the user for 
>> the IP address of the remote server and also the software they want to 
>> install? (Yeah I know, two questions instead of one:-) )
>>
>> -- 
>> 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/81ec84c8-e333-4605-a793-6c54a40b5259o%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Matt Martz
> @sivel
> sivel.net
>

-- 
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/a40ab30d-fd4a-4c9f-8b23-8fb4a82bo%40googlegroups.com.


[ansible-project] Re: Ansible Tower - user awx permission

2020-06-10 Thread mcubes cloud
Ah 

Ansible and Tower are different hehe, Okay will close the query.

This group very much useful LOL :D

On Tuesday, 9 June 2020 21:11:32 UTC+5:30, mcubes cloud wrote:
>
> Hi team,
>
> I have created a ansible-tower and calling a job in local host and facing 
> awx user permission issues and showing error as below,
>
> {
> "msg": "privilege output closed while waiting for password 
> prompt:\nsudo: effective uid is not 0, is /usr/bin/sudo on a file system 
> with the 'nosuid' option set or an NFS file system without root 
> privileges?\n",
> "_ansible_no_log": false
> }
>
> Pls help on this,
>
> (Note. The same job is running smoothly under root)
>
>

-- 
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/5a2af5f1-9035-4dd8-a420-bac4cf959191o%40googlegroups.com.


Re: [ansible-project] Re: Ansible Tower - user awx permission

2020-06-10 Thread Stefan Hornburg (Racke)
On 6/10/20 8:58 AM, mcubes cloud wrote:
> Anybody to help here ?
> 

Please note that this group is only about Ansible, not Tower or AWX.

For the former contact RedHat support.

Regards
   Racke

> On Tuesday, 9 June 2020 21:11:32 UTC+5:30, mcubes cloud wrote:
> 
> Hi team,
> 
> I have created a ansible-tower and calling a job in local host and facing 
> awx user permission issues and showing
> error as below,
> 
> {
>     "msg": "privilege output closed while waiting for password 
> prompt:\nsudo: effective uid is not 0, is
> /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS 
> file system without root privileges?\n",
>     "_ansible_no_log": false
> }
> 
> Pls help on this,
> 
> (Note. The same job is running smoothly under root)
> 
> -- 
> 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/8ce44abe-7b7f-49da-8cbd-e581dda153abo%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/2f19ffc4-58f4-23ed-20d5-69555b39ace9%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


[ansible-project] Re: Ansible Tower - user awx permission

2020-06-10 Thread mcubes cloud
Anybody to help here ?

On Tuesday, 9 June 2020 21:11:32 UTC+5:30, mcubes cloud wrote:
>
> Hi team,
>
> I have created a ansible-tower and calling a job in local host and facing 
> awx user permission issues and showing error as below,
>
> {
> "msg": "privilege output closed while waiting for password 
> prompt:\nsudo: effective uid is not 0, is /usr/bin/sudo on a file system 
> with the 'nosuid' option set or an NFS file system without root 
> privileges?\n",
> "_ansible_no_log": false
> }
>
> Pls help on this,
>
> (Note. The same job is running smoothly under root)
>
>

-- 
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/8ce44abe-7b7f-49da-8cbd-e581dda153abo%40googlegroups.com.


[ansible-project] Re: how to pass same variable value multiple times in a list

2020-06-10 Thread Diyawary
Could  any one please help on it. is there any way how to use same items 
multiple times in a list .  Appreciate your help.

On Tuesday, 9 June 2020 15:29:46 UTC+5:30, Diyawary wrote:
>
> Hi Team,
>
> I am using with_togather so i have two list one is mserver and other is 
> domain, problem is i want to pass same mserver two times in the list ,but 
> it is giving error and using only last defined value.
>
> My requirement is for mserver list this can be same mserver or sometimes 
> different mservers - name: Login to Checkpoint Management Server
>   uri:
> url: "https://{{item.0}}/web_api/login;
> validate_certs: False
> method: POST
> body:
>   user: "{{ mserver_username }}"
>   password: "{{ mserver_password }}"
>   domain: "{{item.1}}"
> body_format: json
>   register: login
>   failed_when: False
>   when: item.0 != "" and item.1 != ""
> mserver: {10,10,10,10, 10.10.10.10, 20.20.20.20}
> doamin:{9.9.9.9,8.8.8.8,7.7.7.7}
>  and i want execute like when mserver 10.10.10.10 then domain is 9.9.9.9
>  and again mserver is 10.10.10.10 and domain is 8.8.8.8 so on.  and this 
> two list mserver and domain I will get dynamically.
> my playboolk
>  tasks:
> - include_role:
> name: validateip
>   when: object_type == "ip"
>   with_together:
>- "{{ mserver }}"
>- "{{ domain }}"
>
>  and in this role there are multiple tasks like login ,validation and 
> logout I am performing 
> for ex login playbook
>  - name: Login to Checkpoint Management Server
>   uri:
> url: "https://{{item.0}}/web_api/login;
> validate_certs: False
> method: POST
> body:
>   user: "{{username }}"
>   password: "{{ password }}"
>   domain: "{{item.1}}"
> body_format: json
>   register: login
>   failed_when: False
>   when: item.0 != "" and item.1 != ""
>
> please help how to pass same values in 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/d134777b-4c02-4208-8fb3-183a1fa94736o%40googlegroups.com.