Skip to content

Commit

Permalink
Merge pull request #47 from ansible-middleware/no_log
Browse files Browse the repository at this point in the history
allows user to switch no_log to True for debugging purpose
  • Loading branch information
guidograzioli authored Dec 15, 2022
2 parents 9157f83 + 699ab1a commit e17fda2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion roles/keycloak/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### Configuration specific to keycloak
keycloak_version: 15.0.2
keycloak_archive: "keycloak-{{ keycloak_version }}.zip"
keycloak_download_url: "https://github.com/keycloak/keycloak/releases/download/{{ keycloak_version }}/{{ keycloak_archive }}"
keycloak_download_url: "https://github.com/keycloak/keycloak/releases/download/{{ keycloak_version }}/{{ keycloak_archive }}"
keycloak_download_url_9x: "https://downloads.jboss.org/keycloak/{{ keycloak_version }}/{{ keycloak_archive }}"
keycloak_installdir: "{{ keycloak_dest }}/keycloak-{{ keycloak_version }}"
keycloak_offline_install: False
Expand Down Expand Up @@ -83,3 +83,5 @@ keycloak_default_jdbc:
mariadb:
url: 'jdbc:mariadb://localhost:3306/keycloak'
version: 2.7.4
# role specific vars
keycloak_no_log: True
8 changes: 6 additions & 2 deletions roles/keycloak/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ argument_specs:
default: "Keycloak"
description: "systemd description for keycloak"
type: "str"
keycloak_no_log:
default: true
type: "bool"
description: "Changes default behavior for no_log for debugging purpose, do not change for production system."
downstream:
options:
sso_version:
Expand All @@ -275,11 +279,11 @@ argument_specs:
sso_rhn_id:
default: "{{ sso_rhn_ids[sso_version].id }}"
description: "Customer Portal product ID for Red Hat SSO"
type: "str"
type: "str"
sso_archive:
default: "rh-sso-{{ sso_version }}-server-dist.zip"
description: "Red Hat SSO install archive filename"
type: "str"
type: "str"
sso_dest:
default: "/opt/sso"
description: "Root installation directory"
Expand Down
6 changes: 3 additions & 3 deletions roles/keycloak_realm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
method: POST
body: "client_id={{ keycloak_auth_client }}&username={{ keycloak_admin_user }}&password={{ keycloak_admin_password }}&grant_type=password"
validate_certs: no
no_log: True
no_log: "{{ keycloak_no_log | default('True') }}"
register: keycloak_auth_response
until: keycloak_auth_response.status == 200
retries: 5
Expand Down Expand Up @@ -48,7 +48,7 @@
provider_type: "{{ item.provider_type | default(org.keycloak.storage.UserStorageProvider) }}"
config: "{{ item.config }}"
mappers: "{{ item.mappers | default(omit) }}"
no_log: True
no_log: "{{ keycloak_no_log | default('True') }}"
register: create_user_federation_result
loop: "{{ keycloak_user_federation | flatten }}"
when: keycloak_user_federation is defined
Expand Down Expand Up @@ -91,7 +91,7 @@
public_client: "{{ item.public_client | default(False) }}"
protocol: "{{ item.protocol | default(omit) }}"
state: present
no_log: True
no_log: "{{ keycloak_no_log | default('True') }}"
register: create_client_result
loop: "{{ keycloak_clients | flatten }}"
when: (item.name is defined and item.client_id is defined) or (item.name is defined and item.id is defined)
Expand Down
2 changes: 1 addition & 1 deletion roles/keycloak_realm/tasks/manage_client_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
auth_password: "{{ keycloak_admin_password }}"
state: present
loop: "{{ client.roles | flatten }}"
no_log: True
no_log: "{{ keycloak_no_log | default('True') }}"
2 changes: 1 addition & 1 deletion roles/keycloak_realm/tasks/manage_user_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
body: "client_id={{ keycloak_auth_client }}&username={{ keycloak_admin_user }}&password={{ keycloak_admin_password }}&grant_type=password"
validate_certs: no
register: keycloak_auth_response
no_log: True
no_log: "{{ keycloak_no_log | default('True') }}"
until: keycloak_auth_response.status == 200
retries: 5
delay: 2
Expand Down

0 comments on commit e17fda2

Please sign in to comment.