--- - name: Playbook pour sécuriser SSH et installer BIND v2 hosts: all become: true tasks: # Secure SSH : - name: sec ssh blockinfile: path: /etc/ssh/sshd_config state: present backup: yes insertafter: "EOF" block: | Match User ansible AllowUsers ansible@10.102.200.111 PasswordAuthentication no - name: restart ssh service: name: sshd state: restarted # Disable login with password : - name: disable login password user: name: ansible password: "!" # Install Bind sur les deux serveur : - name: Install Bind apt: update_cache: yes name: bind9 state: present