mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-12 05:17:38 +02:00
74 lines
2.2 KiB
YAML
74 lines
2.2 KiB
YAML
- name: "load docker, db and proxy for {{ application_id }}"
|
|
include_role:
|
|
name: sys-stk-full-stateful
|
|
vars:
|
|
docker_compose_flush_handlers: false
|
|
|
|
- name: "Render xwiki.cfg"
|
|
template:
|
|
src: "xwiki.cfg.j2"
|
|
dest: "{{ XWIKI_HOST_CONF_PATH }}"
|
|
notify: docker compose up
|
|
|
|
- name: "Render xwiki.properties"
|
|
template:
|
|
src: "xwiki.properties.j2"
|
|
dest: "{{ XWIKI_HOST_PROPERTIES_PATH }}"
|
|
notify: docker compose up
|
|
|
|
- name: "Render hibernate.cfg.xml"
|
|
template:
|
|
src: "hibernate.cfg.xml.j2"
|
|
dest: "{{ XWIKI_HOST_HIBERNATE_PATH }}"
|
|
notify: docker compose up
|
|
|
|
- name: "flush docker compose for '{{ application_id }}'"
|
|
meta: flush_handlers
|
|
|
|
- name: "Wait until XWiki REST is ready"
|
|
uri:
|
|
url: "http://127.0.0.1:{{ XWIKI_HOST_PORT }}/xwiki/rest/"
|
|
status_code: [200, 401]
|
|
return_content: no
|
|
register: xwiki_rest_up
|
|
retries: 60
|
|
delay: 5
|
|
until: xwiki_rest_up is succeeded
|
|
|
|
- name: "Check if OIDC extension installed"
|
|
uri:
|
|
url: "http://127.0.0.1:{{ XWIKI_HOST_PORT }}/xwiki/rest/wikis/xwiki/extensions/{{ XWIKI_EXT_OIDC_ID | urlencode }}"
|
|
method: GET
|
|
user: "{{ XWIKI_ADMIN_USER }}"
|
|
password: "{{ XWIKI_ADMIN_PASS }}"
|
|
force_basic_auth: yes
|
|
status_code: [200,404]
|
|
register: xwiki_oidc_ext
|
|
when: XWIKI_OIDC_ENABLED | bool
|
|
|
|
- name: "Check if LDAP extension installed"
|
|
uri:
|
|
url: "http://127.0.0.1:{{ XWIKI_HOST_PORT }}/xwiki/rest/wikis/xwiki/extensions/{{ XWIKI_EXT_LDAP_ID | urlencode }}"
|
|
method: GET
|
|
user: "{{ XWIKI_ADMIN_USER }}"
|
|
password: "{{ XWIKI_ADMIN_PASS }}"
|
|
force_basic_auth: yes
|
|
status_code: [200,404]
|
|
register: xwiki_ldap_ext
|
|
when: XWIKI_LDAP_ENABLED | bool
|
|
|
|
- name: "Install LDAP and/or OIDC extensions"
|
|
uri:
|
|
url: "{{ XWIKI_REST_BASE }}"
|
|
method: PUT
|
|
user: "{{ XWIKI_ADMIN_USER }}"
|
|
password: "{{ XWIKI_ADMIN_PASS }}"
|
|
force_basic_auth: yes
|
|
headers: { Content-Type: "text/xml" }
|
|
body: "{{ lookup('template', 'installjobrequest.xml.j2') }}"
|
|
status_code: 200
|
|
when:
|
|
- (XWIKI_OIDC_ENABLED | bool and xwiki_oidc_ext.status == 404) or
|
|
(XWIKI_LDAP_ENABLED | bool and (xwiki_ldap_ext is not skipped) and xwiki_ldap_ext.status == 404)
|
|
|
|
- include_tasks: utils/run_once.yml |