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
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
pull_request:
|
||||
branches: '*'
|
||||
schedule:
|
||||
- cron: '23 6 * */1 *'
|
||||
|
||||
jobs:
|
||||
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
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
pull_request:
|
||||
branches: '*'
|
||||
schedule:
|
||||
- cron: '42 6 * */1 *'
|
||||
|
||||
jobs:
|
||||
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'
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
pull_request:
|
||||
branches: '*'
|
||||
schedule:
|
||||
- cron: '23 6 * */1 *'
|
||||
|
||||
jobs:
|
||||
yamllint:
|
||||
|
@ -16,7 +22,3 @@ jobs:
|
|||
with:
|
||||
yamllint_file_or_dir: '.'
|
||||
yamllint_config_filepath: './.yamllint'
|
||||
yamllint_strict: false
|
||||
yamllint_comment: true
|
||||
# env:
|
||||
# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
---
|
||||
- name: unbound checkconf
|
||||
command: unbound-checkconf /etc/unbound/unbound.conf
|
||||
become: true
|
||||
ansible.builtin.command: unbound-checkconf /etc/unbound/unbound.conf
|
||||
changed_when: true
|
||||
notify: systemctl restart unbound
|
||||
|
||||
- name: systemctl restart unbound
|
||||
service:
|
||||
become: true
|
||||
ansible.builtin.service:
|
||||
name: unbound
|
||||
state: restarted
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
---
|
||||
- include_tasks: versioncheck.yml
|
||||
- name: run optional versionscheck
|
||||
ansible.builtin.include_tasks: versioncheck.yml
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- name: Install unbound
|
||||
apt:
|
||||
package:
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- unbound
|
||||
state: "{{ unbound__state }}"
|
||||
update_cache: true
|
||||
cache_valid_time: 43200
|
||||
|
||||
|
||||
- name: Copy unbound configuration snippets
|
||||
copy:
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: '{{ item }}'
|
||||
dest: '/etc/unbound/unbound.conf.d/'
|
||||
owner: root
|
||||
|
@ -23,9 +25,9 @@
|
|||
notify:
|
||||
- unbound checkconf
|
||||
|
||||
|
||||
- name: Copy main unbound configuration
|
||||
template:
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: 'files/unbound.conf'
|
||||
dest: '/etc/unbound/unbound.conf'
|
||||
owner: root
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
- name: Create directory for versionscheck
|
||||
become: true
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: '/etc/.ansible-version'
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
@ -9,7 +9,7 @@
|
|||
|
||||
- name: check playbook version
|
||||
become: true
|
||||
slurp:
|
||||
ansible.builtin.slurp:
|
||||
src: "/etc/.ansible-version/{{ playbook_version_path }}"
|
||||
register: playbook_version
|
||||
when: submodules_versioncheck|bool
|
||||
|
@ -17,30 +17,30 @@
|
|||
failed_when: false
|
||||
|
||||
- name: Print remote role version
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- name: Print locale role version
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "Local role version: '{{ playbook_version_number|string }}'."
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- 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!"
|
||||
when:
|
||||
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
||||
|
||||
- name: check if '/etc/ansible-version/' is empty
|
||||
find:
|
||||
ansible.builtin.find:
|
||||
paths: '/etc/ansible-version/'
|
||||
register: filesFound
|
||||
|
||||
- name: write new version to remote disk
|
||||
become: true
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: "{{ playbook_version_number }}"
|
||||
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
|
||||
mode: 0644
|
||||
mode: '0644'
|
||||
when: submodules_versioncheck|bool
|
||||
|
|
Loading…
Reference in a new issue