1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_sshd.git synced 2024-08-16 11:59:49 +02:00

improve lint checks

This commit is contained in:
Lilian Roller 2019-05-15 16:25:13 +02:00
parent 3b6a57864e
commit 8fa98b87c2
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
2 changed files with 13 additions and 8 deletions

View file

@ -4,13 +4,13 @@
- name: register os-specific variables - name: register os-specific variables
include_vars: default.yml include_vars: default.yml
when: when:
- ansible_distribution != 'Fedora' - ansible_distribution != 'Fedora'
- ansible_distribution != 'Archlinux' - ansible_distribution != 'Archlinux'
- name: register os-specific variables - name: register os-specific variables
include_vars: "{{ ansible_distribution }}.yml" include_vars: "{{ ansible_distribution }}.yml"
when: when:
- ansible_distribution == 'Fedora' - ansible_distribution == 'Fedora'
- ansible_distribution == 'Archlinux' - ansible_distribution == 'Archlinux'
@ -60,7 +60,7 @@
- dsa - dsa
notify: notify:
- restart ssh - restart ssh
when: generate_ecdsa_too when: generate_ecdsa_too
- name: Remove unwanted host keys - name: Remove unwanted host keys
become: yes become: yes

View file

@ -11,20 +11,25 @@
become: true become: true
slurp: slurp:
src: "{{ playbook_version_path }}" src: "{{ playbook_version_path }}"
register: playbook_version register: playbook_version
when: submodules_versioncheck when: submodules_versioncheck
ignore_errors: yes ignore_errors: yes
- name: Print version - name: Print remote role version
debug: 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 when: submodules_versioncheck
- name: Check if your version is outdated - name: Check if your version is outdated
fail: 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 }}'!" 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: when:
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck
- name: write new version to remote disk - name: write new version to remote disk
become: true become: true