add certs role
This commit is contained in:
parent
6d2c7249bf
commit
ca5e9bd44e
2
roles/certs/defaults/main.yaml
Normal file
2
roles/certs/defaults/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
certs_trusted_ca: {}
|
5
roles/certs/handlers/main.yaml
Normal file
5
roles/certs/handlers/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: update-ca-certificates
|
||||
command: update-ca-certificates
|
||||
|
||||
# vim:ft=yaml.ansible:
|
10
roles/certs/tasks/Debian.yaml
Normal file
10
roles/certs/tasks/Debian.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: add trusted ca certificates
|
||||
copy:
|
||||
dest: "{{ certs_trusted_ca_path }}/{{ item.key }}.crt"
|
||||
content: "{{ item.value }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
loop: "{{ certs_trusted_ca | dict2items }}"
|
||||
notify: update-ca-certificates
|
24
roles/certs/tasks/main.yaml
Normal file
24
roles/certs/tasks/main.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: gather os specific variables
|
||||
include_vars: "{{ lookup('first_found', possible_files) }}"
|
||||
vars:
|
||||
possible_files:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- vars
|
||||
|
||||
- name: include os specific tasks
|
||||
include_tasks: "{{ lookup('first_found', possible_files) }}"
|
||||
vars:
|
||||
possible_files:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- tasks
|
2
roles/certs/vars/Debian.yaml
Normal file
2
roles/certs/vars/Debian.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
certs_trusted_ca_path: /usr/local/share/ca-certificates
|
Loading…
Reference in New Issue
Block a user