From 9cdb8b12b788728dc0b749f00da1359009c75fc3 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Sep 2022 01:46:34 +1200 Subject: [PATCH] remove task when conditionals --- ansible/inventory/host_vars/lab.yaml | 2 +- ansible/roles/sshd/handlers/main.yml | 5 +---- ansible/roles/sshd/tasks/main.yml | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/ansible/inventory/host_vars/lab.yaml b/ansible/inventory/host_vars/lab.yaml index f45dca3..8cb132e 100644 --- a/ansible/inventory/host_vars/lab.yaml +++ b/ansible/inventory/host_vars/lab.yaml @@ -3,7 +3,7 @@ # connection ansible_user: ladmin -ansible_become_user: ladmin +ansible_become_user: root ansible_os_family: Arch # sshd diff --git a/ansible/roles/sshd/handlers/main.yml b/ansible/roles/sshd/handlers/main.yml index ea8be4f..68967ed 100644 --- a/ansible/roles/sshd/handlers/main.yml +++ b/ansible/roles/sshd/handlers/main.yml @@ -3,7 +3,4 @@ - name: restart openssh ansible.builtin.service: name: "{{ openssh_service }}" - state: restarted - when: - - not ansible_check_mode - - not openssh_restart_immediately \ No newline at end of file + state: restarted \ No newline at end of file diff --git a/ansible/roles/sshd/tasks/main.yml b/ansible/roles/sshd/tasks/main.yml index dbdae16..a63ba3b 100644 --- a/ansible/roles/sshd/tasks/main.yml +++ b/ansible/roles/sshd/tasks/main.yml @@ -36,6 +36,4 @@ enabled: yes - name: flush handlers - ansible.builtin.meta: flush_handlers - when: - - openssh_restart_immediately \ No newline at end of file + ansible.builtin.meta: flush_handlers \ No newline at end of file