--- - hosts: srv remote_user: root tasks: - name: création de sioadm user: name: sioadm state: present generate_ssh_key: yes password: "{{ 'sioadm' | password_hash('sha512') }}" uid: 1200 groups: sudo append: yes register: mavar - name: debug debug: msg: "{{ mavar }}" - name: export clé publique authorized_key: user: "{{ sioadm }}" key: /sioadm/.ssh/id_rsa.pub state: present - name: désinstaller paquets wpasupplicant apt : name : wpasupplicant state: absent - name: désinstaller paquets rpcbindd apt : name : rpcbind state: absent - name: copie fichier resolv.conf copy: src:resolv.conf dest:/etc - name: disable SSH access for root lineinfile: path: /etc/ssh/sshd_config regexp: '^(.*)#PermitRootLogin prohibit-password(.*)$" replace: "PermitRootLogin prohibit-password" - name: copie fichier sshd_config copy: src:sshd_config dest:/etc/ssh/