This repository has been archived on 2024-02-18. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-role-ssh-ca/tasks/main.yml

32 lines
672 B
YAML
Raw Normal View History

2023-04-23 21:34:36 +00:00
---
- 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"
2023-04-23 21:47:43 +00:00
mode: 0755
2023-04-23 21:34:36 +00:00
- name: Create keys directory
file:
path: "{{ ssh_ca_dir }}/keys"
state: directory
- name: Copy private keys
2023-04-23 21:34:36 +00:00
copy:
dest: "{{ ssh_ca_dir }}/keys/{{ item.name }}"
content: "{{ item.private_key }}"
2023-04-23 21:47:43 +00:00
mode: 0600
with_items: "{{ ssh_ca_key_pairs }}"
2023-04-23 21:34:36 +00:00
- name: Copy public keys
2023-04-23 21:34:36 +00:00
copy:
dest: "{{ ssh_ca_dir }}/keys/{{ item.name }}.pub"
content: "{{ item.public_key }}"
2023-04-23 21:47:43 +00:00
mode: 0644
with_items: "{{ ssh_ca_key_pairs }}"