diff --git a/playbooks/new-machine-id.yml b/playbooks/new-machine-id.yml new file mode 100644 index 0000000..f61bfdf --- /dev/null +++ b/playbooks/new-machine-id.yml @@ -0,0 +1,22 @@ +- name: Change machine-id in Debian + hosts: all + gather_facts: no + become: yes + tasks: + - name: Remove files with old machine-id + file: + path: "{{ item }}" + state: absent + loop: + - /etc/machine-id + - /var/lib/dbus/machine-id + + - name: Ensure a new UUID is generated for /etc/machine-id + command: + cmd: dbus-uuidgen --ensure=/etc/machine-id + + - name: Create symbolic link for /var/lib/dbus/machine-id + file: + src: /etc/machine-id + dest: /var/lib/dbus/machine-id + state: link