Compare commits
No commits in common. "master" and "docs" have entirely different histories.
102
.drone.jsonnet
102
.drone.jsonnet
|
@ -1,102 +0,0 @@
|
|||
local PipelineLinting = {
|
||||
kind: 'pipeline',
|
||||
name: 'linting',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'ansible-later',
|
||||
image: 'thegeeklab/ansible-later',
|
||||
commands: [
|
||||
'ansible-later',
|
||||
],
|
||||
},
|
||||
],
|
||||
trigger: {
|
||||
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineDocumentation = {
|
||||
kind: 'pipeline',
|
||||
name: 'documentation',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'generate',
|
||||
image: 'thegeeklab/ansible-doctor',
|
||||
environment: {
|
||||
ANSIBLE_DOCTOR_LOG_LEVEL: 'INFO',
|
||||
ANSIBLE_DOCTOR_FORCE_OVERWRITE: true,
|
||||
ANSIBLE_DOCTOR_EXCLUDE_FILES: 'molecule/',
|
||||
ANSIBLE_DOCTOR_TEMPLATE: 'hugo-book',
|
||||
ANSIBLE_DOCTOR_ROLE_NAME: '${DRONE_REPO_NAME#*.}',
|
||||
ANSIBLE_DOCTOR_OUTPUT_DIR: '_docs/',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'publish',
|
||||
image: 'plugins/gh-pages',
|
||||
settings: {
|
||||
remote_url: 'https://gitea.rknet.org/ansible/${DRONE_REPO_NAME}',
|
||||
netrc_machine: 'gitea.rknet.org',
|
||||
username: { from_secret: 'gitea_username' },
|
||||
password: { from_secret: 'gitea_token' },
|
||||
pages_directory: '_docs/',
|
||||
target_branch: 'docs',
|
||||
},
|
||||
when: {
|
||||
ref: ['refs/heads/master'],
|
||||
},
|
||||
},
|
||||
],
|
||||
trigger: {
|
||||
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
|
||||
},
|
||||
depends_on: [
|
||||
'linting',
|
||||
],
|
||||
};
|
||||
|
||||
local PipelineNotification = {
|
||||
kind: 'pipeline',
|
||||
name: 'notification',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
clone: {
|
||||
disable: true,
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'matrix',
|
||||
image: 'plugins/matrix',
|
||||
settings: {
|
||||
homeserver: { from_secret: 'matrix_homeserver' },
|
||||
roomid: { from_secret: 'matrix_roomid' },
|
||||
template: 'Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}',
|
||||
username: { from_secret: 'matrix_username' },
|
||||
password: { from_secret: 'matrix_password' },
|
||||
},
|
||||
},
|
||||
],
|
||||
depends_on: [
|
||||
'documentation',
|
||||
],
|
||||
trigger: {
|
||||
status: ['success', 'failure'],
|
||||
ref: ['refs/heads/master', 'refs/tags/**'],
|
||||
},
|
||||
};
|
||||
|
||||
[
|
||||
PipelineLinting,
|
||||
PipelineDocumentation,
|
||||
PipelineNotification,
|
||||
]
|
104
.drone.yml
104
.drone.yml
|
@ -1,104 +0,0 @@
|
|||
---
|
||||
kind: pipeline
|
||||
name: linting
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: ansible-later
|
||||
image: thegeeklab/ansible-later
|
||||
commands:
|
||||
- ansible-later
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
- refs/tags/**
|
||||
- refs/pull/**
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: documentation
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: generate
|
||||
image: thegeeklab/ansible-doctor
|
||||
environment:
|
||||
ANSIBLE_DOCTOR_EXCLUDE_FILES: molecule/
|
||||
ANSIBLE_DOCTOR_FORCE_OVERWRITE: true
|
||||
ANSIBLE_DOCTOR_LOG_LEVEL: INFO
|
||||
ANSIBLE_DOCTOR_OUTPUT_DIR: _docs/
|
||||
ANSIBLE_DOCTOR_ROLE_NAME: ${DRONE_REPO_NAME#*.}
|
||||
ANSIBLE_DOCTOR_TEMPLATE: hugo-book
|
||||
|
||||
- name: publish
|
||||
image: plugins/gh-pages
|
||||
settings:
|
||||
netrc_machine: gitea.rknet.org
|
||||
pages_directory: _docs/
|
||||
password:
|
||||
from_secret: gitea_token
|
||||
remote_url: https://gitea.rknet.org/ansible/${DRONE_REPO_NAME}
|
||||
target_branch: docs
|
||||
username:
|
||||
from_secret: gitea_username
|
||||
when:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
- refs/tags/**
|
||||
- refs/pull/**
|
||||
|
||||
depends_on:
|
||||
- linting
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: notification
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: matrix
|
||||
image: plugins/matrix
|
||||
settings:
|
||||
homeserver:
|
||||
from_secret: matrix_homeserver
|
||||
password:
|
||||
from_secret: matrix_password
|
||||
roomid:
|
||||
from_secret: matrix_roomid
|
||||
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
|
||||
username:
|
||||
from_secret: matrix_username
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
- refs/tags/**
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- documentation
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: 7ff03d583c76c3f233659b8559acae73e1af58967396745f0856b9b15aba8eca
|
||||
|
||||
...
|
|
@ -1,11 +0,0 @@
|
|||
# ---> Ansible
|
||||
*.retry
|
||||
plugins
|
||||
library
|
||||
|
||||
# ---> Python
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
21
.later.yml
21
.later.yml
|
@ -1,21 +0,0 @@
|
|||
---
|
||||
ansible:
|
||||
custom_modules:
|
||||
- iptables_raw
|
||||
- openssl_pkcs12
|
||||
- proxmox_kvm
|
||||
- ucr
|
||||
- corenetworks_dns
|
||||
- corenetworks_token
|
||||
- corenetworks_dns
|
||||
- corenetworks_token
|
||||
|
||||
rules:
|
||||
exclude_files:
|
||||
- molecule/
|
||||
- "LICENSE*"
|
||||
- "**/*.md"
|
||||
- "**/*.ini"
|
||||
|
||||
exclude_filter:
|
||||
- LINT0009
|
21
LICENSE
21
LICENSE
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 Robert Kaussow <mail@thegeeklab.de>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
10
README.md
10
README.md
|
@ -1,10 +0,0 @@
|
|||
# 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)](LICENSE)
|
||||
|
||||
You can find the full documentation at [https://galaxy.geekdocs.de](https://galaxy.geekdocs.de/roles/cloud/corenetworks_dns/).
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@ -1,35 +0,0 @@
|
|||
---
|
||||
# @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 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
|
||||
# if no zone is given for an individual record.
|
||||
# @end
|
||||
# @var corenetworks_dns_default_zone: $ "_unset_"
|
||||
|
||||
corenetworks_dns_token_run_once: False
|
||||
|
||||
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:
|
||||
# - record: test
|
||||
# type: A
|
||||
# value: 127.0.0.1
|
||||
# zone: example.com
|
||||
# solo: no
|
||||
# state: present
|
||||
# @end
|
||||
corenetworks_dns_records: []
|
||||
corenetworks_dns_records_extra: []
|
|
@ -0,0 +1,117 @@
|
|||
---
|
||||
title: corenetworks_dns
|
||||
type: docs
|
||||
---
|
||||
|
||||
[![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)
|
||||
|
||||
Manage DNS records on core networks
|
||||
|
||||
* [Default Variables](#default-variables)
|
||||
* [corenetworks_dns_api_password](#corenetworks_dns_api_password)
|
||||
* [corenetworks_dns_api_user](#corenetworks_dns_api_user)
|
||||
* [corenetworks_dns_default_zone](#corenetworks_dns_default_zone)
|
||||
* [corenetworks_dns_delegate_to](#corenetworks_dns_delegate_to)
|
||||
* [corenetworks_dns_pip](#corenetworks_dns_pip)
|
||||
* [corenetworks_dns_python_packages](#corenetworks_dns_python_packages)
|
||||
* [corenetworks_dns_records](#corenetworks_dns_records)
|
||||
* [corenetworks_dns_records_extra](#corenetworks_dns_records_extra)
|
||||
* [corenetworks_dns_token_run_once](#corenetworks_dns_token_run_once)
|
||||
* [Dependencies](#dependencies)
|
||||
|
||||
---
|
||||
|
||||
## Default Variables
|
||||
|
||||
### corenetworks_dns_api_password
|
||||
|
||||
Account API password.
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_api_password: _unset_
|
||||
```
|
||||
|
||||
### corenetworks_dns_api_user
|
||||
|
||||
Account API username. If omitted, the environment variables `CN_API_USER` and `CN_API_PASSWORD` will be used.
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_api_user: _unset_
|
||||
```
|
||||
|
||||
### corenetworks_dns_default_zone
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_default_zone: _unset_
|
||||
```
|
||||
|
||||
#### Example usage
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_records:
|
||||
- record: test
|
||||
type: A
|
||||
value: 127.0.0.1
|
||||
zone: example.com
|
||||
solo: no
|
||||
state: present
|
||||
```
|
||||
|
||||
### corenetworks_dns_delegate_to
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_delegate_to: localhost
|
||||
```
|
||||
|
||||
### corenetworks_dns_pip
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_pip: pip{{ ansible_python.version.major }}
|
||||
```
|
||||
|
||||
### corenetworks_dns_python_packages
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_python_packages:
|
||||
- corenetworks
|
||||
```
|
||||
|
||||
### corenetworks_dns_records
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_records: []
|
||||
```
|
||||
|
||||
### corenetworks_dns_records_extra
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_records_extra: []
|
||||
```
|
||||
|
||||
### corenetworks_dns_token_run_once
|
||||
|
||||
#### Default value
|
||||
|
||||
```YAML
|
||||
corenetworks_dns_token_run_once: false
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
None.
|
|
@ -1,24 +0,0 @@
|
|||
# Standards: 0.2
|
||||
---
|
||||
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)
|
||||
#
|
||||
# Manage DNS records on core networks
|
||||
# @end
|
||||
description: Manage DNS records on core networks
|
||||
license: MIT
|
||||
min_ansible_version: 2.10
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
galaxy_tags:
|
||||
dependencies: []
|
||||
collections:
|
||||
- xoxys.general
|
||||
- community.general
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
- include_tasks: setup.yml
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
- 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) }}"
|
||||
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_control:
|
||||
label: "{{ item.zone | default(corenetworks_dns_default_zone) }}:{{ item.record | default('@') }}"
|
||||
delegate_to: "{{ corenetworks_dns_delegate_to }}"
|
Reference in New Issue