diff --git a/tasks/main.yml b/tasks/main.yml index d60fa77..1e5cfac 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,13 +4,13 @@ - name: register os-specific variables include_vars: default.yml - when: + when: - ansible_distribution != 'Fedora' - ansible_distribution != 'Archlinux' - name: register os-specific variables include_vars: "{{ ansible_distribution }}.yml" - when: + when: - ansible_distribution == 'Fedora' - ansible_distribution == 'Archlinux' @@ -60,7 +60,7 @@ - dsa notify: - restart ssh - when: generate_ecdsa_too + when: generate_ecdsa_too - name: Remove unwanted host keys become: yes diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 475f81b..9e0d385 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -11,20 +11,25 @@ become: true slurp: src: "{{ playbook_version_path }}" - register: playbook_version + register: playbook_version when: submodules_versioncheck ignore_errors: yes -- name: Print version +- name: Print remote role version debug: - msg: "Remote playbook version: '{{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}'. Local playbook version: '{{ playbook_version_number|string }}'." + msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" + when: submodules_versioncheck + +- name: Print locale role version + debug: + msg: "Local role version: '{{ playbook_version_number|string }}'." when: submodules_versioncheck - name: Check if your version is outdated fail: msg: "Your current ansible module has the version '{{ playbook_version_number }}' and is outdated. Please update it at least to version '{{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode }}'!" - when: - - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck + when: + - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck - name: write new version to remote disk become: true