From 2813d195d186808b26a78569ae1f30a31070f26e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 19 Mar 2018 15:52:33 +0100 Subject: [PATCH] Add automated keygen Signed-off-by: Knut Ahlers --- defaults/main.yml | 3 ++- tasks/act.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6c5e28c..a534569 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,6 @@ --- -git_checkouts: [] +deploy_git_checkouts: [] +deploy_git_keygen: false ... diff --git a/tasks/act.yaml b/tasks/act.yaml index dcf40e0..6a402e5 100644 --- a/tasks/act.yaml +++ b/tasks/act.yaml @@ -1,5 +1,11 @@ --- +- name: Generate deployment SSH key if not available + command: 'ssh-keygen -b 256 -t ed25519 -q -N "" -f "{{ item.key_file }}" -C "Ansible generated deployment key for {{ item.repo }}"' + args: + creates: '{{ item.key_file }}' + when: deploy_git_keygen and item.key_file is defined + - name: Execute pre-commands command: '{{ item.pre_command.command }}' args: