From d8ed3275432ec7d9cb87fc588823228fa6fc8d3b Mon Sep 17 00:00:00 2001 From: lecorguille Date: Wed, 15 May 2019 14:57:08 +0200 Subject: [PATCH 1/5] add auth_conf.xml.sample --- templates/auth_conf.xml.sample | 128 +++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 templates/auth_conf.xml.sample diff --git a/templates/auth_conf.xml.sample b/templates/auth_conf.xml.sample new file mode 100644 index 0000000..34d3069 --- /dev/null +++ b/templates/auth_conf.xml.sample @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localdb + + + true + + + From b603581baf05640edcadfed0b851d0ca0f7b8c6f Mon Sep 17 00:00:00 2001 From: lecorguille Date: Wed, 15 May 2019 14:57:56 +0200 Subject: [PATCH 2/5] auth_conf.xml.sample to j2 --- templates/{auth_conf.xml.sample => auth_conf.xml.j2} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename templates/{auth_conf.xml.sample => auth_conf.xml.j2} (100%) diff --git a/templates/auth_conf.xml.sample b/templates/auth_conf.xml.j2 similarity index 100% rename from templates/auth_conf.xml.sample rename to templates/auth_conf.xml.j2 From 17d5dffa822e31215f3d560f434aa3ea2ed24cc3 Mon Sep 17 00:00:00 2001 From: lecorguille Date: Wed, 15 May 2019 16:19:12 +0200 Subject: [PATCH 3/5] auth_conf.xml template and task --- defaults/main.yml | 32 ++++++++ tasks/conf_template.yml | 17 ++++ tasks/main.yml | 6 ++ templates/auth_conf.xml.j2 | 162 +++++++++++++++++++++---------------- 4 files changed, 149 insertions(+), 68 deletions(-) create mode 100644 tasks/conf_template.yml diff --git a/defaults/main.yml b/defaults/main.yml index 434f473..b49ad6c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,6 +17,7 @@ galaxy_manage_database: yes galaxy_fetch_dependencies: yes galaxy_build_client: yes galaxy_manage_errordocs: no +galaxy_conf_template_setup: no galaxy_backup_configfiles: yes # @@ -257,3 +258,34 @@ galaxy_uwsgi_config_default: # Options include: client / client-production / client-production-maps (default) galaxy_client_make_target: client-production-maps +# +# Authentification configuration +# authen_conf.xml +# https://github.com/galaxyproject/galaxy/blob/dev/config/auth_conf.xml.sample +# +galaxy_auth: + authenticator: + localdb: + allow-password-change: True + ldap: + filter: '{email}'.endswith('@example.com') + allow-register: True + auto-register: False + allow-password-change: False + auto-create-roles: False + auto-create-groups: False + auto-assign-roles-to-groups-only: False + server: ldap://dc1.example.com + ldap-options: OPT_X_TLS_REQUIRE_CERT=OPT_X_TLS_ALLOW + login-use-username: False + continue-on-failure: False + search-fields: uid,mail + search-base: ou=People,dc=example,dc=com + search-filter: (mail={email}) + search-user: cn=jsmith,ou=People,dc=domain,dc=com + search-password: mysecret + bind-user: {dn} + bind-password: {password} + auto-register-username: {uid} + auto-register-email: {mail} + auto-register-roles: {gid} diff --git a/tasks/conf_template.yml b/tasks/conf_template.yml new file mode 100644 index 0000000..aa82574 --- /dev/null +++ b/tasks/conf_template.yml @@ -0,0 +1,17 @@ +--- +# Manage some Galaxy configuration files + +- name: Configuration files from templates setup + block: + + - name: Create Galaxy auth_conf.xml file + template: + src: "auth_conf.xml.j2" + dest: "{{ galaxy_config_file }}" + backup: "{{ galaxy_backup_configfiles }}" + notify: + - "{{ galaxy_restart_handler_name | default('default restart galaxy handler') }}" + + remote_user: "{{ galaxy_remote_users.errdocs | default(omit) }}" + become: "{{ true if galaxy_become_users.errdocs is defined else __galaxy_become }}" + become_user: "{{ galaxy_become_users.errdocs | default(ansible_user_id) }}" diff --git a/tasks/main.yml b/tasks/main.yml index e58fa5f..d9e2195 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -75,3 +75,9 @@ when: galaxy_manage_errordocs tags: - galaxy_manage_errordocs + +- name: Include configuration files from templates setup + include_tasks: conf_template.yml + when: galaxy_conf_template_setup + tags: + - galaxy_conf_template_setup diff --git a/templates/auth_conf.xml.j2 b/templates/auth_conf.xml.j2 index 34d3069..2f897a3 100644 --- a/templates/auth_conf.xml.j2 +++ b/templates/auth_conf.xml.j2 @@ -1,8 +1,17 @@ + - + {% set ldap = galaxy_auth['authenticator']['ldap'] %} + - + - + {% if ldap['allow-register'] is defined %} + ldap['allow-register'] + {% endif %} + - + {% if ldap['auto-register'] is defined %} + ldap['auto-register'] + {% endif %} + - + {% if ldap['allow-password-change'] is defined %} + ldap['allow-password-change'] + {% endif %} + - + {% if ldap['auto-create-roles'] is defined %} + ldap['auto-create-roles'] + {% endif %} + - + {% if ldap['auto-create-groups'] is defined %} + ldap['auto-create-groups'] + {% endif %} + - + {% if ldap['auto-assign-roles-to-groups-only'] is defined %} + ldap['auto-assign-roles-to-groups-only'] + {% endif %} - + {% if ldap['server'] is defined %} + ldap['server'] + {% endif %} + - + {% if ldap['ldap-options'] is defined %} + ldap['ldap-options'] + {% endif %} + - + {% if ldap['login-use-username'] is defined %} + ldap['login-use-username'] + {% endif %} + - + {% if ldap['continue-on-failure'] is defined %} + ldap['continue-on-failure'] + {% endif %} + - - - - - - - - - - - - - - + {% if ldap['search-fields'] is defined %} + ldap['search-fields'] + {% endif %} + {% if ldap['search-base'] is defined %} + ldap['search-base'] + {% endif %} + + {% if ldap['search-filter'] is defined %} + ldap['search-filter'] + {% endif %} + + {% if ldap['search-user'] is defined %} + ldap['search-user'] + {% endif %} + {% if ldap['search-password'] is defined %} + ldap['search-password'] + {% endif %} + - - - - - + {% if ldap['bind-user'] is defined %} + ldap['bind-user'] + {% endif %} + {% if ldap['bind-password'] is defined %} + ldap['bind-password'] + {% endif %} + {% if ldap['auto-register-username'] is defined %} + ldap['auto-register-username'] + {% endif %} + {% if ldap['auto-register-email'] is defined %} + ldap['auto-register-email'] + {% endif %} + {% if ldap['auto-register-roles'] is defined %} + ldap['auto-register-roles'] + {% endif %} + + +{% endif %} +{% if 'localdb' in galaxy_auth['authenticator'] %} localdb + {% set localdb = galaxy_auth['authenticator']['localdb'] %} - true + {{ localdb['allow-password-change']|default("True", true) }} +{% endif %} From c41ecfebe5976f8913dfaab346eef915971c76f0 Mon Sep 17 00:00:00 2001 From: lecorguille Date: Wed, 15 May 2019 16:32:24 +0200 Subject: [PATCH 4/5] auth_cong comment ldap settings --- defaults/main.yml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b49ad6c..0a10186 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -267,25 +267,25 @@ galaxy_auth: authenticator: localdb: allow-password-change: True - ldap: - filter: '{email}'.endswith('@example.com') - allow-register: True - auto-register: False - allow-password-change: False - auto-create-roles: False - auto-create-groups: False - auto-assign-roles-to-groups-only: False - server: ldap://dc1.example.com - ldap-options: OPT_X_TLS_REQUIRE_CERT=OPT_X_TLS_ALLOW - login-use-username: False - continue-on-failure: False - search-fields: uid,mail - search-base: ou=People,dc=example,dc=com - search-filter: (mail={email}) - search-user: cn=jsmith,ou=People,dc=domain,dc=com - search-password: mysecret - bind-user: {dn} - bind-password: {password} - auto-register-username: {uid} - auto-register-email: {mail} - auto-register-roles: {gid} + # ldap: + # filter: "'{email}'.endswith('@example.com')" + # allow-register: True + # auto-register: False + # allow-password-change: False + # auto-create-roles: False + # auto-create-groups: False + # auto-assign-roles-to-groups-only: False + # server: "ldap://dc1.example.com" + # ldap-options: "OPT_X_TLS_REQUIRE_CERT=OPT_X_TLS_ALLOW" + # login-use-username: False + # continue-on-failure: False + # search-fields: "uid,mail" + # search-base: "ou=People,dc=example,dc=com" + # search-filter: "(mail={email})" + # search-user: "cn=jsmith,ou=People,dc=domain,dc=com" + # search-password: "mysecret" + # bind-user: "{dn}" + # bind-password: "{password}" + # auto-register-username: "{uid}" + # auto-register-email: "{mail}" + # auto-register-roles: "{gid}" From 6846b4135c131819aa0c5ea4d34b9f8dfd2c253a Mon Sep 17 00:00:00 2001 From: lecorguille Date: Sun, 30 Jun 2019 09:24:04 +0200 Subject: [PATCH 5/5] auth - remove the task since it existed --- defaults/main.yml | 1 - tasks/conf_template.yml | 17 ----------------- tasks/main.yml | 6 ------ 3 files changed, 24 deletions(-) delete mode 100644 tasks/conf_template.yml diff --git a/defaults/main.yml b/defaults/main.yml index 0a10186..0accaa5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,7 +17,6 @@ galaxy_manage_database: yes galaxy_fetch_dependencies: yes galaxy_build_client: yes galaxy_manage_errordocs: no -galaxy_conf_template_setup: no galaxy_backup_configfiles: yes # diff --git a/tasks/conf_template.yml b/tasks/conf_template.yml deleted file mode 100644 index aa82574..0000000 --- a/tasks/conf_template.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# Manage some Galaxy configuration files - -- name: Configuration files from templates setup - block: - - - name: Create Galaxy auth_conf.xml file - template: - src: "auth_conf.xml.j2" - dest: "{{ galaxy_config_file }}" - backup: "{{ galaxy_backup_configfiles }}" - notify: - - "{{ galaxy_restart_handler_name | default('default restart galaxy handler') }}" - - remote_user: "{{ galaxy_remote_users.errdocs | default(omit) }}" - become: "{{ true if galaxy_become_users.errdocs is defined else __galaxy_become }}" - become_user: "{{ galaxy_become_users.errdocs | default(ansible_user_id) }}" diff --git a/tasks/main.yml b/tasks/main.yml index d9e2195..e58fa5f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -75,9 +75,3 @@ when: galaxy_manage_errordocs tags: - galaxy_manage_errordocs - -- name: Include configuration files from templates setup - include_tasks: conf_template.yml - when: galaxy_conf_template_setup - tags: - - galaxy_conf_template_setup