Skip to content

Commit

Permalink
Use openssl to generate better quality p12_export_password (#655)
Browse files Browse the repository at this point in the history
We're already doing it this way for CA_password, and ansible's to_uuid is problematic as it uses uuid v5 under the hood (#654)
  • Loading branch information
csirac2 authored and dguido committed Aug 29, 2017
1 parent 8da53f8 commit dd43e1e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion playbooks/facts/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@
become: no
register: CA_password

- name: Generate p12 export password
local_action:
module: shell
openssl rand -hex 4
become: no
register: p12_export_password_generated
when: p12_export_password is not defined

- name: Define password facts
set_fact:
easyrsa_p12_export_password: "{{ p12_export_password|default((ansible_date_time.iso8601_basic|sha1|to_uuid).split('-')[0]) }}"
easyrsa_p12_export_password: "{{ p12_export_password|default(p12_export_password_generated.stdout) }}"
easyrsa_CA_password: "{{ CA_password.stdout }}"

- name: Define the commonName
Expand Down

0 comments on commit dd43e1e

Please sign in to comment.