From 58ce5f14f269f45e0137ebfa4f1f8cae0d7ce149 Mon Sep 17 00:00:00 2001 From: Bryan Black Date: Mon, 14 May 2018 11:29:22 -0700 Subject: [PATCH] fix for 'No updates are available to install' error resolves common problem of false `No updates are available to install` errors after updating FreeBSD base OS files. ```yml TASK [freebsd-update : Install FreeBSD updates] **************************************************** fatal: [freebsd6]: FAILED! => {"changed": true, "cmd": ["freebsd-update", "install", "--not-running-from-cron"], "delta": "0:00:00.274477", "end": "2018-05-14 18:13:56.977638", "msg": "non-zero return code", "rc": 1, "start": "2018-05-14 18:13:56.703161", "stderr": "rm: filelist: No such file or directory", "stderr_lines": ["rm: filelist: No such file or directory"], "stdout": "src component not installed, skipped\nInstalling updates...", "stdout_lines": ["src component not installed, skipped", "Installing updates..."]} changed: [freebsd5] TASK [freebsd-update : debug] ********************************************************************** ``` --- package_updates/roles/freebsd-update/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/package_updates/roles/freebsd-update/tasks/main.yml b/package_updates/roles/freebsd-update/tasks/main.yml index dbb9c02..f395e48 100644 --- a/package_updates/roles/freebsd-update/tasks/main.yml +++ b/package_updates/roles/freebsd-update/tasks/main.yml @@ -13,6 +13,7 @@ command: freebsd-update install --not-running-from-cron when: ansible_distribution == 'FreeBSD' and result_update.changed and not ansible_check_mode register: result_update_install + changed_when: "'No updates are available to install' not in result_update_install.stdout" - debug: var=result_update_install when: result_update_install.changed