initial commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2021-02-25 21:14:35 +01:00
parent 1cdfda937a
commit 0394f8bc82
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
6 changed files with 24 additions and 59 deletions

View File

@ -99,6 +99,6 @@ depends_on:
---
kind: signature
hmac: 7ff03d583c76c3f233659b8559acae73e1af58967396745f0856b9b15aba8eca
hmac: 9c947267b3a6b825833fc68f1f32723e43d1b75e19950f9ad9a8255a87d4a878
...

View File

@ -5,10 +5,6 @@ ansible:
- openssl_pkcs12
- proxmox_kvm
- ucr
- corenetworks_dns
- corenetworks_token
- corenetworks_dns
- corenetworks_token
rules:
exclude_files:

View File

@ -1,9 +1,9 @@
# xoxys.corenetworks_dns
# xoxys.cloudflare_dns
[![Build Status](https://img.shields.io/drone/build/ansible/xoxys.corenetworks_dns?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.corenetworks_dns)
[![Build Status](https://img.shields.io/drone/build/ansible/xoxys.cloudflare_dns?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.cloudflare_dns)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](LICENSE)
You can find the full documentation at [https://galaxy.geekdocs.de](https://galaxy.geekdocs.de/roles/cloud/corenetworks_dns/).
Manage DNS records on cloudflare. You can find the full documentation at [https://galaxy.geekdocs.de](https://galaxy.geekdocs.de/roles/cloud/cloudflare_dns/).
## License

View File

@ -1,29 +1,16 @@
---
# @var corenetworks_dns_api_user:description: >
# Account API username. If omitted, the environment variables `CN_API_USER` and `CN_API_PASSWORD`
# will be used.
# @end
# @var corenetworks_dns_api_user: $ "_unset_"
# @var cloudflare_dns_api_token:description: Account API password.
# @var cloudflare_dns_api_token: $ "_unset_"
# @var corenetworks_dns_api_password:description: Account API password.
# @var corenetworks_dns_api_password: $ "_unset_"
# @var corenetworks_dns_default_zone: Define a default DNS zone to use
# @var cloudflare_dns_default_zone: Define a default DNS zone to use
# if no zone is given for an individual record.
# @end
# @var corenetworks_dns_default_zone: $ "_unset_"
# @var cloudflare_dns_default_zone: $ "_unset_"
corenetworks_dns_token_run_once: False
cloudflare_dns_delegate_to: localhost
corenetworks_dns_pip: "pip{{ ansible_python.version.major }}"
corenetworks_dns_delegate_to: localhost
corenetworks_dns_python_packages:
- corenetworks
# @var corenetworks_dns_default_zone:example: >
# corenetworks_dns_records:
# @var cloudflare_dns_records:example: >
# cloudflare_dns_records:
# - record: test
# type: A
# value: 127.0.0.1
@ -31,5 +18,5 @@ corenetworks_dns_python_packages:
# solo: no
# state: present
# @end
corenetworks_dns_records: []
corenetworks_dns_records_extra: []
cloudflare_dns_records: []
cloudflare_dns_records_extra: []

View File

@ -4,13 +4,13 @@ galaxy_info:
# @meta author:value: [Robert Kaussow](https://gitea.rknet.org/xoxys)
author: "Robert Kaussow <mail@thegeeklab.de>"
# @meta description: >
# [![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.corenetworks_dns)
# [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.corenetworks_dns?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.corenetworks_dns)
# [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.corenetworks_dns/src/branch/master/LICENSE)
# [![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.cloudflare_dns)
# [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.cloudflare_dns?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.cloudflare_dns)
# [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.cloudflare_dns/src/branch/master/LICENSE)
#
# Manage DNS records on core networks
# Manage DNS records on cloudflare.
# @end
description: Manage DNS records on core networks
description: Manage DNS records on cloudflare
license: MIT
min_ansible_version: 2.8
platforms:

View File

@ -1,32 +1,14 @@
---
- name: Install dependencies
pip:
name: "{{ item }}"
executable: "{{ corenetworks_dns_pip }}"
extra_args: --user
state: present
loop: "{{ corenetworks_dns_python_packages }}"
delegate_to: "{{ corenetworks_dns_delegate_to }}"
- name: Obtain an API token
corenetworks_token:
api_user: "{{ corenetworks_dns_api_user | default(omit) }}"
api_password: "{{ corenetworks_dns_api_password | default(omit) }}"
register: __corenetworks
when: corenetworks_dns_token is not defined
delegate_to: "{{ corenetworks_dns_delegate_to }}"
run_once: "{{ corenetworks_dns_token_run_once }}"
- name: Create DNS records
corenetworks_dns:
api_token: "{{ corenetworks_dns_token if corenetworks_dns_token is defined else __corenetworks.session.token }}"
zone: "{{ item.zone | default(corenetworks_dns_default_zone) }}"
cloudflare_dns:
api_token: "{{ cloudflare_dns_api_token }}"
zone: "{{ item.zone | default(cloudflare_dns_default_zone) }}"
record: "{{ item.record | default(omit) }}"
type: "{{ item.type | default(omit) }}"
solo: "{{ item.solo | default(omit) }}"
value: "{{ item.value | default(omit) }}"
state: "{{ item.state | default('present') }}"
loop: "{{ corenetworks_dns_records + corenetworks_dns_records_extra }}"
loop: "{{ cloudflare_dns_records + cloudflare_dns_records_extra }}"
loop_control:
label: "{{ item.zone | default(corenetworks_dns_default_zone) }}:{{ item.record | default('@') }}"
delegate_to: "{{ corenetworks_dns_delegate_to }}"
label: "{{ item.zone | default(cloudflare_dns_default_zone) }}:{{ item.record | default('@') }}"
delegate_to: "{{ cloudflare_dns_delegate_to }}"