acoston / Ansible-EfficientIP

Ansible module to use with EfficientIP SolidServer
BSD 2-Clause "Simplified" License
15 stars 10 forks source link

Add dns type a #5

Open silver9195 opened 4 years ago

silver9195 commented 4 years ago

Hello, first of all thanks for all you great job, I can create an alias cname easy !

I would like to know if you can add the option to add a dns rr a type ?

I try to modified your python script but i didn't succes.

gregocgt commented 4 years ago

Hello,

Thank you for your reply.

Do you use the last version of the library? You can find it in GitLab: https://gitlab.com/efficientip We have grouped together all EfficientIP depots.

Especially in: https://gitlab.com/efficientip/solidserverrest/

I don't know if you use "SOLIDserver_API-Reference_REST-7.2.pdf" documentation.

In Chapter 34. DNS Resource Record, you find all information to add type in the DNS RR.

You can find documentation in your support portal.

Regards

Le mar. 8 sept. 2020 à 12:44, silver9195 notifications@github.com a écrit :

Hello, first of all thanks for all you great job, I can create an alias cname easy !

I would like to know if you can add the option to add a dns rr a type ?

I try to modified your python script but i didn't succes.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/acoston/Ansible-EfficientIP/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG43EOOK5DDA3VURDWHUXUDSEYDHXANCNFSM4Q7Z4GTA .

-- Grégory CUGAT Ingénieur et Photoreporter gregory.cugatii@gmail.com +33 6 86 72 34 99

Let's help preserve our environment, thank you for printing this message only if necessary. Aidons à préserver notre environnement, merci de n'imprimer ce message que si nécessaire.

silver9195 commented 4 years ago

Merci pour votre réponse,

Oui j'utilise bien la dernière version de la librairie, implémentée il y a seulement quelques jours.

Nous avons solidserver en version 5.0.4 (oui c'est vieux mais nous avons beaucoup de développement interne qui sont critiques) Et nous avons donc la documentation API qui va avec la version.

Mais je ne vous cache pas que la compréhension de celle ci est quelque peu ardu .

Voici la partie du dns record dans notre documentation, je ne vois pas comment la retranscrire dans votre module en python :

Name
dns_rr_add — Add/Edit a resource record
Description
The service dns_rr_add allows to add new entries to the database or to update it.
If the identifier of the object is not specified, a new entry is created. If an existing identifier is
specified, the corresponding entry configuration is edited with all the parameters specified in input.
To remove a parameter, set it to null.
To execute this service, users must be granted the permission to use it. The rows returned to
the user running the service depend on the resources granted to the group they belong to
Input Parameters
rr_id
RR ID (for replacement).
dns_id
The dns_id parameter is the DNS identifier (ID) used to join foreign data. This identifier is a
unique numeric key value that is automatically incremented.
hostaddr
The DNS server IP address.
dns_name
The DNS server name.
dnszone_id
The zone identifier (ID). This identifier is a unique numeric key value that is automatically
incremented.
zone
DNS zone name (Obsolete. Has been replaced by dnszone_name).
dnszone_name
DNS zone name.
dnsview_id
The dnsview_id parameter is the DNS view identifier (ID). This identifier is a unique numeric
key value that is automatically incremented.
dnsview_name
The DNS view name.
serial_type
SOA serial type.
rr_name
The rr_name specifies the domain name that must deleted. The fully qualified domain name
must be used for this parameter.
rr_ttl
RR TTL.
rr_type
RR type.
rr_value1
RR value 1.
605
Resource Record
rr_value2
RR value 2.
rr_value3
RR value 3.
rr_value4
RR value 4.
rr_value5
RR value 5.
rr_value6
RR value 6.
rr_value7
RR value 7.
dnszone_site_id
The dnszone_site_id parameter is the DNS zone space identifier (ID) used to join foreign
data. This identifier is a unique numeric key value that is automatically incremented.
no_rule_exec
Defines if rules are executed after the service is called. If its value is set to 1, no rules are
executed after the service. The default value is 0.
force_update
Force DNS update.
check
Run check-rules.
add_flag
Allows to flag the creation type. The flag can be either new_only, edit_only or new_edit.
check_value
check on value flag.
Output Parameters
errno
Status returned by the service after its execution. If the operation is successful, it returns 0.
If the operation fails, it returns other numbers detailed in the appendix Return code.
Example
Creating an A record and a CNAME record using a BASH script.
#!/bin/sh
# $1 = rr_name, $2 = rr_type, $3 = rr_value $4 = add / delete
user=ipmadmin
password=admin
dns_rr() {
curl -s -H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: \"urn:dns_rr_${4}\"" \
-d "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\\
"urn:IPM_SOAP\">
<soapenv:Header/>
<soapenv:Body>
<urn:dns_rr_${4} soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">
<input xsi:type=\"urn:dns_rr_${4}_in\" xmlns:urn=\"urn:IPM\">
606
Resource Record
<auth_login xsi:type=\"xsd:string\">${user}</auth_login>
<auth_password xsi:type=\"xsd:string\">${password}</auth_password>
<dns_name xsi:type=\"xsd:string\">smart.test</dns_name>
<rr_name xsi:type=\"xsd:string\">${1}</rr_name>
<rr_type xsi:type=\"xsd:string\">${2}</rr_type>
<rr_value1 xsi:type=\"xsd:string\">${3}</rr_value1>
<dnszone_site_id xsi:type=\"xsd:string\">8</dnszone_site_id>
<force_update xsi:type=\"xsd:string\">1</force_update>
</input>
</urn:dns_rr_${4}>
</soapenv:Body>
</soapenv:Envelope>" \
--insecure -X POST https://10.0.249.64/interfaces/ws.php
}
dns_rr ${1} A 161.88.243.124 add
dns_rr www.${1} CNAME ${1} add