--- - name: pgsql libs needed apt: pkg: libpq-dev state: installed - name: install psycopg2 pip: name: psycopg2 - name: Setup Postgres DB postgresql_db: name: "{{keycloak_pg_db}}" login_host: "{{keycloak_pg_host}}" login_user: "{{postgres_user}}" login_password: "{{postgres_password}}" - name: Create driver directory file: path: "{{ dd_keycloack_module_path }}" mode: 0750 recurse: yes state: directory - name: Download driver get_url: url: "https://jdbc.postgresql.org/download/postgresql-{{dd_keycloack_driver_version}}.jar" dest: "{{ dd_keycloack_module_path }}" mode: 0750 - name: Templatize the module config template: src: module.xml.j2 dest: "{{ dd_keycloack_module_path }}/module.xml" mode: 0750 - name: Templatize the standalone config template: src: "standalone.xml.j2" dest: /opt/keycloak/standalone/configuration - name: Start keycloak process runit: name: keycloak enabled: yes state: start timeout: 90 user: root group: root command: '/opt/keycloak/bin/standalone.sh -b 0.0.0.0 --server-config=standalone.xml'