From e7bba72cd95159179b5afd4f2b9e6f6d48cba0df Mon Sep 17 00:00:00 2001 From: Tobias Florek Date: Thu, 2 Jun 2016 17:25:10 +0200 Subject: Add flag to manage htpasswd, or not. Setting `openshift_master_manage_htpasswd` falsy will disable managing the htpasswd file. It won't get overwritten/generated. --- roles/openshift_master/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/openshift_master/tasks') diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 63a54a0d9..8ae169dfb 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -93,7 +93,7 @@ src: htpasswd.j2 mode: 0600 backup: yes - when: item.kind == 'HTPasswdPasswordIdentityProvider' + when: item.kind == 'HTPasswdPasswordIdentityProvider' and openshift.master.manage_htpasswd | bool with_items: "{{ openshift.master.identity_providers }}" - name: Create the ldap ca file if needed -- cgit v1.2.3 From 4538443750921273532d97ff653729e95bc52ad9 Mon Sep 17 00:00:00 2001 From: Tobias Florek Date: Thu, 2 Jun 2016 19:36:59 +0200 Subject: ensure htpasswd file exists Also move file mode to the file-exists check to not specify twice. --- roles/openshift_master/tasks/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'roles/openshift_master/tasks') diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 8ae169dfb..476ed4b0c 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -91,11 +91,19 @@ template: dest: "{{ item.filename }}" src: htpasswd.j2 - mode: 0600 backup: yes when: item.kind == 'HTPasswdPasswordIdentityProvider' and openshift.master.manage_htpasswd | bool with_items: "{{ openshift.master.identity_providers }}" +- name: Ensure htpasswd file exists + copy: + dest: "{{ item.filename }}" + force: no + content: "" + mode: 0600 + when: item.kind == 'HTPasswdPasswordIdentityProvider' + with_items: "{{ openshift.master.identity_providers }}" + - name: Create the ldap ca file if needed copy: dest: "{{ item.ca if 'ca' in item and '/' in item.ca else openshift_master_config_dir ~ '/' ~ item.ca | default('ldap_ca.crt') }}" -- cgit v1.2.3