mirror of
https://github.com/willshersystems/ansible-sshd
synced 2025-01-10 17:20:18 +01:00
Allow reload to be skipped
This commit is contained in:
parent
849257c2f4
commit
964496fcd1
3 changed files with 40 additions and 10 deletions
46
README.md
46
README.md
|
@ -39,12 +39,23 @@ It will likely work on other flavours and more direct support via suitable
|
||||||
Role variables
|
Role variables
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
* Unconfigured, this role will provide a sshd_config that matches the OS default,
|
Unconfigured, this role will provide a sshd_config that matches the OS default,
|
||||||
minus the comments and in a different order.
|
minus the comments and in a different order.
|
||||||
|
|
||||||
* Defaults can be disabled by setting `sshd_skip_defaults: true`
|
* sshd_skip_defaults
|
||||||
|
|
||||||
* Supports use of a dict to configure items:
|
If set to True, don't apply default values. This means that you must have a
|
||||||
|
complete set of configuration defaults via either the sshd dict, or sshd_Key
|
||||||
|
variables. Defaults to *False*.
|
||||||
|
|
||||||
|
* sshd_allow_reload
|
||||||
|
|
||||||
|
If set to False, a reload of sshd wont happen on change. This can help with
|
||||||
|
troubleshooting. Defaults to *True*.
|
||||||
|
|
||||||
|
* sshd
|
||||||
|
|
||||||
|
A dict containing configuration. e.g.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sshd:
|
sshd:
|
||||||
|
@ -53,15 +64,17 @@ sshd:
|
||||||
- 0.0.0.0
|
- 0.0.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
* Simple variables can be used rather than a dict. Simple values override dict
|
* ssh_...
|
||||||
values:
|
|
||||||
|
Simple variables can be used rather than a dict. Simple values override dict
|
||||||
|
values. e.g.:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sshd_Compression: off
|
sshd_Compression: off
|
||||||
```
|
```
|
||||||
|
|
||||||
* Correctly interprets booleans as yes and no in sshd configuration
|
In all cases, booleans correctly rendered as yes and no in sshd configuration.
|
||||||
* Supports lists for multi line configuration items:
|
Lists can be used for multiline configuration items. e.g.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sshd_ListenAddress:
|
sshd_ListenAddress:
|
||||||
|
@ -69,11 +82,24 @@ sshd_ListenAddress:
|
||||||
- '::'
|
- '::'
|
||||||
```
|
```
|
||||||
|
|
||||||
* Supports match section either via Match in the sshd dict, sshd_match and any of sshd_match_1 through sshd_match_9. Match items can either be a dict or an array.
|
Renders as:
|
||||||
|
|
||||||
|
```
|
||||||
|
ListenAddress 0.0.0.0
|
||||||
|
ListenAddress ::
|
||||||
|
```
|
||||||
|
|
||||||
|
* sshd_match
|
||||||
|
|
||||||
|
A list of dicts for a match section. See the example playbook.
|
||||||
|
|
||||||
|
* sshd_match_1 through sshd_match_9
|
||||||
|
|
||||||
|
A list of dicts or just a dict for a Match section.
|
||||||
|
|
||||||
Example Playbook
|
Example Playbook
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
|
@ -98,7 +124,7 @@ Example Playbook
|
||||||
|
|
||||||
Results in:
|
Results in:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Ansible managed: ...
|
# Ansible managed: ...
|
||||||
Compression yes
|
Compression yes
|
||||||
GSSAPIAuthentication no
|
GSSAPIAuthentication no
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
### USER OPTIONS
|
### USER OPTIONS
|
||||||
# Don't apply OS defaults when set to true
|
# Don't apply OS defaults when set to true
|
||||||
sshd_skip_defaults: false
|
sshd_skip_defaults: false
|
||||||
|
# If the below is false, don't reload the ssh deamon on change
|
||||||
|
sshd_allow_reload: yes
|
||||||
# Empty dicts to avoid errors
|
# Empty dicts to avoid errors
|
||||||
sshd: {}
|
sshd: {}
|
||||||
|
|
||||||
|
@ -18,3 +20,4 @@ sshd_binary: /usr/sbin/sshd
|
||||||
sshd_service: sshd
|
sshd_service: sshd
|
||||||
sshd_sftp_server: /usr/lib/openssh/sftp-server
|
sshd_sftp_server: /usr/lib/openssh/sftp-server
|
||||||
sshd_defaults: {}
|
sshd_defaults: {}
|
||||||
|
sshd_os_supported: no
|
||||||
|
|
|
@ -7,3 +7,4 @@
|
||||||
service:
|
service:
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
when: sshd_allow_reload == True
|
||||||
|
|
Loading…
Reference in a new issue