Skip to content

Commit dd8dfab

Browse files
committed
removed el_patching_check_mode variable to follow standard playbook check mode
1 parent b8321e6 commit dd8dfab

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Only dnf must be available on the target machine.
2424
| `el_patching_auto_reboot` | `false` | By default do not reboot the target host. Only verify if a reboot is required.
2525
| `el_patching_reboot_timeout` | `600` | By default auto reboot is disabled but the default timeout value is set to 5 minutes. Value is in `seconds`.
2626
| `el_patching_method` | `"security"` | By default apply only `security` patches on the target host. Possible values `"security"/"bugfix"/"all"`
27-
| `el_patching_check_mode` | `false` | By default task is not executed in check mode. You can enable check mode to simulate patching. Keep in mind that check mode can't predict if a reboot is required. It only shows you how this role is executed on multiple/single hosts.
2827

2928
- **group_vars** or **host_vars** variables.
3029

@@ -47,6 +46,19 @@ Create the following playbook.
4746
- el_patching
4847
```
4948
49+
## Example execution
50+
51+
- Normal Execution
52+
```shell
53+
ansible-playbook -i inventory/hosts playbook.yml
54+
```
55+
56+
- If you want to run playbook in check mode
57+
```shell
58+
ansible-playbook -i inventory/hosts playbook.yml --check
59+
```
60+
61+
5062
## License
5163

5264
MIT

defaults/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ el_patching_required_packages: "yum-utils"
44
el_patching_reboot_timeout: 600
55
el_patching_method: "security"
66
el_patching_auto_reboot: false
7-
el_patching_check_mode: false
87

98
# Optional exclude variable for group_vars or host_vars
109
# el_patching_exclude_packages:

tasks/main.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
name: "*"
1212
state: latest
1313
exclude: "{{ el_patching_exclude_packages | default(omit) }}"
14-
check_mode: "{{ el_patching_check_mode }}"
1514
when: el_patching_method == "all"
1615

1716
- name: Apply security patches only
@@ -20,7 +19,6 @@
2019
security: true
2120
state: latest
2221
exclude: "{{ el_patching_exclude_packages | default(omit) }}"
23-
check_mode: "{{ el_patching_check_mode }}"
2422
when: el_patching_method == "security"
2523

2624
- name: Apply bugfix patches only
@@ -29,7 +27,6 @@
2927
bugfix: true
3028
state: latest
3129
exclude: "{{ el_patching_exclude_packages | default(omit) }}"
32-
check_mode: "{{ el_patching_check_mode }}"
3330
when: el_patching_method == "bugfix"
3431

3532
- name: Verify if restart is required
@@ -46,5 +43,4 @@
4643
- name: Reboot host
4744
ansible.builtin.reboot:
4845
reboot_timeout: "{{ el_patching_reboot_timeout }}"
49-
check_mode: "{{ el_patching_check_mode }}"
5046
when: el_patching_auto_reboot | bool and __el_patching_need_restart.rc == 1

0 commit comments

Comments
 (0)