fix for #7
Fix for https://github.com/stationgroup/ansible-experiments/issues/7 I think `freebsd-update` return failed even when _"No updates needed"_ or _"No update are available"_. https://github.com/freebsd/pkg/issues/1470 ``` failed_when: False # --dry-run always returns failure # https://github.com/freebsd/pkg/issues/1470 ```
This commit is contained in:
parent
7c04dfed2b
commit
3707750246
|
@ -1,6 +1,8 @@
|
||||||
---
|
---
|
||||||
- name: Fetch any new FreeBSD updates
|
- name: Fetch any new FreeBSD updates
|
||||||
command: freebsd-update fetch --not-running-from-cron
|
command: freebsd-update fetch --not-running-from-cron
|
||||||
|
failed_when: False # --dry-run always returns failure
|
||||||
|
# https://github.com/freebsd/pkg/issues/1470
|
||||||
check_mode: no
|
check_mode: no
|
||||||
when: ansible_distribution == 'FreeBSD'
|
when: ansible_distribution == 'FreeBSD'
|
||||||
register: result_update
|
register: result_update
|
||||||
|
@ -11,6 +13,8 @@
|
||||||
|
|
||||||
- name: Install FreeBSD updates
|
- name: Install FreeBSD updates
|
||||||
command: freebsd-update install --not-running-from-cron
|
command: freebsd-update install --not-running-from-cron
|
||||||
|
failed_when: False # --dry-run always returns failure
|
||||||
|
# https://github.com/freebsd/pkg/issues/1470
|
||||||
when: ansible_distribution == 'FreeBSD' and result_update.changed and not ansible_check_mode
|
when: ansible_distribution == 'FreeBSD' and result_update.changed and not ansible_check_mode
|
||||||
register: result_update_install
|
register: result_update_install
|
||||||
changed_when: "'No updates are available to install' not in result_update_install.stdout"
|
changed_when: "'No updates are available to install' not in result_update_install.stdout"
|
||||||
|
|
Loading…
Reference in a new issue