From 43ed7c19a2be6f183b60dd8a068e809178a194b8 Mon Sep 17 00:00:00 2001 From: Matt Willsher Date: Thu, 4 May 2017 14:31:26 +0100 Subject: [PATCH] Fix Ansible 2.3 warnings --- .gitignore | 1 + defaults/main.yml | 6 ++---- handlers/main.yml | 2 +- tasks/main.yml | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index fa9f20a..ac9a57d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vagrant tests/roles/ansible-sshd +tests/test.retry diff --git a/defaults/main.yml b/defaults/main.yml index b27764b..8c175c0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,11 +4,9 @@ sshd_skip_defaults: false # If the below is false, don't manage the service or reload the SSH # daemon at all -sshd_manage_service: "{{ false if ansible_virtualization_type == 'docker' else true }}" +sshd_manage_service: true # If the below is false, don't reload the ssh deamon on change -sshd_allow_reload: "{{ sshd_manage_service }}" -# If the below is false, don't manage /var/run/sshd directory -sshd_manage_var_run: "{{ false if ansible_os_family == 'Archlinux' or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7') else true }}" +sshd_allow_reload: true # Empty dicts to avoid errors sshd: {} diff --git a/handlers/main.yml b/handlers/main.yml index cfa9281..b5d29b4 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -3,4 +3,4 @@ service: name: "{{ sshd_service }}" state: reloaded - when: sshd_allow_reload \ No newline at end of file + when: sshd_allow_reload and ansible_virtualization_type != 'docker' diff --git a/tasks/main.yml b/tasks/main.yml index c66615d..05e9343 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -43,7 +43,7 @@ name: "{{ sshd_service }}" enabled: true state: started - when: sshd_manage_service + when: sshd_manage_service and ansible_virtualization_type != 'docker' tags: - sshd