--- - name: keycloak-install | Install the keycloak distribution tags: keycloak block: - name: keycloak-install | Create the keycloak user ansible.builtin.user: name: '{{ keycloak_user }}' home: '{{ keycloak_install_dir }}' createhome: false shell: /usr/sbin/nologin system: true - name: keycloak-install | Create the keycloak installation directory, if it does not already exist. ansible.builtin.file: dest: '{{ keycloak_install_dir }}' owner: root group: root state: directory recurse: true - name: keycloak-install | Create the keycloak log directory ansible.builtin.file: dest: "{{ keycloak_log_directory }}" state: directory owner: "{{ keycloak_user }}" group: "{{ keycloak_user }}" mode: '0755' - name: keycloak-install | Download the keycloak distribution ansible.builtin.unarchive: remote_src: true src: "{{ keycloak_download_url }}" dest: "{{ keycloak_install_dir }}" owner: root group: root args: creates: '{{ keycloak_install_dir }}/{{ keycloak_distribution }}' - name: keycloak-install | Set the permissions of {{ keycloak_data_directory }} ansible.builtin.file: dest: '{{ keycloak_data_directory }}' state: directory owner: '{{ keycloak_user }}' group: '{{ keycloak_user }}' mode: "0750" recurse: true tags: [keycloak, keycloak_data_dir] - name: keycloak-install | Set the permissions of {{ keycloak_quarkus_directory }} ansible.builtin.file: dest: "{{ keycloak_quarkus_directory }}" state: directory owner: '{{ keycloak_user }}' group: '{{ keycloak_user }}' mode: "0750" recurse: true tags: [keycloak, keycloak_data_dir] - name: keycloak-install | Avatar directory ansible.builtin.file: dest: '{{ keycloak_external_avatar_dir }}' state: directory owner: '{{ keycloak_user }}' group: '{{ keycloak_user }}' mode: "0750" when: not keycloak_external_avatar_dir_enabled