<commit_before>---

##### Set service user as owner of keycloak base dir
- block:
    - name: "Setting everything under keycloak_home dir to belong to user: {{ keycloak_service_user }}"
      file:
        dest: "{{ keycloak_home }}"
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        recurse: yes
  become: yes
  tags: "keycloak:install:setup_file_permissions"


######### Install configuration templates
- block:

    - name: Installing keycloak main configuration (keycloak.conf)
      template:
        mode: 0600
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        src: "templates/{{ keycloak_version }}/keycloak.conf.j2"
        dest: "{{ keycloak_home }}/conf/keycloak.conf"
      become: yes

    - name: Installing keycloak cache configuration
      template:
        mode: 0600
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        src: "templates/{{ keycloak_version }}/cache-ispn-jdbc-ping.xml.j2"
        dest: "{{ keycloak_home }}/conf/cache-ispn-jdbc-ping.xml"
      become: yes

    - name: Installing keycloak quarkus configuration
      template:
        mode: 0600
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        src: "templates/{{ keycloak_version }}/quarkus.properties.j2"
        dest: "{{ keycloak_home }}/conf/quarkus.properties"
      become: yes

  tags: "keycloak:install:config"


#### Setup logcleaner script
- name: "Task block: Setup logcleaner script"
  block:
    - name: "Ensure the logs folder exists"
      file:
        path: "{{ keycloak_logs_folder }}"
        state: directory
        mode: '0755'
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        recurse: yes
    - name: "Install the logcleaner script template"
      template:
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"<commit_msg>[keycloak role, quarkus] Set <keycloak_base>/conf dir permissions<commit_after>---

##### Set service user as owner of keycloak base dir
- block:
    - name: "Setting everything under keycloak_home dir to belong to user: {{ keycloak_service_user }}"
      file:
        dest: "{{ keycloak_home }}"
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        recurse: yes
  become: yes
  tags: "keycloak:install:setup_file_permissions"


######### Install configuration templates
- block:

    - name: Set the appropriate permissions for the keycloak's config folder
      file:
        path: "{{ keycloak_home }}/conf"
        state: directory
        mode: 0700
      become: yes

    - name: Installing keycloak main configuration (keycloak.conf)
      template:
        mode: 0600
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        src: "templates/{{ keycloak_version }}/keycloak.conf.j2"
        dest: "{{ keycloak_home }}/conf/keycloak.conf"
      become: yes

    - name: Installing keycloak cache configuration (cache-ispn-jdbc-ping.xml)
      template:
        mode: 0600
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        src: "templates/{{ keycloak_version }}/cache-ispn-jdbc-ping.xml.j2"
        dest: "{{ keycloak_home }}/conf/cache-ispn-jdbc-ping.xml"
      become: yes

    - name: Installing keycloak quarkus configuration (quarkus.properties)
      template:
        mode: 0600
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        src: "templates/{{ keycloak_version }}/quarkus.properties.j2"
        dest: "{{ keycloak_home }}/conf/quarkus.properties"
      become: yes

  tags: "keycloak:install:config"


#### Setup logcleaner script
- name: "Task block: Setup logcleaner script"
  block:
    - name: "Ensure the logs folder exists"
      file:
        path: "{{ keycloak_logs_folder }}"
        state: directory
        mode: '0755'
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
        recurse: yes
    - name: "Install the logcleaner script template"
      template:
        owner: "{{ keycloak_service_user }}"
        group: "{{ keycloak_service_user }}"
{'fraction_non_alphanumeric': 0.12590011614401858, 'fraction_numerical': 0.00975609756097561, 'mean_word_length': 2.712068965517241, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1775047', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1371, 'n_words': 318}