--- - 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: Setup le Systemd copy: src: keycloak_systemd dest: /lib/systemd/system/keycloak.service owner: root group: root mode: 0644 - name: run the keycloak systemd: name: keycloak state: started enabled: yes