mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-12-23 09:00:19 +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
42
README.md
42
README.md
|
@ -39,12 +39,23 @@ It will likely work on other flavours and more direct support via suitable
|
|||
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.
|
||||
|
||||
* 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
|
||||
sshd:
|
||||
|
@ -53,15 +64,17 @@ sshd:
|
|||
- 0.0.0.0
|
||||
```
|
||||
|
||||
* Simple variables can be used rather than a dict. Simple values override dict
|
||||
values:
|
||||
* ssh_...
|
||||
|
||||
Simple variables can be used rather than a dict. Simple values override dict
|
||||
values. e.g.:
|
||||
|
||||
```yaml
|
||||
sshd_Compression: off
|
||||
```
|
||||
|
||||
* Correctly interprets booleans as yes and no in sshd configuration
|
||||
* Supports lists for multi line configuration items:
|
||||
In all cases, booleans correctly rendered as yes and no in sshd configuration.
|
||||
Lists can be used for multiline configuration items. e.g.
|
||||
|
||||
```yaml
|
||||
sshd_ListenAddress:
|
||||
|
@ -69,7 +82,20 @@ 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
|
||||
----------------
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
### USER OPTIONS
|
||||
# Don't apply OS defaults when set to true
|
||||
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
|
||||
sshd: {}
|
||||
|
||||
|
@ -18,3 +20,4 @@ sshd_binary: /usr/sbin/sshd
|
|||
sshd_service: sshd
|
||||
sshd_sftp_server: /usr/lib/openssh/sftp-server
|
||||
sshd_defaults: {}
|
||||
sshd_os_supported: no
|
||||
|
|
|
@ -7,3 +7,4 @@
|
|||
service:
|
||||
name: "{{ sshd_service }}"
|
||||
state: reloaded
|
||||
when: sshd_allow_reload == True
|
||||
|
|
Loading…
Reference in a new issue