[ansible-project] Ansible and Active Directory DNS updates

2018-05-17 Thread ADB101
Hi

We're using MS Active Directory to provide DNS resolution. I need to be 
able to add DNS entries to Active Directory but, not being a MS-techie, I'm 
not sure about the technicalities of doing so...The nsupdate 
 module seems to 
do what I need but does anyone know of a "best practice" document or guide 
to implementing the module against MS AD? I am basically trying to get as 
much information as possible before tackling the MS Consultant about using 
Ansible to update his precious AD-DNS (he's not keen!!)

Many thanks,
Aidan

-- 
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/78caeecf-8308-4bb5-add6-5efc20ccdc48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Infoblox - nios_host_record issue

2018-05-04 Thread ADB101
OK,

Looks likes the way that InfoBlox as been setup and I need to add a "fixed 
address" rather than a host record.

Aidan

On Friday, May 4, 2018 at 10:57:44 AM UTC+1, ADB101 wrote:
>
> Hi all,
>
> I need to get IPs from an Infoblox server from an Ansible playbook. I am 
> successfully obtaining  the next IP address by using the nios_next_ip 
> lookup within the correct IP range. I am then using the "nios_host_record" 
> task to attempt to assign that IP in Infoblox. (Using Ansible 2.5.2)
>
>  - name: Get next available IP
> set_fact:
>  ipaddr: "{{ lookup('nios_next_ip', IPAM_RANGE, provider={'host': 
> 'ipam.mydomain', 'username': 'tower', 'password': 
> ss2_result.TOWER_IPAM|quote }) }}"
> connection: local
>
>   - debug: msg="{{ipaddr[0]}}"
>
>   - name: configure an ipv4 host record
> nios_host_record:
>   name: aidantest.mydomain
>   ipv4:
> - address: "{{ipaddr[0]}}"
>   state: present
>   provider:
> host: "ipam.mydomain"
> username: tower
> password: "{{ss2_result.TOWER_IPAM}}"
> connection: local
>
>
> However, all I am getting back from the task is: 
>
> "Client.Obap.Data.Conflict", "msg": "The action is not allowed. A parent 
> was not found.", "operation": "create_object", "type": "AdmConDataError"
>
> The slight complication is that the Infobox is only used to hold a range 
> of IPs and keep a record of what is allocated, it does not deal with DNS 
> etc (that's in Active Directory). I'm not sure if that has anything to do 
> with the error, but thought best to mention it!
>
> Has anyone got any ideas as to what I am doing wrong? I think I would have 
> to specify the IP range in the nios_host_record call (like I do in the 
> lookup) but I can't see a way..?
>
> Any assistance very much appreciated!
>
> Aidan
>

-- 
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/1fee59b5-cb62-424a-8b09-456c54ad99e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Infoblox - nios_host_record issue

2018-05-04 Thread ADB101
Hi all,

I need to get IPs from an Infoblox server from an Ansible playbook. I am 
successfully obtaining  the next IP address by using the nios_next_ip 
lookup within the correct IP range. I am then using the "nios_host_record" 
task to attempt to assign that IP in Infoblox. (Using Ansible 2.5.2)

 - name: Get next available IP
set_fact:
 ipaddr: "{{ lookup('nios_next_ip', IPAM_RANGE, provider={'host': 
'ipam.mydomain', 'username': 'tower', 'password': 
ss2_result.TOWER_IPAM|quote }) }}"
connection: local

  - debug: msg="{{ipaddr[0]}}"

  - name: configure an ipv4 host record
nios_host_record:
  name: aidantest.mydomain
  ipv4:
- address: "{{ipaddr[0]}}"
  state: present
  provider:
host: "ipam.mydomain"
username: tower
password: "{{ss2_result.TOWER_IPAM}}"
connection: local


However, all I am getting back from the task is: 

"Client.Obap.Data.Conflict", "msg": "The action is not allowed. A parent 
was not found.", "operation": "create_object", "type": "AdmConDataError"

The slight complication is that the Infobox is only used to hold a range of 
IPs and keep a record of what is allocated, it does not deal with DNS etc 
(that's in Active Directory). I'm not sure if that has anything to do with 
the error, but thought best to mention it!

Has anyone got any ideas as to what I am doing wrong? I think I would have 
to specify the IP range in the nios_host_record call (like I do in the 
lookup) but I can't see a way..?

Any assistance very much appreciated!

Aidan

-- 
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/113f774e-75b1-4d35-81a8-cf180003b07f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] XML module xpath issues - "does not reference a node" error

2018-02-19 Thread ADB101
Hi All.

I am having issues getting the "xml" module to accept what I believe to be 
valid xpaths, it just returns "does not reference a node". I have used an 
online xpath checker (https://www.freeformatter.com/xpath-tester.html) 
which, when I use the target xml file, gives me the correct data. The xml 
file is from an Oracle middleware product so I can't template it and I have 
to make the config changes directly in the xml file.

I can get some xpath's to work correctly, but only in "simple" (?) forms. 
For example:

- name: Check current value
  xml:
file: "{{oam_xml_file}}"
xpath: 
/x:Configuration/Setting[@Name='NGAMConfiguration']/Setting[@Name='DeployedComponent']/Setting[@Name='Agent']/Setting[@Name='WebGate']/Setting[@Name='Instance']/Setting[@Name='APPS_OAM11G']/Setting[@Name='UserDefinedParameters']/Setting[@Name='client_request_retry_attempts']/*
content: text
namespaces:
   x: http://www.w3.org/2001/XMLSchema

fails with "does not reference a node" (but works fine when checked using 
the online xpath checker) but:

- name: Check current value
  xml:
file: "{{oam_xml_file}}"
xpath: //x:Setting[@Name='client_request_retry_attempts']/*
content: text
namespaces:
   x: http://www.w3.org/2001/XMLSchema

returns the value I am expecting. (Note: I could only get the short version 
working by adding the "namespaces" option).

The issue is that I really need the full xpath to work as there are often 
several entries with the same "Name='*tag*'" that are only distinguishable 
by their full path. I have tried even going one level down in the xml, 
using a full path, and I still get "does not reference a node" error 
message.

The original xml is a bit of a beast so I have put a copy here 
rather 
than paste it in.

I'm running Ansible 2.2.1 so I'm using a version of the "xml" module before 
it was bundled with Ansible 2.4. For various reasons I have to stick with 
using version 2.2.1 for the time being so I was hoping someone could either 
inform me how to make full path xpaths work (or tell me that I'm out of 
luck and have to wait until we can upgrade to Ansible 2.4!)

Many thanks,
Aidan

-- 
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/dbe6e627-390e-483f-8ec5-21263e35d963%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.