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: