mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Activated auto settings for ldap and smtp
This commit is contained in:
47
roles/docker-openproject/tasks/ldap.yml
Normal file
47
roles/docker-openproject/tasks/ldap.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
- name: "Create LDAP auth source"
|
||||
community.postgresql.postgresql_query:
|
||||
db: openproject
|
||||
login_user: postgres
|
||||
query: >
|
||||
INSERT INTO ldap_auth_sources
|
||||
(name, host, port, account, account_password, base_dn, attr_login,
|
||||
attr_firstname, attr_lastname, attr_mail, onthefly_register, attr_admin,
|
||||
created_at, updated_at, tls_mode, filter_string, verify_peer, tls_certificate_string)
|
||||
VALUES (
|
||||
'{{ openproject_ldap.name }}',
|
||||
'{{ openproject_ldap.host }}',
|
||||
{{ openproject_ldap.port }},
|
||||
'{{ openproject_ldap.account }}',
|
||||
'{{ openproject_ldap.account_password }}',
|
||||
'{{ openproject_ldap.base_dn }}',
|
||||
'{{ openproject_ldap.attr_login }}',
|
||||
'{{ openproject_ldap.attr_firstname }}',
|
||||
'{{ openproject_ldap.attr_lastname }}',
|
||||
'{{ openproject_ldap.attr_mail }}',
|
||||
{{ openproject_ldap.onthefly_register }},
|
||||
'{{ openproject_ldap.attr_admin }}',
|
||||
NOW(),
|
||||
NOW(),
|
||||
{{ openproject_ldap.tls_mode }},
|
||||
'{{ 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
|
||||
|
||||
- name: "Check existing LDAP sources"
|
||||
community.postgresql.postgresql_query:
|
||||
db: openproject
|
||||
login_user: postgres
|
||||
query: "SELECT id, name FROM ldap_auth_sources"
|
||||
register: ldap_entries
|
||||
when: enable_debug | bool
|
||||
|
||||
- name: "Debug LDAP entries"
|
||||
debug:
|
||||
var: ldap_entries
|
||||
when: enable_debug | bool
|
||||
|
@@ -44,3 +44,21 @@
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
|
||||
- name: flush docker service
|
||||
meta: flush_handlers
|
||||
|
||||
- name: "Set OpenProject settings via rails"
|
||||
vars:
|
||||
rails_env: "RAILS_ENV=production"
|
||||
rails_cmd: "bundle exec rails runner"
|
||||
docker_container:
|
||||
name: openproject-web
|
||||
command: >
|
||||
bash -c "cd /app &&
|
||||
{{ rails_env }} {{ rails_cmd }} 'Setting[:{{ item.key }}] = {{ item.value | to_json }}'"
|
||||
loop: "{{ openproject_settings | dict2items }}"
|
||||
|
||||
- name: Setup LDAP
|
||||
include_tasks: ldap.yml
|
||||
when: applications[application_id].ldap.enabled | bool
|
Reference in New Issue
Block a user