diff --git a/README.md b/README.md index 8369f2b..e6c975c 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,14 @@ Working internet and proper repository configuration on machines. * The `os_update_reboot` variable has been updated. Old boolean values (`True`|`False`) are no longer supported and should be replaced with the new string values (`allow`|`deny`|`force`). -* however, at the moment we catch them up and migrate them: +* however, at the moment we catch them up and migrate old var settings: * `True` => `allow` * `False` => `deny` -## Role Variables -* gather_facts is turned off, due we need to decide if host is online first. - we do this multiple times, to avoid load and connectivity issues. - please look into `tests` folder. +* gather_facts is now turned on by default + * we notify if missing +## Role Variables Most variables have ```varname_default``` equivalent, which is meant to be used for overriding the default at playbook level. So you can define the default behavior for all targets that have no variables defined at all. eg: full|security patching. diff --git a/tasks/full-Fedora.yml b/tasks/full-Fedora.yml index 3d23437..a257a61 120000 --- a/tasks/full-Fedora.yml +++ b/tasks/full-Fedora.yml @@ -1 +1 @@ -full-rhelAll-9.yml \ No newline at end of file +tasks/full-rhelAll-9.yml \ No newline at end of file diff --git a/tasks/full-Ubuntu.yml b/tasks/full-Ubuntu.yml index 13ae049..5d9d22e 120000 --- a/tasks/full-Ubuntu.yml +++ b/tasks/full-Ubuntu.yml @@ -1 +1 @@ -full-Debian.yml \ No newline at end of file +tasks/full-Debian.yml \ No newline at end of file diff --git a/tasks/kernel-cleanup-Fedora.yml b/tasks/kernel-cleanup-Fedora.yml index 7949674..fa352f3 120000 --- a/tasks/kernel-cleanup-Fedora.yml +++ b/tasks/kernel-cleanup-Fedora.yml @@ -1 +1 @@ -kernel-cleanup-rhelAll-9.yml \ No newline at end of file +tasks/kernel-cleanup-rhelAll-9.yml \ No newline at end of file diff --git a/tasks/kernel-cleanup-Ubuntu.yml b/tasks/kernel-cleanup-Ubuntu.yml index da383ae..caab57d 120000 --- a/tasks/kernel-cleanup-Ubuntu.yml +++ b/tasks/kernel-cleanup-Ubuntu.yml @@ -1 +1 @@ -kernel-cleanup-Debian.yml \ No newline at end of file +tasks/kernel-cleanup-Debian.yml \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 102912d..cbc94aa 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,22 @@ --- # tasks file for os_update +- name: gather facts if not exist + block: + - name: gather facts + setup: + - name: Display warning if facts did not exist + debug: + msg: + - WARNING, fact gathering is required for this play + - Since this is a breaking change, we do it for now + - Please update your variables accordingly. + - change your play to enable gather_facts + - name: Wait 3 minutes if legacy value was used, just to get attention + wait_for: + timeout: 180 + when: ansible_facts is undefined or ansible_facts == {} + - name: Check if os_update_reboot has a legacy value set_fact: legacy_value_detected: "{{ os_update_reboot in [True, False, '0', '1'] }}" @@ -20,9 +36,9 @@ - Please update your variables accordingly. - "Migrated values: os_update_reboot: {{ os_update_reboot }}" - - name: Wait 5 minutes if legacy value was used, just to get attention + - name: Wait 3 minutes if legacy value was used, just to get attention wait_for: - timeout: 300 + timeout: 180 when: legacy_value_detected - name: Define rhelAll fact dummy diff --git a/tasks/reboot-Ubuntu.yml b/tasks/reboot-Ubuntu.yml index 56c4c51..c1e0422 120000 --- a/tasks/reboot-Ubuntu.yml +++ b/tasks/reboot-Ubuntu.yml @@ -1 +1 @@ -reboot-Debian.yml \ No newline at end of file +tasks/reboot-Debian.yml \ No newline at end of file diff --git a/tasks/security-Fedora.yml b/tasks/security-Fedora.yml index 3dab107..d9458be 120000 --- a/tasks/security-Fedora.yml +++ b/tasks/security-Fedora.yml @@ -1 +1 @@ -security-rhelAll-9.yml \ No newline at end of file +tasks/security-rhelAll-9.yml \ No newline at end of file diff --git a/tasks/security-Ubuntu.yml b/tasks/security-Ubuntu.yml index da3005b..78d784b 120000 --- a/tasks/security-Ubuntu.yml +++ b/tasks/security-Ubuntu.yml @@ -1 +1 @@ -security-Debian.yml \ No newline at end of file +tasks/security-Debian.yml \ No newline at end of file diff --git a/tests/full.yml b/tests/full.yml index 27f19b8..937a209 100644 --- a/tests/full.yml +++ b/tests/full.yml @@ -1,6 +1,7 @@ --- - hosts: all - gather_facts: no + gather_facts: True + become: True roles: - joe-speedboat.os_update vars: diff --git a/tests/security.yml b/tests/security.yml index e22be01..cbeb89f 100644 --- a/tests/security.yml +++ b/tests/security.yml @@ -1,6 +1,7 @@ --- - hosts: all - gather_facts: no + gather_facts: true + become: True roles: - joe-speedboat.os_update vars: