---
- name: Ensure working directory exists
file:
path: "{{ ssh_ca_dir }}"
state: directory
- name: Copy script
template:
src: templates/ssh_ca.sh.j2
dest: "{{ ssh_ca_dir }}/ssh_ca.sh"
mode: 0755
- name: Create keys directory
path: "{{ ssh_ca_dir }}/keys"
- name: Copy private keys
copy:
dest: "{{ ssh_ca_dir }}/keys/{{ item.name }}"
content: "{{ item.private_key }}"
mode: 0600
with_items: "{{ ssh_ca_key_pairs }}"
- name: Copy public keys
dest: "{{ ssh_ca_dir }}/keys/{{ item.name }}.pub"
content: "{{ item.public_key }}"
mode: 0644