- hosts: localhost tasks: - name: "openssh/service : Enable sshd service" service: name: sshd state: started enabled: true - name: "openssh/service : Require networking service" lineinfile: state: present path: /etc/conf.d/sshd insertafter: EOF line: rc_need="networking"