mirror of
https://github.com/roles-ansible/ansible_role_unbound.git
synced 2024-08-16 13:39:49 +02:00
use new ansible name scheme
This commit is contained in:
parent
8ce3f04925
commit
27c337a93f
8 changed files with 62 additions and 24 deletions
8
.github/workflows/ansible-debian-stable.yml
vendored
8
.github/workflows/ansible-debian-stable.yml
vendored
|
@ -2,7 +2,13 @@
|
||||||
name: Ansible check debian:stable
|
name: Ansible check debian:stable
|
||||||
|
|
||||||
# yamllint disable-line rule:truthy
|
# yamllint disable-line rule:truthy
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches: '*'
|
||||||
|
pull_request:
|
||||||
|
branches: '*'
|
||||||
|
schedule:
|
||||||
|
- cron: '23 6 * */1 *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
8
.github/workflows/ansible-linting-check.yml
vendored
8
.github/workflows/ansible-linting-check.yml
vendored
|
@ -2,7 +2,13 @@
|
||||||
name: Ansible Lint check
|
name: Ansible Lint check
|
||||||
|
|
||||||
# yamllint disable-line rule:truthy
|
# yamllint disable-line rule:truthy
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches: '*'
|
||||||
|
pull_request:
|
||||||
|
branches: '*'
|
||||||
|
schedule:
|
||||||
|
- cron: '42 6 * */1 *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
20
.github/workflows/galaxy.yml
vendored
Normal file
20
.github/workflows/galaxy.yml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
name: Galaxy release
|
||||||
|
|
||||||
|
# yamllint disable-line rule:truthy
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['main']
|
||||||
|
release:
|
||||||
|
types: ['created']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: galaxy
|
||||||
|
uses: robertdebock/galaxy-action@1.1.0
|
||||||
|
with:
|
||||||
|
galaxy_api_key: ${{ secrets.galaxy_api_key }}
|
12
.github/workflows/yamllint.yaml
vendored
12
.github/workflows/yamllint.yaml
vendored
|
@ -2,7 +2,13 @@
|
||||||
name: 'Yamllint GitHub Actions'
|
name: 'Yamllint GitHub Actions'
|
||||||
|
|
||||||
# yamllint disable-line rule:truthy
|
# yamllint disable-line rule:truthy
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches: '*'
|
||||||
|
pull_request:
|
||||||
|
branches: '*'
|
||||||
|
schedule:
|
||||||
|
- cron: '23 6 * */1 *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yamllint:
|
yamllint:
|
||||||
|
@ -16,7 +22,3 @@ jobs:
|
||||||
with:
|
with:
|
||||||
yamllint_file_or_dir: '.'
|
yamllint_file_or_dir: '.'
|
||||||
yamllint_config_filepath: './.yamllint'
|
yamllint_config_filepath: './.yamllint'
|
||||||
yamllint_strict: false
|
|
||||||
yamllint_comment: true
|
|
||||||
# env:
|
|
||||||
# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
---
|
---
|
||||||
- name: unbound checkconf
|
- name: unbound checkconf
|
||||||
command: unbound-checkconf /etc/unbound/unbound.conf
|
become: true
|
||||||
|
ansible.builtin.command: unbound-checkconf /etc/unbound/unbound.conf
|
||||||
changed_when: true
|
changed_when: true
|
||||||
notify: systemctl restart unbound
|
notify: systemctl restart unbound
|
||||||
|
|
||||||
- name: systemctl restart unbound
|
- name: systemctl restart unbound
|
||||||
service:
|
become: true
|
||||||
|
ansible.builtin.service:
|
||||||
name: unbound
|
name: unbound
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
---
|
---
|
||||||
- include_tasks: versioncheck.yml
|
- name: run optional versionscheck
|
||||||
|
ansible.builtin.include_tasks: versioncheck.yml
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
||||||
- name: Install unbound
|
- name: Install unbound
|
||||||
apt:
|
become: true
|
||||||
package:
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
- unbound
|
- unbound
|
||||||
state: "{{ unbound__state }}"
|
state: "{{ unbound__state }}"
|
||||||
update_cache: true
|
update_cache: true
|
||||||
cache_valid_time: 43200
|
cache_valid_time: 43200
|
||||||
|
|
||||||
|
|
||||||
- name: Copy unbound configuration snippets
|
- name: Copy unbound configuration snippets
|
||||||
copy:
|
become: true
|
||||||
|
ansible.builtin.copy:
|
||||||
src: '{{ item }}'
|
src: '{{ item }}'
|
||||||
dest: '/etc/unbound/unbound.conf.d/'
|
dest: '/etc/unbound/unbound.conf.d/'
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -23,9 +25,9 @@
|
||||||
notify:
|
notify:
|
||||||
- unbound checkconf
|
- unbound checkconf
|
||||||
|
|
||||||
|
|
||||||
- name: Copy main unbound configuration
|
- name: Copy main unbound configuration
|
||||||
template:
|
become: true
|
||||||
|
ansible.builtin.template:
|
||||||
src: 'files/unbound.conf'
|
src: 'files/unbound.conf'
|
||||||
dest: '/etc/unbound/unbound.conf'
|
dest: '/etc/unbound/unbound.conf'
|
||||||
owner: root
|
owner: root
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Create directory for versionscheck
|
- name: Create directory for versionscheck
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: '/etc/.ansible-version'
|
path: '/etc/.ansible-version'
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
- name: check playbook version
|
- name: check playbook version
|
||||||
become: true
|
become: true
|
||||||
slurp:
|
ansible.builtin.slurp:
|
||||||
src: "/etc/.ansible-version/{{ playbook_version_path }}"
|
src: "/etc/.ansible-version/{{ playbook_version_path }}"
|
||||||
register: playbook_version
|
register: playbook_version
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
@ -17,30 +17,30 @@
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Print remote role version
|
- name: Print remote role version
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
|
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
||||||
- name: Print locale role version
|
- name: Print locale role version
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "Local role version: '{{ playbook_version_number|string }}'."
|
msg: "Local role version: '{{ playbook_version_number|string }}'."
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
||||||
- name: Check if your version is outdated
|
- name: Check if your version is outdated
|
||||||
fail:
|
ansible.builtin.fail:
|
||||||
msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
|
msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
|
||||||
when:
|
when:
|
||||||
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
||||||
|
|
||||||
- name: check if '/etc/ansible-version/' is empty
|
- name: check if '/etc/ansible-version/' is empty
|
||||||
find:
|
ansible.builtin.find:
|
||||||
paths: '/etc/ansible-version/'
|
paths: '/etc/ansible-version/'
|
||||||
register: filesFound
|
register: filesFound
|
||||||
|
|
||||||
- name: write new version to remote disk
|
- name: write new version to remote disk
|
||||||
become: true
|
become: true
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
content: "{{ playbook_version_number }}"
|
content: "{{ playbook_version_number }}"
|
||||||
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
|
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
|
||||||
mode: 0644
|
mode: '0644'
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
Loading…
Reference in a new issue