Solved openproject bugs

This commit is contained in:
Kevin Veen-Birkenbach 2025-04-07 15:24:21 +02:00
parent f9b8f86fce
commit 0b42193d3c
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
4 changed files with 32 additions and 17 deletions

View File

@ -1,7 +1,24 @@
- name: "Create LDAP auth source"
- name: Load LDAP configuration variables
include_vars:
file: "ldap.yml"
- name: Check if LDAP source exists
community.postgresql.postgresql_query:
db: openproject
login_user: postgres
db: "{{ database_name }}"
login_user: "{{ database_username }}"
login_password: "{{ database_password }}"
login_host: "127.0.0.1"
login_port: "{{ database_port }}"
query: "SELECT 1 FROM ldap_auth_sources WHERE name = '{{ openproject_ldap.name }}' LIMIT 1;"
register: ldap_check
- name: Create LDAP auth source if it doesn't exist
community.postgresql.postgresql_query:
db: "{{ database_name }}"
login_user: "{{ database_username }}"
login_password: "{{ database_password }}"
login_host: "127.0.0.1"
login_port: "{{ database_port }}"
query: >
INSERT INTO ldap_auth_sources
(name, host, port, account, account_password, base_dn, attr_login,
@ -26,11 +43,8 @@
'{{ openproject_ldap.filter_string }}',
{{ openproject_ldap.verify_peer }},
'{{ openproject_ldap.tls_certificate_string }}'
)
ON CONFLICT (name) DO NOTHING;
become: true
vars_files:
- vars/ldap.yml
);
when: ldap_check.query_result | length == 0
- name: "Check existing LDAP sources"
community.postgresql.postgresql_query:

View File

@ -57,7 +57,7 @@
command: >
bash -c "cd /app &&
{{ rails_env }} {{ rails_cmd }} 'Setting[:{{ item.key }}] = {{ item.value | to_json }}'"
loop: "{{ openproject_settings | dict2items }}"
loop: "{{ openproject_rails_settings | dict2items }}"
- name: Setup LDAP
include_tasks: ldap.yml

View File

@ -8,3 +8,11 @@ custom_openproject_image: "custom_openproject"
# The following volume doesn't have a practcical function. It just exist to prevent the creation of unnecessary anonymous volumes
dummy_volume: "{{docker_compose.directories.volumes}}dummy_volume"
openproject_rails_settings:
email_delivery_method: "smtp"
smtp_address: "{{ system_email.host }}"
smtp_domain: "{{ system_email.domain }}"
smtp_user_name: "{{ system_email.username }}"
smtp_password: "{{ system_email.password }}"
smtp_ssl: false

View File

@ -1,7 +0,0 @@
openproject_settings:
email_delivery_method: "smtp"
smtp_address: "{{ system_email.host }}"
smtp_domain: "{{ system_email.domain }}"
smtp_user_name: "{{ system_email.username }}"
smtp_password: "{{ system_email.password }}"
smtp_ssl: false