From 7abdd83ea4974bbdd7918b152f4cf7064fc8e301 Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Fri, 3 Mar 2023 10:54:50 +0100 Subject: [PATCH] ci: linter --- .ansible-lint | 1 + playbooks/keycloak.yml | 4 +--- playbooks/keycloak_quarkus.yml | 4 +--- playbooks/keycloak_realm.yml | 4 +--- playbooks/rhsso.yml | 3 --- roles/keycloak/tasks/install.yml | 4 ++-- roles/keycloak/vars/main.yml | 2 +- roles/keycloak_quarkus/meta/main.yml | 2 -- roles/keycloak_realm/tasks/main.yml | 2 +- 9 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index e28ef42..eaa75d0 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -29,6 +29,7 @@ warn_list: - name[template] - name[casing] - fqcn[action] + - schema[meta] skip_list: - vars_should_not_be_used diff --git a/playbooks/keycloak.yml b/playbooks/keycloak.yml index 2b222a5..6c7ca4a 100644 --- a/playbooks/keycloak.yml +++ b/playbooks/keycloak.yml @@ -3,7 +3,5 @@ hosts: all vars: keycloak_admin_password: "remembertochangeme" - collections: - - middleware_automation.keycloak roles: - - keycloak + - middleware_automation.keycloak.keycloak diff --git a/playbooks/keycloak_quarkus.yml b/playbooks/keycloak_quarkus.yml index b9bbbba..9e1d3f9 100644 --- a/playbooks/keycloak_quarkus.yml +++ b/playbooks/keycloak_quarkus.yml @@ -9,7 +9,5 @@ keycloak_quarkus_https_enabled: True keycloak_quarkus_key_file: conf/key.pem keycloak_quarkus_cert_file: conf/cert.pem - collections: - - middleware_automation.keycloak roles: - - keycloak_quarkus + - middleware_automation.keycloak.keycloak_quarkus diff --git a/playbooks/keycloak_realm.yml b/playbooks/keycloak_realm.yml index 1efc4f7..ba3d8ea 100644 --- a/playbooks/keycloak_realm.yml +++ b/playbooks/keycloak_realm.yml @@ -22,7 +22,5 @@ - client: TestClient1 role: TestClient1User realm: "{{ keycloak_realm }}" - collections: - - middleware_automation.keycloak roles: - - keycloak_realm + - middleware_automation.keycloak.keycloak_realm diff --git a/playbooks/rhsso.yml b/playbooks/rhsso.yml index e34334f..c8dbc44 100644 --- a/playbooks/rhsso.yml +++ b/playbooks/rhsso.yml @@ -4,9 +4,6 @@ vars: keycloak_admin_password: "remembertochangeme" sso_enable: True - collections: - - middleware_automation.redhat_csp_download - - middleware_automation.keycloak roles: - middleware_automation.redhat_csp_download.redhat_csp_download - middleware_automation.keycloak.keycloak diff --git a/roles/keycloak/tasks/install.yml b/roles/keycloak/tasks/install.yml index af14c75..e60e0aa 100644 --- a/roles/keycloak/tasks/install.yml +++ b/roles/keycloak/tasks/install.yml @@ -17,6 +17,7 @@ register: existing_deploy - name: Stop and restart if existing deployment exists and install forced + when: existing_deploy.stat.exists and keycloak_force_install | bool block: - name: "Stop the old {{ keycloak.service_name }} service" become: yes @@ -29,7 +30,6 @@ ansible.builtin.file: path: "{{ keycloak_jboss_home }}" state: absent - when: existing_deploy.stat.exists and keycloak_force_install|bool - name: Check for an existing deployment after possible forced removal become: yes @@ -185,7 +185,7 @@ mode: 0640 notify: - restart keycloak - when: not keycloak_remotecache.enabled or keycloak_config_override_template|length > 0 + when: not keycloak_remotecache.enabled or keycloak_config_override_template | length > 0 - name: "Deploy {{ keycloak.service_name }} config with remote cache store to {{ keycloak_config_path_to_standalone_xml }}" become: yes diff --git a/roles/keycloak/vars/main.yml b/roles/keycloak/vars/main.yml index a634e6d..0a1ad7a 100644 --- a/roles/keycloak/vars/main.yml +++ b/roles/keycloak/vars/main.yml @@ -46,7 +46,7 @@ keycloak_jdbc: driver_jar_filename: "mariadb-java-client-{{ keycloak_jdbc_driver_version }}.jar" driver_jar_url: "https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/{{ keycloak_jdbc_driver_version }}/mariadb-java-client-{{ keycloak_jdbc_driver_version }}.jar" connection_url: "{{ keycloak_jdbc_url }}" - db_user: "{{ keycloak_db_user }}" + db_user: "{{ keycloak_db_user }}" db_password: "{{ keycloak_db_pass }}" initialize_db: > CREATE TABLE IF NOT EXISTS JGROUPSPING ( diff --git a/roles/keycloak_quarkus/meta/main.yml b/roles/keycloak_quarkus/meta/main.yml index fd6a110..911a545 100644 --- a/roles/keycloak_quarkus/meta/main.yml +++ b/roles/keycloak_quarkus/meta/main.yml @@ -1,6 +1,4 @@ --- -collections: - galaxy_info: role_name: keycloak_quarkus namespace: middleware_automation diff --git a/roles/keycloak_realm/tasks/main.yml b/roles/keycloak_realm/tasks/main.yml index 85ee5f0..45ac34b 100644 --- a/roles/keycloak_realm/tasks/main.yml +++ b/roles/keycloak_realm/tasks/main.yml @@ -27,7 +27,7 @@ ansible.builtin.uri: url: "{{ keycloak_url }}{{ keycloak_context }}/admin/realms" method: POST - body: "{{ lookup('template','realm.json.j2') }}" + body: "{{ lookup('template', 'realm.json.j2') }}" validate_certs: no body_format: json headers: