Downstream patching: add missing becomes

This commit is contained in:
Guido Grazioli 2023-03-10 15:23:22 +01:00
parent bf89b1895a
commit 59b69a6592
No known key found for this signature in database
GPG key ID: 22C8C31EF2BC093B

View file

@ -82,6 +82,7 @@
ansible.builtin.stat:
path: "{{ patch_archive }}"
register: patch_archive_path
become: yes
## copy and unpack
- name: Copy patch archive to target nodes
@ -102,6 +103,10 @@
ansible.builtin.include_tasks: rhsso_cli.yml
vars:
query: "patch info"
args:
apply:
become: yes
become_user: "{{ keycloak_service_user }}"
- name: "Perform patching"
when:
@ -113,6 +118,10 @@
ansible.builtin.include_tasks: rhsso_cli.yml
vars:
query: "patch apply {{ patch_archive }}"
args:
apply:
become: yes
become_user: "{{ keycloak_service_user }}"
- name: "Restart server to ensure patch content is running"
ansible.builtin.include_tasks: rhsso_cli.yml
@ -120,6 +129,10 @@
query: "shutdown --restart"
when:
- cli_result.rc == 0
args:
apply:
become: yes
become_user: "{{ keycloak_service_user }}"
- name: "Wait until {{ keycloak.service_name }} becomes active {{ keycloak.health_url }}"
ansible.builtin.uri:
@ -133,6 +146,10 @@
ansible.builtin.include_tasks: rhsso_cli.yml
vars:
query: "patch info"
args:
apply:
become: yes
become_user: "{{ keycloak_service_user }}"
- name: "Verify installed patch version"
ansible.builtin.assert:
@ -144,3 +161,7 @@
- name: "Skipping patch"
ansible.builtin.debug:
msg: "Cumulative patch {{ patch_version }} already installed, skipping patch installation."
when:
- cli_result is defined
- cli_result.stdout is defined
- patch_version in cli_result.stdout