use proper service name in task names
parent
33e80a0cd4
commit
e773e12e24
|
@ -1,11 +1,9 @@
|
|||
---
|
||||
- name: Playbook for Keycloak Hosts
|
||||
hosts: keycloak
|
||||
collections:
|
||||
- middleware_automation.keycloak
|
||||
tasks:
|
||||
- name: Include keycloak role
|
||||
ansible.builtin.include_role:
|
||||
name: middleware_automation.keycloak.keycloak
|
||||
vars:
|
||||
keycloak_admin_password: "changeme"
|
||||
collections:
|
||||
- middleware_automation.keycloak
|
||||
roles:
|
||||
- middleware_automation.keycloak.keycloak
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
---
|
||||
- name: Playbook for Keycloak Hosts
|
||||
hosts: keycloak
|
||||
collections:
|
||||
- middleware_automation.redhat_csp_download
|
||||
roles:
|
||||
- middleware_automation.redhat_csp_download.redhat_csp_download
|
||||
tasks:
|
||||
- name: Keycloak Role
|
||||
ansible.builtin.include_role:
|
||||
name: middleware_automation.keycloak.keycloak
|
||||
vars:
|
||||
keycloak_admin_password: "changeme"
|
||||
keycloak_rhsso_enable: True
|
||||
collections:
|
||||
- middleware_automation.redhat_csp_download
|
||||
- middleware_automation.keycloak
|
||||
roles:
|
||||
- middleware_automation.redhat_csp_download.redhat_csp_download
|
||||
- middleware_automation.keycloak.keycloak
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Configure firewall for keycloak ports
|
||||
- name: "Configure firewall for {{ keycloak.service_name }} ports"
|
||||
become: yes
|
||||
firewalld:
|
||||
port: "{{ item }}"
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
register: existing_deploy
|
||||
|
||||
- block:
|
||||
- name: Stop the old keycloak service
|
||||
- name: "Stop the old {{ keycloak.service_name }} service"
|
||||
become: yes
|
||||
ignore_errors: yes
|
||||
ansible.builtin.systemd:
|
||||
name: keycloak
|
||||
state: stopped
|
||||
- name: Remove the old Keycloak deployment
|
||||
- name: "Remove the old {{ keycloak.service_name }} deployment"
|
||||
become: yes
|
||||
ansible.builtin.file:
|
||||
path: "{{ keycloak_jboss_home }}"
|
||||
|
@ -35,7 +35,7 @@
|
|||
ansible.builtin.stat:
|
||||
path: "{{ keycloak_jboss_home }}"
|
||||
|
||||
- name: Create Keycloak service user/group
|
||||
- name: "Create {{ keycloak.service_name }} service user/group"
|
||||
become: yes
|
||||
ansible.builtin.user:
|
||||
name: "{{ keycloak_service_user }}"
|
||||
|
@ -43,7 +43,7 @@
|
|||
system: yes
|
||||
create_home: no
|
||||
|
||||
- name: Create Keycloak install location
|
||||
- name: "Create {{ keycloak.service_name }} install location"
|
||||
become: yes
|
||||
ansible.builtin.file:
|
||||
dest: "{{ keycloak_dest }}"
|
||||
|
@ -58,6 +58,7 @@
|
|||
archive: "{{ keycloak_dest }}/{{ keycloak.bundle }}"
|
||||
|
||||
- name: Check download archive path
|
||||
become: yes
|
||||
ansible.builtin.stat:
|
||||
path: "{{ archive }}"
|
||||
register: archive_path
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
dest: /var/log/keycloak
|
||||
|
||||
- block:
|
||||
- name: Check admin credentials by generating a token
|
||||
- name: Check admin credentials by generating a token (supposed to fail on first installation)
|
||||
ansible.builtin.uri:
|
||||
url: "{{ keycloak_url }}/auth/realms/master/protocol/openid-connect/token"
|
||||
method: POST
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: "Restart and enable keycloack service"
|
||||
- name: "Restart and enable {{ keycloak.service_name }} service"
|
||||
ansible.builtin.systemd:
|
||||
name: keycloak
|
||||
enabled: yes
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
when:
|
||||
- cli_result.rc == 0
|
||||
|
||||
- name: "Wait until Keycloak becomes active {{ keycloak.health_url }}"
|
||||
- name: "Wait until {{ keycloak.service_name }} becomes active {{ keycloak.health_url }}"
|
||||
ansible.builtin.uri:
|
||||
url: "{{ keycloak.health_url }}"
|
||||
register: keycloak_status
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
- name: Start keycloak
|
||||
- name: "Start {{ keycloak.service_name }} service"
|
||||
ansible.builtin.systemd:
|
||||
name: keycloak
|
||||
enabled: yes
|
||||
state: started
|
||||
become: yes
|
||||
|
||||
- name: "Wait until Keycloak becomes active {{ keycloak.health_url }}"
|
||||
- name: "Wait until {{ keycloak.service_name }} becomes active {{ keycloak.health_url }}"
|
||||
ansible.builtin.uri:
|
||||
url: "{{ keycloak.health_url }}"
|
||||
register: keycloak_status
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: Stop keycloak
|
||||
- name: "Stop {{ keycloak.service_name }}"
|
||||
ansible.builtin.systemd:
|
||||
name: keycloak
|
||||
enabled: yes
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- name: Configure keycloak service script wrapper
|
||||
- name: "Configure {{ keycloak.service_name }} service script wrapper"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: keycloak-service.sh.j2
|
||||
|
@ -9,7 +9,7 @@
|
|||
notify:
|
||||
- restart keycloak
|
||||
|
||||
- name: Configure sysconfig file for keycloak service
|
||||
- name: "Configure sysconfig file for {{ keycloak.service_name }} service"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: keycloak-sysconfig.j2
|
||||
|
@ -20,7 +20,7 @@
|
|||
notify:
|
||||
- restart keycloak
|
||||
|
||||
- name: Configure systemd unit file for keycloak service
|
||||
- name: "Configure systemd unit file for {{ keycloak.service_name }} service"
|
||||
ansible.builtin.template:
|
||||
src: keycloak.service.j2
|
||||
dest: /etc/systemd/system/keycloak.service
|
||||
|
@ -38,12 +38,12 @@
|
|||
daemon_reload: yes
|
||||
when: systemdunit.changed
|
||||
|
||||
- name: Start and wait for keycloak service (first node db)
|
||||
- name: "Start and wait for {{ keycloak.service_name }} service (first node db)"
|
||||
ansible.builtin.include_tasks: start_keycloak.yml
|
||||
run_once: yes
|
||||
when: keycloak_db_enabled
|
||||
|
||||
- name: Start and wait for keycloak service (remaining nodes)
|
||||
- name: "Start and wait for {{ keycloak.service_name }} service (remaining nodes)"
|
||||
ansible.builtin.include_tasks: start_keycloak.yml
|
||||
|
||||
- name: Check service status
|
||||
|
|
Loading…
Reference in New Issue