Add automated keygen

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-03-19 15:52:33 +01:00
parent 85393ae446
commit 2813d195d1
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
---
git_checkouts: []
deploy_git_checkouts: []
deploy_git_keygen: false
...

View File

@ -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: