use proper service name in task names

main
Guido Grazioli 2022-03-17 10:45:55 +01:00
parent 33e80a0cd4
commit e773e12e24
No known key found for this signature in database
GPG Key ID: 22C8C31EF2BC093B
10 changed files with 26 additions and 29 deletions

View File

@ -1,11 +1,9 @@
---
- name: Playbook for Keycloak Hosts
hosts: keycloak
vars:
keycloak_admin_password: "changeme"
collections:
- middleware_automation.keycloak
tasks:
- name: Include keycloak role
ansible.builtin.include_role:
name: middleware_automation.keycloak.keycloak
vars:
keycloak_admin_password: "changeme"
roles:
- middleware_automation.keycloak.keycloak

View File

@ -1,14 +1,12 @@
---
- name: Playbook for Keycloak Hosts
hosts: 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
tasks:
- name: Keycloak Role
ansible.builtin.include_role:
name: middleware_automation.keycloak.keycloak
vars:
keycloak_admin_password: "changeme"
keycloak_rhsso_enable: True
- middleware_automation.keycloak.keycloak

View File

@ -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 }}"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
---
- name: Stop keycloak
- name: "Stop {{ keycloak.service_name }}"
ansible.builtin.systemd:
name: keycloak
enabled: yes

View File

@ -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