mirror of
https://github.com/trailofbits/algo.git
synced 2025-07-25 06:53:00 +02:00
24 lines
765 B
YAML
24 lines
765 B
YAML
---
|
|
|
|
- name: Generate the SSH private key
|
|
local_action: shell echo -e 'n' | ssh-keygen -b 2048 -C {{ SSH_keys.comment }} -t rsa -f {{ SSH_keys.private }} -q -N ""
|
|
args:
|
|
creates: "{{ SSH_keys.private }}"
|
|
|
|
- name: Generate the SSH public key
|
|
local_action: shell echo `ssh-keygen -y -f {{ SSH_keys.private }}` {{ SSH_keys.comment }} > {{ SSH_keys.public }}
|
|
changed_when: false
|
|
|
|
- name: Change mode for the SSH private key
|
|
local_action: file path={{ SSH_keys.private }} mode=0600
|
|
|
|
- name: Ensure the dynamic inventory exists
|
|
blockinfile:
|
|
dest: configs/inventory.dynamic
|
|
marker: "# {mark} ALGO MANAGED BLOCK"
|
|
create: yes
|
|
block: |
|
|
[algo:children]
|
|
{% for group in cloud_providers.keys() %}
|
|
{{ group }}
|
|
{% endfor %}
|