- name: premier playbook hosts: master become: true tasks: - name: authorisation ssh user ansible lineinfile: dest: /etc/ssh/sshd_config state: present regexp: '^#Match User anoncvs' line: 'Match User ansible' - name: authorisation source ssh user ansible blockinfile: path: /etc/ssh/sshd_config marker: "#" insertafter: '^Match User ansible' block: | AllowUsers ansible@192.168.14.1 PasswordAuthentication no - name: redémarrage service sshd service: name: ssh state: restarted - name: installer le service bind apt: update_cache: yes name: bind9 state: present - name: verrouillage logon user ansible user: user: ansible password_lock: true