On 21. nov. 2016 19:14, 'Jeffrey Wen' via Ansible Project wrote:
> localhost | SUCCESS => {
>     "ansible_facts": {
>         "ansible_dns": {
>             "nameservers": [
>                 "192.168.1.1", 
>                 "192.168.1.2"
>             ], 
>             "search": [
>                 "example.com", 
>             ]
>         }
>     }, 
>     "changed": false
> }
> 
> *I am trying to reference my nameservers but I am running into syntactical 
> issues. I cannot find any docs online that show me how to access a list 
> from gathering facts.*
> 
> I have tried the following:
> 
> - name: Allow httpd access to files on CIFS volumes that are labeled with 
> the cifs_t type
>   seboolean: name=httpd_use_cifs state=true persistent=yes
>   when: ansible_dns == nameservers == '192.168.1.1' and ansible_dns == 
> nameservers == '192.168.1.2'
> 
> - name: Allow httpd access to files on CIFS volumes that are labeled with 
> the cifs_t type
>   seboolean: name=httpd_use_cifs state=true persistent=yes
>   when: nameservers == '192.168.1.1' and nameservers == '192.168.1.2'

when: '192.168.1.1' in ansible_dns.nameservers and '192.168.1.2' in
ansible_dns.nameservers

-- 
Kai Stian Olstad

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7a00721b-570e-62ef-b5a4-d06d61a56d66%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to