From 4cb021fe2c4340e8d2ab29a8afd1043e6c543e73 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 Jan 2022 19:58:27 -0600 Subject: [PATCH] Separate playbooks for installation and configuration --- ansible_hosts | 2 ++ playbooks/keycloak-realm.yml | 27 +++++++++++++++++++++++++++ playbooks/keycloak.yml | 25 +------------------------ 3 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 ansible_hosts create mode 100644 playbooks/keycloak-realm.yml diff --git a/ansible_hosts b/ansible_hosts new file mode 100644 index 0000000..fcd3222 --- /dev/null +++ b/ansible_hosts @@ -0,0 +1,2 @@ +[keycloak] +localhost ansible_connection=local diff --git a/playbooks/keycloak-realm.yml b/playbooks/keycloak-realm.yml new file mode 100644 index 0000000..ec8de4a --- /dev/null +++ b/playbooks/keycloak-realm.yml @@ -0,0 +1,27 @@ +--- +- name: Playbook for Keycloak Hosts + hosts: keycloak + tasks: + - name: Keycloak Realm Role + include_role: + name: keycloak_realm + vars: + keycloak_admin_password: "changeme" + keycloak_realm: TestRealm + keycloak_clients: + - name: TestClient1 + roles: + - TestClient1Admin + - TestClient1User + realm: "{{ keycloak_realm }}" + public_client: True + web_origins: + - http://testclient1origin/application + - http://testclient1origin/other + users: + - username: TestUser + password: password + client_roles: + - client: TestClient1 + role: TestClient1User + realm: "{{ keycloak_realm }}" diff --git a/playbooks/keycloak.yml b/playbooks/keycloak.yml index e0c8ac4..c40d219 100644 --- a/playbooks/keycloak.yml +++ b/playbooks/keycloak.yml @@ -10,27 +10,4 @@ include_role: name: keycloak vars: - keycloak_admin_password: "changeme" - - name: Keycloak Realm Role - include_role: - name: keycloak_realm - vars: - keycloak_admin_password: "changeme" - keycloak_realm: TestRealm - keycloak_clients: - - name: TestClient1 - roles: - - TestClient1Admin - - TestClient1User - realm: "{{ keycloak_realm }}" - public_client: True - web_origins: - - http://testclient1origin/application - - http://testclient1origin/other - users: - - username: TestUser - password: password - client_roles: - - client: TestClient1 - role: TestClient1User - realm: "{{ keycloak_realm }}" + keycloak_admin_password: "changeme" \ No newline at end of file