Browse Source

Merge pull request #4071 from ewolinetz/cherry_pick_htpasswd

Merged by openshift-bot
OpenShift Bot 8 years ago
parent
commit
a04128cf36

+ 5 - 4
openshift-ansible.spec

@@ -25,6 +25,7 @@ Requires:      openshift-ansible-docs = %{version}
 Requires:      java-1.8.0-openjdk-headless
 Requires:      httpd-tools
 Requires:      libselinux-python
+Requires:      python-passlib
 
 %description
 Openshift and Atomic Enterprise Ansible
@@ -316,17 +317,17 @@ Atomic OpenShift Utilities includes
 - Bump ansible rpm dependency to 2.2.2.0 (sdodson@redhat.com)
 
 * Mon May 01 2017 Jenkins CD Merge Bot <tdawson@redhat.com> 3.6.48-1
-- 
+-
 
 * Mon May 01 2017 Jenkins CD Merge Bot <tdawson@redhat.com> 3.6.47-1
-- 
+-
 
 * Mon May 01 2017 Jenkins CD Merge Bot <tdawson@redhat.com> 3.6.46-1
 - Contrib: Hook to verify modules match assembled fragments
   (tbielawa@redhat.com)
 
 * Mon May 01 2017 Jenkins CD Merge Bot <tdawson@redhat.com> 3.6.45-1
-- 
+-
 
 * Sun Apr 30 2017 Jenkins CD Merge Bot <tdawson@redhat.com> 3.6.44-1
 - Refactor etcd roles (jchaloup@redhat.com)
@@ -397,7 +398,7 @@ Atomic OpenShift Utilities includes
 - Remove v1.5 and v1.6 metrics/logging templates (sdodson@redhat.com)
 
 * Sun Apr 23 2017 Jenkins CD Merge Bot <tdawson@redhat.com> 3.6.35-1
-- 
+-
 
 * Fri Apr 21 2017 Jenkins CD Merge Bot <tdawson@redhat.com> 3.6.34-1
 - GlusterFS: provide default for groups.oo_glusterfs_to_config in with_items

+ 9 - 7
roles/openshift_metrics/tasks/generate_hawkular_certificates.yaml

@@ -14,20 +14,22 @@
   changed_when: no
 
 - name: generate password for hawkular metrics
-  local_action: copy dest="{{ local_tmp.stdout}}/{{ item }}.pwd" content="{{ 15 | oo_random_word }}"
+  local_action: copy dest="{{ local_tmp.stdout }}/{{ item }}.pwd" content="{{ 15 | oo_random_word }}"
   with_items:
   - hawkular-metrics
 
+- local_action: slurp src="{{ local_tmp.stdout }}/hawkular-metrics.pwd"
+  register: hawkular_metrics_pwd
+  no_log: true
+
 - name: generate htpasswd file for hawkular metrics
-  local_action: >
-    shell htpasswd -ci
-    '{{ local_tmp.stdout }}/hawkular-metrics.htpasswd' hawkular
-    < '{{ local_tmp.stdout }}/hawkular-metrics.pwd'
+  local_action: htpasswd path="{{ local_tmp.stdout }}/hawkular-metrics.htpasswd" name=hawkular password="{{ hawkular_metrics_pwd.content | b64decode }}"
+  no_log: true
 
 - name: copy local generated passwords to target
   copy:
-    src: "{{local_tmp.stdout}}/{{item}}"
-    dest: "{{mktemp.stdout}}/{{item}}"
+    src: "{{ local_tmp.stdout }}/{{ item }}"
+    dest: "{{ mktemp.stdout }}/{{ item }}"
   with_items:
   - hawkular-metrics.pwd
   - hawkular-metrics.htpasswd