--- - name: Remove static ip configuration. file: path: /etc/NetworkManager/system-connections/static.nmconnection state: absent - name: Remove temporary key from root's authorized_keys. authorized_key: state: absent user: root path: /root/.ssh/authorized_keys key: "{{ tmp_pub_key }}" manage_dir: true - name: Disable ssh server. systemd: name: sshd enabled: false state: stopped