Add ansible_certificate custom fact
This commit is contained in:
parent
0ae634aed2
commit
c9b21a3286
2 changed files with 26 additions and 0 deletions
|
@ -30,6 +30,21 @@
|
|||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: add ansible certificate fact
|
||||
copy:
|
||||
content: |
|
||||
#!/bin/sh
|
||||
[ -f {{ tls_certs }}/{{ inventory_hostname }}.crt ] && awk '
|
||||
BEGIN { printf "\"" }
|
||||
{ if (!/^-\-/) printf "%s",$0 }
|
||||
END { print "\"" }
|
||||
' {{ tls_certs }}/{{ inventory_hostname }}.crt
|
||||
|
||||
dest: /etc/ansible/facts.d/ansible_certificate.fact
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: create full chain of host certficate and ca
|
||||
shell: "cat {{ tls_certs }}/{{ inventory_hostname }}.crt \
|
||||
{{ tls_certs }}/ca.crt > \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue