* Apply "become" on roles instead of plays This leads to facts being gathered for the "regular" login user, instead of root. * Do not rely on ansible_user Instead of reading ansible_user (which may or may not be defined), this patch lets the roles rely on Ansible facts [1]. [1]: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html
16 lines
292 B
YAML
16 lines
292 B
YAML
---
|
|
|
|
- hosts: k3s_cluster
|
|
gather_facts: yes
|
|
roles:
|
|
- role: reset
|
|
become: true
|
|
- role: raspberrypi
|
|
become: true
|
|
vars: {state: absent}
|
|
post_tasks:
|
|
- name: Reboot and wait for node to come back up
|
|
become: true
|
|
reboot:
|
|
reboot_timeout: 3600
|