xoxys.cacerts/tasks/main.yml

40 lines
1.0 KiB
YAML
Raw Normal View History

2019-11-09 15:48:19 +00:00
---
- name: Include OS specific vars
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
2019-11-09 15:48:19 +00:00
vars:
params:
files:
- "{{ ansible_lsb.id | default('') | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
paths:
- "vars"
errors: "ignore"
- name: Install required packages
ansible.builtin.package:
name: "{{ item }}"
state: present
loop: "{{ cacerts_packages_extra + cacerts_packages }}"
- name: Ensure ca path exists '{{ __cacerts_ca_trust_source }}'
ansible.builtin.file:
path: "{{ __cacerts_ca_trust_source }}"
state: directory
mode: "0755"
- name: Install custom ca certs
ansible.builtin.copy:
src: "{{ item.path }}"
dest: "{{ __cacerts_ca_trust_source }}/{{ item.name }}"
owner: root
group: root
mode: "0640"
register: __ca_add
loop: "{{ cacerts_ca_certs }}"
loop_control:
label: "{{ item.name }}"
- name: Update cert index
ansible.builtin.command: "{{ __cacerts_ca_update_command }}"
changed_when: __ca_add.changed