mirror of
https://github.com/roles-ansible/role_akku_warning.git
synced 2024-08-16 10:09:50 +02:00
Update versionscheck
This commit is contained in:
parent
b92ec405e4
commit
714731d4bf
1 changed files with 20 additions and 1 deletions
|
@ -14,6 +14,7 @@
|
|||
register: legacy_playbook_version
|
||||
when: submodules_versioncheck|bool
|
||||
ignore_errors: yes
|
||||
changed_when: False
|
||||
|
||||
- name: check playbook version
|
||||
become: true
|
||||
|
@ -40,9 +41,27 @@
|
|||
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
||||
- legacy_playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
||||
|
||||
- name: delete legacy version if needed
|
||||
become: true
|
||||
file:
|
||||
state: absent
|
||||
path: "/etc/ansible-version/{{ playbook_version_path }}"
|
||||
|
||||
- name: check if '/etc/ansible-version/' is empty
|
||||
find:
|
||||
paths: '/etc/ansible-version/'
|
||||
register: filesFound
|
||||
|
||||
- name: delete legacy version folder if needed
|
||||
become: true
|
||||
file:
|
||||
state: absent
|
||||
path: "/etc/ansible-version"
|
||||
when: filesFound.matched < 0
|
||||
|
||||
- name: write new version to remote disk
|
||||
become: true
|
||||
copy:
|
||||
content: "{{ playbook_version_number }}"
|
||||
dest: "/etc/ansible-version/{{ playbook_version_path }}"
|
||||
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
|
||||
when: submodules_versioncheck|bool
|
||||
|
|
Loading…
Reference in a new issue