mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +00:00
27 lines
688 B
YAML
27 lines
688 B
YAML
|
- name: "Install packages: uuid-runtime"
|
||
|
package:
|
||
|
name: uuid-runtime
|
||
|
state: present
|
||
|
|
||
|
- name: Does /etc/iiab/uuid exist?
|
||
|
stat:
|
||
|
path: /etc/iiab/uuid
|
||
|
register: uuid_file
|
||
|
|
||
|
- name: If not, run 'uuidgen' to create a uuid, in register uuid_response
|
||
|
command: uuidgen
|
||
|
register: uuid_response
|
||
|
when: not uuid_file.stat.exists
|
||
|
|
||
|
- name: Save it to /etc/iiab/uuid
|
||
|
shell: echo {{ uuid_response.stdout_lines[0] }} > /etc/iiab/uuid
|
||
|
when: not uuid_file.stat.exists
|
||
|
|
||
|
- name: Load /etc/iiab/uuid, into register stored_uuid
|
||
|
command: cat /etc/iiab/uuid
|
||
|
register: stored_uuid
|
||
|
|
||
|
- name: Store it in Ansible variable 'uuid'
|
||
|
set_fact:
|
||
|
uuid: "{{ stored_uuid.stdout_lines[0] }}"
|