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

update vers

This commit is contained in:
L3D 2020-09-18 17:09:59 +02:00
parent b558c359fb
commit ee9709d0fc
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B

View file

@ -7,15 +7,6 @@
mode: 0755
when: submodules_versioncheck|bool
- name: check legacy playbook version
become: true
slurp:
src: "/etc/ansible-version/{{ playbook_version_path }}"
register: legacy_playbook_version
when: submodules_versioncheck|bool
ignore_errors: yes
changed_when: False
- name: check playbook version
become: true
slurp:
@ -23,6 +14,7 @@
register: playbook_version
when: submodules_versioncheck|bool
ignore_errors: yes
failed_when: false
- name: Print remote role version
debug:
@ -39,29 +31,16 @@
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
- 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 }}"
mode: 0644
when: submodules_versioncheck|bool