From f32b43be5b79fe9fea668207e4e869338dadd9e8 Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Mon, 8 Apr 2024 22:18:48 +0000 Subject: [PATCH] keycloak:24.0.2 --- .config/ansible-lint.yml | 3 +++ .yamllint.yaml | 3 +++ defaults/main.yml | 4 +++- dl-checksum.sh | 2 +- meta/main.yml | 17 +++++++++-------- meta/requirements.yml | 4 ++-- platform-matrix-v1.json | 8 ++++---- tasks/main.yml | 41 +++++++++++++++++++++------------------- test.yml | 13 +++++++++++-- 9 files changed, 58 insertions(+), 37 deletions(-) create mode 100644 .config/ansible-lint.yml create mode 100644 .yamllint.yaml diff --git a/.config/ansible-lint.yml b/.config/ansible-lint.yml new file mode 100644 index 0000000..e807dd1 --- /dev/null +++ b/.config/ansible-lint.yml @@ -0,0 +1,3 @@ +--- +skip_list: + - 'name[template]' diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..0c01e2b --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,3 @@ +--- +rules: + line-length: disable diff --git a/defaults/main.yml b/defaults/main.yml index 2de1d39..07cc1be 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -keycloak_ver: 22.0.1 +keycloak_ver: 24.0.2 keycloak_mirror: https://github.com/keycloak/keycloak/releases/download keycloak_parent_install_dir: /usr/local @@ -63,3 +63,5 @@ keycloak_checksums: '20.0.2': sha1:49ccaddaf8e507b088386e731f2c6a9057a47ea9 # https://github.com/keycloak/keycloak/releases/download/22.0.1/keycloak-22.0.1.tar.gz.sha1 '22.0.1': sha1:eea6076b99a78f88104e3a08618f4422d0ff16e2 + # https://github.com/keycloak/keycloak/releases/download/24.0.2/keycloak-24.0.2.tar.gz.sha1 + '24.0.2': sha1:8b23e722df38fa7661a8eeb6e032c72c9e0818a9 diff --git a/dl-checksum.sh b/dl-checksum.sh index c162d6b..69a733b 100755 --- a/dl-checksum.sh +++ b/dl-checksum.sh @@ -13,4 +13,4 @@ dl_ver() { printf " '%s': sha1:%s\n" $ver $(curl -sSLf $url) } -dl_ver ${1:-22.0.1} +dl_ver ${1:-24.0.2} diff --git a/meta/main.yml b/meta/main.yml index 15f0171..3e3542f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -7,14 +7,14 @@ galaxy_info: - sso - secret - key - license: - - MIT - min_ansible_version: 2.0 + license: MIT + min_ansible_version: '2.0' + namespace: andrewrothstein platforms: - name: Alpine versions: - all - - name: Archlinux + - name: ArchLinux versions: - all - name: Debian @@ -23,13 +23,14 @@ galaxy_info: - bullseye - name: EL versions: - - 8 - - 9 + - '8' + - '9' - name: Fedora versions: - - 37 - - 38 + - '38' + - '39' - name: Ubuntu versions: - focal - jammy + role_name: keycloak diff --git a/meta/requirements.yml b/meta/requirements.yml index 2667da2..c47f117 100644 --- a/meta/requirements.yml +++ b/meta/requirements.yml @@ -1,5 +1,5 @@ --- - name: andrewrothstein.unarchivedeps - version: 2.0.1 + version: 3.0.2 - name: andrewrothstein.temurin - version: 1.1.8 + version: 2.0.0 diff --git a/platform-matrix-v1.json b/platform-matrix-v1.json index 4ff5ea9..b4505bc 100644 --- a/platform-matrix-v1.json +++ b/platform-matrix-v1.json @@ -1,11 +1,11 @@ [ { "OS": "alpine", - "OS_VER": "3.17" + "OS_VER": "3.18" }, { "OS": "alpine", - "OS_VER": "3.18" + "OS_VER": "3.19" }, { "OS": "alpine", @@ -25,11 +25,11 @@ }, { "OS": "fedora", - "OS_VER": "37" + "OS_VER": "38" }, { "OS": "fedora", - "OS_VER": "38" + "OS_VER": "39" }, { "OS": "rockylinux", diff --git a/tasks/main.yml b/tasks/main.yml index be320e5..69b94bb 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,58 +1,61 @@ --- -- include_role: - name: andrewrothstein.unarchive-deps -- include_role: +- name: Installing andrewrothstein.unarchivedeps + ansible.builtin.include_role: + name: andrewrothstein.unarchivedeps +- name: Installing andrewrothstein.temurin + ansible.builtin.include_role: name: andrewrothstein.temurin vars: - openjdk_app: jre -- name: check for existing install at {{ keycloak_install_dir }} + temurin_app: jre +- name: Check for existing install at {{ keycloak_install_dir }} become: true become_user: root - stat: + ansible.builtin.stat: path: '{{ keycloak_install_dir }}' changed_when: false register: keycloak_binary -- when: not keycloak_binary.stat.exists +- name: Downloading and installing keycloak + when: not keycloak_binary.stat.exists block: - - name: downloading {{ keycloak_tgz_url }}... + - name: Downloading {{ keycloak_tgz_url }}... become: true become_user: root - get_url: + ansible.builtin.get_url: url: '{{ keycloak_tgz_url }}' dest: '{{ keycloak_tmp_tgz }}' checksum: '{{ keycloak_checksum }}' - mode: 0644 - - name: unarchiving {{ keycloak_tmp_tgz }} + mode: '644' + - name: Unarchiving {{ keycloak_tmp_tgz }} become: true become_user: root - unarchive: + ansible.builtin.unarchive: remote_src: true src: '{{ keycloak_tmp_tgz }}' dest: '{{ keycloak_parent_install_dir }}' creates: '{{ keycloak_install_dir }}' always: - - name: rm {{ keycloak_tmp_tgz }} + - name: Rm {{ keycloak_tmp_tgz }} become: true become_user: root - file: + ansible.builtin.file: path: '{{ keycloak_tmp_tgz }}' state: absent -- name: linking {{ keycloak_link_dir }} to {{ keycloak_install_dir }} +- name: Linking {{ keycloak_link_dir }} to {{ keycloak_install_dir }} become: true become_user: root - file: + ansible.builtin.file: src: '{{ keycloak_install_dir }}' dest: '{{ keycloak_link_dir }}' state: link -- name: adding keycloak to the default bash login shell's path +- name: Adding keycloak to the default bash login shell's path become: true become_user: root with_items: - f: keycloak.sh d: /etc/profile.d - template: + ansible.builtin.template: src: '{{ item.f }}.j2' dest: '{{ item.d }}/{{ item.f }}' - mode: '{{ item.m|default("0644") }}' + mode: '{{ item.m | default("644") }}' diff --git a/test.yml b/test.yml index e938742..088979b 100644 --- a/test.yml +++ b/test.yml @@ -1,4 +1,13 @@ --- -- hosts: all +- name: Testing andrewrothstein.keycloak + hosts: all roles: - - role: '{{playbook_dir}}' + - role: '{{ playbook_dir }}' + tasks: + - name: Executing 'kc.sh --version' + ansible.builtin.command: sh -lc 'kc.sh --version' + changed_when: false + register: keycloak_test_output + - name: Output of 'kc.sh --version' + ansible.builtin.debug: + msg: '{{ keycloak_test_output.stdout }}'