add description to README and use better syntax

This commit is contained in:
L3D 2021-02-07 03:29:57 +01:00
parent aca6297cf4
commit cb3382d0e9
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 20 additions and 29 deletions

View file

@ -1,5 +1,6 @@
# ansible_role_template # ansible role acmetool_fix
Template for Ansible roles
Ansible role to install a acmetool from the URL defined in `defaults/main.yml`
Testing Testing
---------- ----------
@ -8,21 +9,11 @@ If you want to find out more about our tests, please have a look at the github m
| test status | Github Marketplace | | test status | Github Marketplace |
| :--------- | :---------------- | | :--------- | :---------------- |
| [![Ansible Lint check](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20Lint%20check/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+Lint+check%22) | [ansible-lint action](https://github.com/marketplace/actions/ansible-lint) | | [![Ansible Lint check](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/workflows/Ansible%20Lint%20check/badge.svg)](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/actions?query=workflow%3A%22Ansible+Lint+check%22) | [ansible-lint action](https://github.com/marketplace/actions/ansible-lint) |
| ![Yamllint GitHub Actions](https://github.com/roles-ansible/ansible_role_template/workflows/Yamllint%20GitHub%20Actions/badge.svg) | [yamllint gitHub actions](https://github.com/marketplace/actions/yamllint-github-action) | | ![Yamllint GitHub Actions](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/workflows/Yamllint%20GitHub%20Actions/badge.svg) | [yamllint gitHub actions](https://github.com/marketplace/actions/yamllint-github-action) |
| | | | | |
| [![Ansible check debian:stable](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:stable/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Astable%22) | [ansible test with debian stable](https://github.com/marketplace/actions/check-ansible-debian-stable) | | [![Ansible check debian:stable](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/workflows/Ansible%20check%20debian:stable/badge.svg)](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/actions?query=workflow%3A%22Ansible+check+debian%3Astable%22) | [ansible test with debian stable](https://github.com/marketplace/actions/check-ansible-debian-stable) |
| [![Ansible check debian:latest](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Alatest%22) | [ansible test with debian latest](https://github.com/marketplace/actions/check-ansible-debian-latest) | | [![Ansible check debian:latest](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/workflows/Ansible%20check%20debian:latest/badge.svg)](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/actions?query=workflow%3A%22Ansible+check+debian%3Alatest%22) | [ansible test with debian latest](https://github.com/marketplace/actions/check-ansible-debian-latest) |
| [![Ansible check debian:sid](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:sid/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Asid%22) | [ansible test with debian sid](https://github.com/marketplace/actions/check-ansible-debian-sid) | | [![Ansible check debian:sid](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/workflows/Ansible%20check%20debian:sid/badge.svg)](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/actions?query=workflow%3A%22Ansible+check+debian%3Asid%22) | [ansible test with debian sid](https://github.com/marketplace/actions/check-ansible-debian-sid) |
| [![Ansible check debian:buster](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:buster/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Abuster%22) | [ansible test with debian buster](https://github.com/marketplace/actions/check-ansible-debian-buster) | | [![Ansible check debian:buster](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/workflows/Ansible%20check%20debian:buster/badge.svg)](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/actions?query=workflow%3A%22Ansible+check+debian%3Abuster%22) | [ansible test with debian buster](https://github.com/marketplace/actions/check-ansible-debian-buster) |
| [![Ansible check debian:stretch](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:stretch/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Astretch%22) | [ansible test with debian stretch](https://github.com/marketplace/actions/check-ansible-debian-stretch) | | [![Ansible check debian:stretch](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/workflows/Ansible%20check%20debian:stretch/badge.svg)](https://github.com/DO1JLR/ansible_role_acmetool_debian_fix/actions?query=workflow%3A%22Ansible+check+debian%3Astretch%22) | [ansible test with debian stretch](https://github.com/marketplace/actions/check-ansible-debian-stretch) |
| | |
| [![Ansible check archlinux:latest](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20archlinux:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+archlinux%3Alatest%22) | [ansible test with archlinux latest](https://github.com/marketplace/actions/check-ansible-archlinux-latest) |
| | |
| [![Ansible check ubuntu:latest](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20ubuntu:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+ubuntu%3Alatest%22) | [ansible test with ubuntu latest](https://github.com/marketplace/actions/check-ansible-ubuntu-latest) |
| [![Ansible check ubuntu:bionic](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20ubuntu:bionic/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+ubuntu%3Abionic%22) | [ansible test with ubuntu bionic](https://github.com/marketplace/actions/check-ansible-ubuntu-bionic) |
| [![Ansible check ubuntu:trusty](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20ubuntu:trusty/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+ubuntu%3Atrusty%22) | [ansible test with ubuntu trusty](https://github.com/marketplace/actions/check-ansible-ubuntu-trusty) |
| | |
| [![Ansible check centos:latest](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20centos:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+centos%3Alatest%22) | [ansible test with centos latest](https://github.com/marketplace/actions/check-ansible-centos-latest) |
| [![Ansible check centos:centos8](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20centos:centos8/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+centos%3Acentos8%22) | [ansible test with centos centos8](https://github.com/marketplace/actions/check-ansible-centos-centos8) |
| [![Ansible check centos:latest](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20centos:centos7/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+centos%3Acentos7%22) | [ansible test with centos centos7](https://github.com/marketplace/actions/check-ansible-centos-centos7) |

View file

@ -4,5 +4,5 @@
- name: install acmetool from fixed url - name: install acmetool from fixed url
become: true become: true
apt: ansible.builtin.apt:
deb: "{{ acmetool_fix__deb }}" deb: "{{ acmetool_fix__deb }}"

View file

@ -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,29 +17,29 @@
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'

View file

@ -1,4 +1,4 @@
--- ---
# versionscheck # versionscheck
playbook_version_number: 02 # should be a integer playbook_version_number: 03 # should be a integer
playbook_version_path: 'role-<some_unique_string>.version' playbook_version_path: 'do1jlr.ansible_role_acmetool_debian_fix.version'