Skip to content

Commit 1ab9868

Browse files
committed
Cleanup
Renamed ssh_keys_generate_command to ssh_keys_generate_keys_command
1 parent 6c0202c commit 1ab9868

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ None
2323
* `ssh_keys_generate_keys.{n}.size`: [default: `4096`]: Size in bits of the TLS/SSL key to generate
2424
* `ssh_keys_generate_keys.{n}.type`: [default: `RSA`]: The algorithm used to generate the private key
2525

26+
* `ssh_keys_generate_keys_command`: [optional, default: `_ssh_keys_generate_keys_command`]:
27+
* `ssh_keys_generate_keys_become`: [optional, default: `false`]: Whether or not to use `sudo` when generating ssh keys (locally)
28+
2629
* `ssh_keys_private_keys`: [default: `[]`]: Private key declarations
2730
* `ssh_keys_private_keys.{n}.owner`: [required]: The name of the user that should own the file
2831
* `ssh_keys_private_keys.{n}.group`: [default: `owner`]: The name of the group that should own the file
@@ -54,8 +57,6 @@ None
5457
* `ssh_keys_known_hosts.{n}.enctype`: [required]: The type of the fingerprint
5558
* `ssh_keys_known_hosts.{n}.fingerprint`: [required]: The actual fingerprint
5659

57-
* `ssh_keys_generate_keys_local_become`: [optional, default: false]: Whether to use sudo when generating ssh keys locally
58-
5960
## Dependencies
6061

6162
None

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# defaults file
22
---
33
ssh_keys_generate_keys: []
4+
ssh_keys_generate_keys_become: false
45
ssh_keys_private_keys: []
56
ssh_keys_public_keys: []
67
ssh_keys_authorized_keys: []
78
ssh_keys_known_hosts: []
8-
ssh_keys_generate_keys_local_become: false

tasks/generate.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# tasks file
22
---
33
- block:
4+
45
- name: generate | create ssh key generation directory
56
file:
67
path: "{{ item.path | dirname }}"
@@ -13,7 +14,7 @@
1314
- ssh-keys-generate-directories
1415

1516
- name: generate | generate private ssh key
16-
shell: "{{ ssh_keys_generate_command | default(_ssh_keys_generate_command) }}"
17+
shell: "{{ ssh_keys_generate_keys_command | default(_ssh_keys_generate_keys_command) }}"
1718
tags:
1819
- ssh-keys-generate-private-keys
1920
- skip_ansible_lint
@@ -45,5 +46,6 @@
4546
with_items: "{{ ssh_keys_generate_keys }}"
4647
tags:
4748
- ssh-keys-generate-public-keys
49+
4850
delegate_to: localhost
49-
become: "{{ ssh_keys_generate_keys_local_become }}"
51+
become: "{{ ssh_keys_generate_keys_become }}"

vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ssh_keys_sshdir: '.ssh'
44
ssh_keys_private_key_filename: 'id_rsa'
55
ssh_keys_public_key_filename: 'id_rsa.pub'
66
ssh_keys_known_hosts_path: /etc/ssh/ssh_known_hosts
7-
_ssh_keys_generate_command: >-
7+
_ssh_keys_generate_keys_command: >-
88
openssl \
99
gen{{ item.type | default('rsa') }} \
1010
-out {{ item.path }} \

0 commit comments

Comments
 (0)