Variables names must not be Ansible reserved names

This commit is contained in:
Guido Grazioli 2025-04-01 15:20:37 +02:00
parent 910a2aa5d4
commit 5db96afa56
2 changed files with 7 additions and 7 deletions

View file

@ -2,12 +2,12 @@
- name: Ensure required params for CLI have been provided - name: Ensure required params for CLI have been provided
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- query is defined - cli_query is defined
fail_msg: "Missing required parameters to execute CLI." fail_msg: "Missing required parameters to execute CLI."
quiet: true quiet: true
- name: "Execute CLI query: {{ query }}" - name: "Execute CLI query: {{ cli_query }}"
ansible.builtin.command: > ansible.builtin.command: >
{{ keycloak.cli_path }} --connect --command='{{ query }}' --controller={{ keycloak_host }}:{{ keycloak_management_http_port }} {{ keycloak.cli_path }} --connect --command='{{ cli_query }}' --controller={{ keycloak_host }}:{{ keycloak_management_http_port }}
changed_when: false changed_when: false
register: cli_result register: cli_result

View file

@ -106,7 +106,7 @@
- name: "Check installed patches" - name: "Check installed patches"
ansible.builtin.include_tasks: rhsso_cli.yml ansible.builtin.include_tasks: rhsso_cli.yml
vars: vars:
query: "patch info" cli_query: "patch info"
args: args:
apply: apply:
become: true become: true
@ -121,7 +121,7 @@
- name: "Apply patch {{ patch_version }} to server" - name: "Apply patch {{ patch_version }} to server"
ansible.builtin.include_tasks: rhsso_cli.yml ansible.builtin.include_tasks: rhsso_cli.yml
vars: vars:
query: "patch apply {{ patch_archive }}" cli_query: "patch apply {{ patch_archive }}"
args: args:
apply: apply:
become: true become: true
@ -130,7 +130,7 @@
- name: "Restart server to ensure patch content is running" - name: "Restart server to ensure patch content is running"
ansible.builtin.include_tasks: rhsso_cli.yml ansible.builtin.include_tasks: rhsso_cli.yml
vars: vars:
query: "shutdown --restart" cli_query: "shutdown --restart"
when: when:
- cli_result.rc == 0 - cli_result.rc == 0
args: args:
@ -149,7 +149,7 @@
- name: "Query installed patch after restart" - name: "Query installed patch after restart"
ansible.builtin.include_tasks: rhsso_cli.yml ansible.builtin.include_tasks: rhsso_cli.yml
vars: vars:
query: "patch info" cli_query: "patch info"
args: args:
apply: apply:
become: true become: true