commit f4677678d9feb8f43d33a6ef0888664193a21996 Author: L3D Date: Wed Sep 1 01:49:22 2021 +0200 Initial commit diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..8f96dfd --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,6 @@ +--- +# Feel free to add yourself if you maintain this repo +# or participate in a way that you have the feeling that you belong there ;-) + +github: [do1jlr] +liberapay: L3D diff --git a/.github/galaxy.svg b/.github/galaxy.svg new file mode 100644 index 0000000..7f868c1 --- /dev/null +++ b/.github/galaxy.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + do1jlr.role_name + do1jlr.role_name + + diff --git a/.github/license.svg b/.github/license.svg new file mode 100644 index 0000000..4ab6d9a --- /dev/null +++ b/.github/license.svg @@ -0,0 +1,217 @@ + + + + + + image/svg+xml + + + + + + 3D <l3d@c3woc.de> + + + + + MIT License + + + + + + + + + + + + + + + + + + + + + + + + + + + MIT + MIT + + + license + license + + diff --git a/.github/workflows/.galaxy.yml b/.github/workflows/.galaxy.yml new file mode 100644 index 0000000..b5dc0ec --- /dev/null +++ b/.github/workflows/.galaxy.yml @@ -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 }} diff --git a/.github/workflows/ansible-alpine-latest.yml b/.github/workflows/ansible-alpine-latest.yml new file mode 100644 index 0000000..07bfff0 --- /dev/null +++ b/.github/workflows/ansible-alpine-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check alpine:latest + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with alpine:latest + uses: roles-ansible/check-ansible-alpine-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-archlinux-latest.yml b/.github/workflows/ansible-archlinux-latest.yml new file mode 100644 index 0000000..e823f0c --- /dev/null +++ b/.github/workflows/ansible-archlinux-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check archlinux:latest + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with archlinux:latest + uses: roles-ansible/check-ansible-archlinux-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-centos7.yml b/.github/workflows/ansible-centos-centos7.yml new file mode 100644 index 0000000..401d2c0 --- /dev/null +++ b/.github/workflows/ansible-centos-centos7.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check centos:centos7 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:centos7 + uses: roles-ansible/check-ansible-centos-centos7-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-centos8.yml b/.github/workflows/ansible-centos-centos8.yml new file mode 100644 index 0000000..f20097b --- /dev/null +++ b/.github/workflows/ansible-centos-centos8.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check centos:centos8 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:centos8 + uses: roles-ansible/check-ansible-centos-centos8-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-latest.yml b/.github/workflows/ansible-centos-latest.yml new file mode 100644 index 0000000..94eb54b --- /dev/null +++ b/.github/workflows/ansible-centos-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check centos:latest + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:latest + uses: roles-ansible/check-ansible-centos-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-bullseye.yml b/.github/workflows/ansible-debian-bullseye.yml new file mode 100644 index 0000000..4b7c45d --- /dev/null +++ b/.github/workflows/ansible-debian-bullseye.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check debian:bullseye + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:bullseye + uses: roles-ansible/check-ansible-debian-bullseye-action@main + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-buster.yml b/.github/workflows/ansible-debian-buster.yml new file mode 100644 index 0000000..d76b02c --- /dev/null +++ b/.github/workflows/ansible-debian-buster.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check debian:buster + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:buster + uses: roles-ansible/check-ansible-debian-buster-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-latest.yml b/.github/workflows/ansible-debian-latest.yml new file mode 100644 index 0000000..f7eb5b6 --- /dev/null +++ b/.github/workflows/ansible-debian-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check debian:latest + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:latest + uses: roles-ansible/check-ansible-debian-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-sid.yml b/.github/workflows/ansible-debian-sid.yml new file mode 100644 index 0000000..2e3215a --- /dev/null +++ b/.github/workflows/ansible-debian-sid.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check debian:sid + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:sid + uses: roles-ansible/check-ansible-debian-sid-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-stable.yml b/.github/workflows/ansible-debian-stable.yml new file mode 100644 index 0000000..e47f773 --- /dev/null +++ b/.github/workflows/ansible-debian-stable.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check debian:stable + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:stable + uses: roles-ansible/check-ansible-debian-stable-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-stretch.yml b/.github/workflows/ansible-debian-stretch.yml new file mode 100644 index 0000000..c947cae --- /dev/null +++ b/.github/workflows/ansible-debian-stretch.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check debian:stretch + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:stretch + uses: roles-ansible/check-ansible-debian-stretch-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-31.yml b/.github/workflows/ansible-fedora-31.yml new file mode 100644 index 0000000..08502fe --- /dev/null +++ b/.github/workflows/ansible-fedora-31.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora:31 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:31 + uses: roles-ansible/check-ansible-fedora-31-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-32.yml b/.github/workflows/ansible-fedora-32.yml new file mode 100644 index 0000000..e362dd4 --- /dev/null +++ b/.github/workflows/ansible-fedora-32.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora:32 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:32 + uses: roles-ansible/check-ansible-fedora-32-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-33.yml b/.github/workflows/ansible-fedora-33.yml new file mode 100644 index 0000000..70c52ad --- /dev/null +++ b/.github/workflows/ansible-fedora-33.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora:33 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:33 + uses: roles-ansible/check-ansible-fedora-33-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-latest.yml b/.github/workflows/ansible-fedora-latest.yml new file mode 100644 index 0000000..7cfbdf7 --- /dev/null +++ b/.github/workflows/ansible-fedora-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora:latest + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:latest + uses: roles-ansible/check-ansible-fedora-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml new file mode 100644 index 0000000..41dcb97 --- /dev/null +++ b/.github/workflows/ansible-linting-check.yml @@ -0,0 +1,22 @@ +--- +name: Ansible Lint check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Lint Ansible Playbook + uses: ansible/ansible-lint-action@master + with: + targets: "." + # [required] + # Paths to ansible files (i.e., playbooks, tasks, handlers etc..) + args: "" + # [optional] diff --git a/.github/workflows/ansible-ubuntu-bionic.yml b/.github/workflows/ansible-ubuntu-bionic.yml new file mode 100644 index 0000000..0f9edd8 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-bionic.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check ubuntu:bionic + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:bionic + uses: roles-ansible/check-ansible-ubuntu-bionic-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-latest.yml b/.github/workflows/ansible-ubuntu-latest.yml new file mode 100644 index 0000000..b9544a5 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check ubuntu:latest + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:latest + uses: roles-ansible/check-ansible-ubuntu-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-trusty.yml b/.github/workflows/ansible-ubuntu-trusty.yml new file mode 100644 index 0000000..6cde8b8 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-trusty.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check ubuntu:trusty + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:trusty + uses: roles-ansible/check-ansible-ubuntu-trusty-action@master + with: + targets: "./" diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml new file mode 100644 index 0000000..39c49f8 --- /dev/null +++ b/.github/workflows/yamllint.yaml @@ -0,0 +1,22 @@ +--- +name: 'Yamllint GitHub Actions' + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + yamllint: + name: 'Yamllint' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Yamllint' + uses: karancode/yamllint-github-action@master + with: + yamllint_file_or_dir: '.' + yamllint_config_filepath: './.yamllint' + yamllint_strict: false + yamllint_comment: true +# env: +# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN } diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..cb32cb1 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + # 150 chars should be enough, but don't fail if a line is longer + line-length: + max: 150 + level: warning diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9c979b4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 L3D + +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 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..807f23e --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# ansible_role_template +Template for Ansible roles diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..c8d9a89 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# should we do a version check? (recomended) +submodules_versioncheck: false diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..b37444c --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- include_tasks: versioncheck.yml + when: submodules_versioncheck|bool diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml new file mode 100644 index 0000000..5128cc8 --- /dev/null +++ b/tasks/versioncheck.yml @@ -0,0 +1,44 @@ +--- +# Copyright (c) 2021 L3D +# this file is released with the MIT license. +# License: https://github.com/roles-ansible/ansible_role_template/blob/main/LICENSE +- name: Create directory for versionscheck + become: true + ansible.builtin.file: + path: '/etc/.ansible-version' + state: directory + mode: 0755 + when: submodules_versioncheck|bool + +- name: check playbook version + become: true + ansible.builtin.slurp: + src: "/etc/.ansible-version/{{ playbook_version_path }}" + register: playbook_version + when: submodules_versioncheck|bool + ignore_errors: true + failed_when: false + +- name: Print remote role version + ansible.builtin.debug: + msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" + when: submodules_versioncheck|bool + +- name: Print locale role version + ansible.builtin.debug: + msg: "Local role version: '{{ playbook_version_number|string }}'." + when: submodules_versioncheck|bool + +- name: Check if your version is outdated + 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: write new version to remote disk + become: true + ansible.builtin.copy: + content: "{{ playbook_version_number }}" + dest: "/etc/.ansible-version/{{ playbook_version_path }}" + mode: '0644' + when: submodules_versioncheck|bool diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..bf4b0d9 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,4 @@ +--- +# versionscheck +playbook_version_number: 02 # should be a integer +playbook_version_path: 'role-.version'