Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge upstream #14

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
cache: pip
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: 'python -m pip install --upgrade pip

if [ -f requirements.txt ]; then python -m pip install -r requirements.txt;
fi'
- name: 'dcb #ftw'
run: dcb --upstreamregistry ghcr.io --upstreamgroup andrewrothstein --upstreamapp
docker-ansible --targetregistry ghcr.io --targetuser ${{ github.actor }} --targetpwd
${{ github.token }} --snippet from.j2 ansible-test-role.j2 --pullall --writeall
--buildall --pushall --alltags ${{ matrix.os }}
strategy:
matrix:
os:
- alpine_3.16
- alpine_3.17
- alpine_edge
- archlinux_latest
- debian_bullseye
- debian_buster
- fedora_36
- fedora_37
- rockylinux_8
- rockylinux_9
- ubuntu_bionic
- ubuntu_focal
- ubuntu_jammy
python-version:
- '3.10'
name: dcb
'on':
- push
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
**~
*.retry
.ansible-roles/
**~*.retry
Dockerfile.*
requirements.yml
requirements.yml
!meta/requirements.yml
**/*undo-tree*
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
andrewrothstein.keycloak
=========
[![Build Status](https://travis-ci.org/andrewrothstein/ansible-keycloak.svg?branch=master)](https://travis-ci.org/andrewrothstein/ansible-keycloak)
![Build Status](https://github.com/andrewrothstein/ansible-keycloak/actions/workflows/build.yml/badge.svg)

Installs [KeyCloak](http://www.keycloak.org/)

Expand Down
27 changes: 11 additions & 16 deletions dcb-os.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
---
- alpine_3.16
- alpine_3.17
- alpine_edge
- archlinux_latest
- centos_7
- centos_8
- debian_bullseye
- debian_buster
- debian_jessie
- debian_stretch
- fedora_23
- fedora_24
- fedora_25
- fedora_26
- fedora_27
- fedora_28
- fedora_29
- fedora_30
- fedora_31
- fedora_32
- ubi8_8.0
- fedora_36
- fedora_37
- rockylinux_8
- rockylinux_9
- ubuntu_bionic
- ubuntu_xenial
- ubuntu_focal
- ubuntu_jammy
34 changes: 32 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
keycloak_ver: '9.0.0'
keycloak_mirror: https://downloads.jboss.org/keycloak
keycloak_ver: 20.0.2
keycloak_mirror: https://github.com/keycloak/keycloak/releases/download

keycloak_parent_install_dir: /usr/local

Expand Down Expand Up @@ -31,3 +31,33 @@ keycloak_checksums:
'8.0.1': sha1:ca4d73cdba3b8ccea6777b0edbbe6bfafcc29a00
# https://downloads.jboss.org/keycloak/9.0.0/keycloak-9.0.0.tar.gz.sha1
'9.0.0': sha1:a667600d9e849a13e14e1bcb3b9821e28ce4ae9c
# https://downloads.jboss.org/keycloak/10.0.2/keycloak-10.0.2.tar.gz.sha1
'10.0.2': sha1:2b90bdefd3c837b2f3cc3d44263b6503cd6fbf62
# https://downloads.jboss.org/keycloak/11.0.0/keycloak-11.0.0.tar.gz.sha1
'11.0.0': sha1:398a328a180682ee58b06df148938f5de710f89f
# https://github.com/keycloak/keycloak/releases/download/12.0.4/keycloak-12.0.4.tar.gz.sha1
'12.0.4': sha1:803e4f9f085b0560649c2486aa4378a66ddc08f0
# https://github.com/keycloak/keycloak/releases/download/13.0.1/keycloak-13.0.1.tar.gz.sha1
'13.0.1': sha1:940f300ecb8105c855528bd952fe5023001ec34d
# https://github.com/keycloak/keycloak/releases/download/14.0.0/keycloak-14.0.0.tar.gz.sha1
'14.0.0': sha1:894a7b4eee2f99f57b603c3ea7d28cd3420c0cce
# https://github.com/keycloak/keycloak/releases/download/15.0.0/keycloak-15.0.0.tar.gz.sha1
'15.0.0': sha1:8986ede748bd7cceef828669160e8b1de004be5f
# https://github.com/keycloak/keycloak/releases/download/15.0.1/keycloak-15.0.1.tar.gz.sha1
'15.0.1': sha1:55026a7b41b8d4aa6de151d77880373e5e709bb0
# https://github.com/keycloak/keycloak/releases/download/15.0.2/keycloak-15.0.2.tar.gz.sha1
'15.0.2': sha1:806f2ec9d64c9350d11cda809449239b60fae868
# https://github.com/keycloak/keycloak/releases/download/15.1.0/keycloak-15.1.0.tar.gz.sha1
'15.1.0': sha1:cb4613a8dd1987e6a47e7571af55f4e8cf3a54fc
# https://github.com/keycloak/keycloak/releases/download/15.1.1/keycloak-15.1.1.tar.gz.sha1
'15.1.1': sha1:914803c64b43941178acb6bdff9d99076fc7dccd
# https://github.com/keycloak/keycloak/releases/download/16.0.0/keycloak-16.0.0.tar.gz.sha1
'16.0.0': sha1:5efc0fdf404e8985e6a2eaa84daaa99e5440e327
# https://github.com/keycloak/keycloak/releases/download/16.1.0/keycloak-16.1.0.tar.gz.sha1
'16.1.0': sha1:876f64dea6e862543c6eb979450b4f1422025b33
# https://github.com/keycloak/keycloak/releases/download/16.1.1/keycloak-16.1.1.tar.gz.sha1
'16.1.1': sha1:4acc5d20bc3d26e25aa3bcffbc50ac9b76135c93
# https://github.com/keycloak/keycloak/releases/download/19.0.1/keycloak-19.0.1.tar.gz.sha1
'19.0.1': sha1:b15576f141ab51b436b777b0fdbfcd722bda2f54
# https://github.com/keycloak/keycloak/releases/download/20.0.2/keycloak-20.0.2.tar.gz.sha1
'20.0.2': sha1:49ccaddaf8e507b088386e731f2c6a9057a47ea9
9 changes: 6 additions & 3 deletions dl-checksum.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env sh
set -e
DIR=~/Downloads
MIRROR=https://downloads.jboss.org/keycloak
MIRROR=https://github.com/keycloak/keycloak/releases/download

# https://github.com/keycloak/keycloak/releases/download/12.0.4/keycloak-12.0.4.tar.gz.sha1

dl_ver() {
local ver=$1
local url=$MIRROR/$ver/keycloak-${ver}.tar.gz.sha1

printf " # %s\n" $url
printf " '%s': sha1:%s\n" $ver $(curl -sSL $url)
printf " '%s': sha1:%s\n" $ver $(curl -sSLf $url)
}

dl_ver ${1:-9.0.0}
dl_ver ${1:-20.0.2}
27 changes: 18 additions & 9 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
dependencies:
- role: andrewrothstein.unarchive-deps
version: v1.1.2
- openjdk_app: jre
role: andrewrothstein.openjdk
version: v2.0.4
---
galaxy_info:
author: Andrew Rothstein
company: BlackRock
Expand All @@ -16,12 +11,26 @@ galaxy_info:
- MIT
min_ansible_version: 2.0
platforms:
- name: EL
- name: Alpine
versions:
- all
- name: Fedora
- name: Archlinux
versions:
- all
- name: Debian
versions:
- bullseye
- buster
- name: EL
versions:
- 8
- 9
- name: Fedora
versions:
- 36
- 37
- name: Ubuntu
versions:
- all
- bionic
- focal
- jammy
5 changes: 5 additions & 0 deletions meta/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: andrewrothstein.unarchive-deps
version: v1.2.4
- name: andrewrothstein.temurin
version: 1.1.4
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ansible-galaxy-local-deps == 0.0.14
dcb == 0.0.17
dcb == 0.1.2
40 changes: 23 additions & 17 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
---
- name: check for existing install...
become: yes
- include_role:
name: andrewrothstein.unarchive-deps
- include_role:
name: andrewrothstein.temurin
vars:
openjdk_app: jre
- name: check for existing install at {{ keycloak_install_dir }}
become: true
become_user: root
stat:
path: '{{ keycloak_install_dir }}'
changed_when: False
changed_when: false
register: keycloak_binary
- when: not keycloak_binary.stat.exists
block:
- name: download tgz
become: yes
- name: downloading {{ keycloak_tgz_url }}...
become: true
become_user: root
get_url:
url: '{{ keycloak_tgz_url }}'
dest: /tmp/{{ keycloak_tgz }}
dest: '{{ keycloak_tmp_tgz }}'
checksum: '{{ keycloak_checksum }}'
mode: 0644
- name: unarchive
become: yes
- name: unarchiving {{ keycloak_tmp_tgz }}
become: true
become_user: root
unarchive:
remote_src: yes
src: /tmp/{{ keycloak_tgz }}
remote_src: true
src: '{{ keycloak_tmp_tgz }}'
dest: '{{ keycloak_parent_install_dir }}'
creates: '{{ keycloak_install_dir }}'
always:
- name: cleanup...
become: yes
- name: rm {{ keycloak_tmp_tgz }}
become: true
become_user: root
file:
path: /tmp/{{ keycloak_tgz }}
path: '{{ keycloak_tmp_tgz }}'
state: absent

- name: link
become: yes
- name: linking {{ keycloak_link_dir }} to {{ keycloak_install_dir }}
become: true
become_user: root
file:
src: '{{ keycloak_install_dir }}'
dest: '{{ keycloak_link_dir }}'
state: link

- name: add to path
become: yes
- name: adding keycloak to the default bash login shell's path
become: true
become_user: root
with_items:
- f: keycloak.sh
Expand Down
2 changes: 1 addition & 1 deletion templates/keycloak.sh.j2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export PATH=$PATH:{{keycloak_link_dir}}/bin
export PATH=$PATH:{{ keycloak_link_dir }}/bin
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
keycloak_name: keycloak-{{ keycloak_ver }}
keycloak_tgz: '{{ keycloak_name }}.tar.gz'
keycloak_tmp_tgz: /tmp/{{ keycloak_tgz }}
keycloak_tgz_url: '{{ keycloak_mirror }}/{{ keycloak_ver }}/{{ keycloak_tgz }}'
keycloak_checksum: '{{ keycloak_checksums[keycloak_ver] }}'

Expand Down