diff --git a/meta/main.yml b/meta/main.yml index 7bad56f..00cc6c1 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -5,19 +5,19 @@ galaxy_info: description: install and configure the Network Time Protocol (NTP) Daemon license: "Apache-2.0" - min_ansible_version: 2.11 + min_ansible_version: '2.12' platforms: - - name: Archlinux - versions: all - - name: Clearlinux - version: all + - name: ArchLinux + versions: ['all'] - name: Debian - versions: all + versions: ['all'] + - name: Ubuntu + versions: ['all'] - name: EL - versions: all + versions: ['all'] - name: Fedora - versions: all + versions: ['all'] galaxy_tags: - system diff --git a/tasks/config.yml b/tasks/config.yml index ab96956..462f4a7 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,7 +1,5 @@ --- -# Tasks file for config ntp daemon - -- name: seting-up ntp config +- name: Seting up ntp config become: true ansible.builtin.template: src: templates/ntp.conf.j2 diff --git a/tasks/main.yml b/tasks/main.yml index 0ccb762..7340420 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ --- -- name: run versionscheck if enabled +- name: Optionally run versionscheck if enabled ansible.builtin.include_tasks: versioncheck.yml - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool - name: Include OS specific variables. ansible.builtin.include_vars: "{{ lookup('first_found', ntp__vars) }}" diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 5128cc8..dd22a1a 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -8,37 +8,38 @@ path: '/etc/.ansible-version' state: directory mode: 0755 - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool -- name: check playbook version +- name: Check playbook version become: true ansible.builtin.slurp: src: "/etc/.ansible-version/{{ playbook_version_path }}" register: playbook_version - when: submodules_versioncheck|bool + 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 + when: submodules_versioncheck | bool - name: Print locale role version ansible.builtin.debug: - msg: "Local role version: '{{ playbook_version_number|string }}'." - when: submodules_versioncheck|bool + 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 + - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck | bool -- name: write new version to remote disk +- 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 + when: submodules_versioncheck | bool + tags: skip_ansible_lint_template-instead-of-copy diff --git a/vars/main.yml b/vars/main.yml index e560b19..dde0e64 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,5 +1,5 @@ --- -playbook_version_number: 2053 +playbook_version_number: 2054 playbook_version_path: 'role-ntp_chaos-bodensee_github.com.version' ntp__vars: