snowdrop / k8s-infra

Information to bootstrap vms using dedicated server, local machine and setup using Ansible Playbooks
Apache License 2.0
29 stars 14 forks source link

Implement playbook/roles that manages GoDaddy DNS records #315

Open jacobdotcosta opened 1 year ago

jacobdotcosta commented 1 year ago

TODO

Subsequent additional tasks

cmoulliard commented 1 year ago

As the API of Godaddy is not too complex - see doc, we could also using curl or similar tool to create/delete/get a DNS record

YOUR_IP_ADDRESS=10.0.215.34
YOUR_DOMAIN_NAME="snowdrop.dev"
YOUR_NAME="console2-openshift-console.apps.ocp"
TYPE="A"

payload="
[{
 \"data\": \"$YOUR_IP_ADDRESS\",
 \"ttl\": 600
}]"

curl -X DELETE -H "Authorization: sso-key ${YOUR_API_KEY}:${YOUR_API_SECRET}" \
     -H "Content-Type: application/json" \
     "https://api.godaddy.com/v1/domains/${YOUR_DOMAIN_NAME}/records/${TYPE}/${YOUR_NAME}"

curl -X PUT -H "Authorization: sso-key ${YOUR_API_KEY}:${YOUR_API_SECRET}" \
     -H "Content-Type: application/json" \
     -d "$payload" \
     "https://api.godaddy.com/v1/domains/${YOUR_DOMAIN_NAME}/records/${TYPE}/${YOUR_NAME}"

curl -X GET -H "Authorization: sso-key ${YOUR_API_KEY}:${YOUR_API_SECRET}" \
     -H "Content-Type: application/json" \
     "https://api.godaddy.com/v1/domains/${YOUR_DOMAIN_NAME}/records/${TYPE}/${YOUR_NAME}"