--- - name: Set variables for shifting back set_fact: bootstrap_used: no ansible_user: '{{ bootstrap_expected_user }}' ansible_become_pass: '{{ bootstrap_expected_become_pass }}' - meta: reset_connection - name: Reboot server proper disabling old user reboot: when: - bootstrap_user != "root" - bootstrap_user != bootstrap_expected_user