Skip to content

Commit be4e71b

Browse files
committed
Merge pull request #9 from mvdriel/make-mode-configurable
Make UNIX permission mode bits configurable for public and private keys
2 parents 9d37229 + e1e8e09 commit be4e71b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ None
1313
* `ssh_keys_private_keys`: [default: `[]`]: Private key declarations
1414
* `ssh_keys_private_keys.{n}.owner`: [required]: The name of the user that should own the file
1515
* `ssh_keys_private_keys.{n}.group`: [optional, default `owner`]: The name of the group that should own the file
16+
* `ssh_keys_private_keys.{n}.mode`: [optional, default `0600`]: The UNIX permission mode bits of the file
1617
* `ssh_keys_private_keys.{n}.src`: [required]: The local path of the key
1718
* `ssh_keys_private_keys.{n}.dest`: [optional, default: `id_rsa`]: The remote path of the key (relative to `home/.ssh/`)
1819
* `ssh_keys_private_keys.{n}.state`: [optional, default: `present`]: State
1920

2021
* `ssh_keys_public_keys`: [default: `[]`]: Public key declarations
2122
* `ssh_keys_public_keys.{n}.owner`: [required]: The name of the user that should own the file
2223
* `ssh_keys_public_keys.{n}.group`: [optional, default `owner`]: The name of the group that should own the file
24+
* `ssh_keys_public_keys.{n}.mode`: [optional, default `0644`]: The UNIX permission mode bits of the file
2325
* `ssh_keys_public_keys.{n}.src`: [required]: The local path of the key
2426
* `ssh_keys_public_keys.{n}.dest`: [optional, default: `id_rsa.pub`]: The remote path of the key (relative to `home/.ssh/`)
2527
* `ssh_keys_public_keys.{n}.state`: [optional, default: `present`]: State

tasks/private-keys.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
dest: "~{{ item.owner }}/{{ ssh_keys_sshdir }}/{{ item.dest | default(ssh_keys_private_key_filename) }}"
77
owner: "{{ item.owner }}"
88
group: "{{ item.group | default(item.owner) }}"
9-
mode: 0600
9+
mode: "{{ item.mode | default('0600') }}"
1010
with_items: ssh_keys_private_keys
1111
when: item.state is undefined or item.state == 'present'
1212
tags: [configuration, ssh-keys, ssh-keys-private-keys]

tasks/public-keys.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
dest: "~{{ item.owner }}/{{ ssh_keys_sshdir }}/{{ item.dest | default(ssh_keys_public_key_filename) }}"
77
owner: "{{ item.owner }}"
88
group: "{{ item.group | default(item.owner) }}"
9-
mode: 0644
9+
mode: "{{ item.mode | default('0644') }}"
1010
with_items: ssh_keys_public_keys
1111
when: item.state is undefined or item.state == 'present'
1212
tags: [configuration, ssh-keys, ssh-keys-public-keys]

0 commit comments

Comments
 (0)