Ansible Playbook: Execute Specific Tasks Based on Task Status

Ansible Playbook: Execute Specific Tasks Based on Task Status

Ansible Playbook: Execute Specific Tasks Based on Task Status Using Handlers First, let’s take an example of using Ansible to modify the SSH service configuration file and restart the service. The following Playbook can achieve this functionality: – name: set sshd conf ansible.builtin.lineinfile: path: /etc/ssh/sshd_config backrefs: true regexp: "^#?\\s*PermitRootLogin" line: PermitRootLogin yes – name: restart … Read more