Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Commit

Permalink
improve lint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DO1JLR committed May 15, 2019
1 parent 3b6a578 commit 8fa98b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -60,7 +60,7 @@
- dsa
notify:
- restart ssh
when: generate_ecdsa_too
when: generate_ecdsa_too

- name: Remove unwanted host keys
become: yes
Expand Down
15 changes: 10 additions & 5 deletions tasks/versioncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fa98b8

Please sign in to comment.