reorg files
This commit is contained in:
parent
cd0ea94173
commit
96cea785f8
5 changed files with 0 additions and 0 deletions
27
tasks/main.yml
Normal file
27
tasks/main.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
- name: include pre_requisite.yml
|
||||
import_tasks: pre_requisite.yml
|
||||
|
||||
- name: creating cnf file
|
||||
template:
|
||||
src: server.cnf.j2
|
||||
dest: '{{cnf_file}}'
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: create csr and key with openssl
|
||||
shell: 'openssl req -new -newkey rsa:2048 -nodes -sha256 -config {{cnf_file}} -out {{csr_file}} -keyout {{key_file}}'
|
||||
|
||||
- name: sign certificate
|
||||
shell: '{{cfssl_bin_directory}}/cfssl sign -remote "{{cfssl_serve_url}}" -profile "{{cfssl_profile}}" {{csr_file}} | cfssljson -bare -stdout > {{cert_file}}'
|
||||
|
||||
- name: remove csr in content certificate
|
||||
shell: 'openssl x509 -in {{cert_file}} -out {{cert_file}}'
|
||||
|
||||
- name: recuperate ca certificate
|
||||
shell: '{{cfssl_bin_directory}}/cfssl info -remote "{{cfssl_serve_url}}" | cfssljson -bare -stdout > /usr/local/share/ca-certificates/{{ca_filename}}'
|
||||
when: integrate_ca
|
||||
|
||||
- name: Update CA Store
|
||||
shell: 'update-ca-certificates'
|
||||
when: integrate_ca
|
22
tasks/pre_requisite.yml
Normal file
22
tasks/pre_requisite.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
- name: Check if cfssl is already available
|
||||
stat:
|
||||
path: '{{cfssl_bin_directory}}/cfssl'
|
||||
register: cfssl_exist
|
||||
- name: Download statically linked cfssl binary
|
||||
get_url:
|
||||
url: https://github.com/cloudflare/cfssl/releases/download/v{{cfssl_version}}/cfssl_{{cfssl_version}}_linux_amd64
|
||||
dest: '{{cfssl_bin_directory}}/cfssl'
|
||||
mode: 0755
|
||||
when: cfssl_exist.stat.exists == false
|
||||
|
||||
- name: Check if cfssljson is already available
|
||||
stat:
|
||||
path: '{{cfssl_bin_directory}}/cfssljson'
|
||||
register: cfssljson_exist
|
||||
- name: Download statically linked cfssljson binary
|
||||
get_url:
|
||||
url: https://github.com/cloudflare/cfssl/releases/download/v{{cfssl_version}}/cfssljson_{{cfssl_version}}_linux_amd64
|
||||
dest: '{{cfssl_bin_directory}}/cfssljson'
|
||||
mode: 0755
|
||||
when: cfssljson_exist.stat.exists == false
|
Loading…
Add table
Add a link
Reference in a new issue