From a6a21a95656a858eda17ba94f9282e6ba14bc4a2 Mon Sep 17 00:00:00 2001 From: Nikolaos Kakouros Date: Sat, 8 Sep 2018 09:14:39 +0200 Subject: [PATCH] Adds on/off toggle --- README.md | 4 ++++ defaults/main.yml | 3 +++ tasks/main.yml | 4 +--- tasks/sshd.yml | 5 +++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 tasks/sshd.yml diff --git a/README.md b/README.md index 5b7f842..3285572 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,10 @@ Role variables Unconfigured, this role will provide a sshd_config that matches the OS default, minus the comments and in a different order. +* `sshd_enable` + +If set to False, the role will be completely disabled. Defaults to True. + * `sshd_skip_defaults` If set to True, don't apply default values. This means that you must have a diff --git a/defaults/main.yml b/defaults/main.yml index 3f270e7..0c12e60 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,8 @@ --- ### USER OPTIONS +# Set to False to disable this role completely +sshd_enable: True + # Don't apply OS defaults when set to true sshd_skip_defaults: false diff --git a/tasks/main.yml b/tasks/main.yml index 57cb12b..c4878c6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,3 @@ --- -- include_tasks: variables.yml - -- include_tasks: install.yml +- include_tasks: sshd.yml diff --git a/tasks/sshd.yml b/tasks/sshd.yml new file mode 100644 index 0000000..57cb12b --- /dev/null +++ b/tasks/sshd.yml @@ -0,0 +1,5 @@ +--- + +- include_tasks: variables.yml + +- include_tasks: install.yml