1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 19:22:24 +00:00

1-prep/tasks/main.yml: Cleaner

This commit is contained in:
A Holt 2021-07-28 22:39:32 -04:00 committed by GitHub
parent c4989a03ec
commit b911429949
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,33 +8,32 @@
#when: dnsmasq_install # Flag might be used in future?
- name: Install uuid-runtime package (debuntu)
- name: 'Install packages: sudo, uuid-runtime'
package:
name:
- uuid-runtime
name:
- sudo
- uuid-runtime
state: present
when: is_debuntu
- name: Does /etc/iiab/uuid file exist?
stat:
path: /etc/iiab/uuid
register: uuid_file
- name: If no uuid exists, create one
shell: uuidgen
- 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: Put uuid in place at /etc/iiab/uuid
- name: Save it to /etc/iiab/uuid
shell: echo {{ uuid_response.stdout_lines[0] }} > /etc/iiab/uuid
when: not uuid_file.stat.exists
- name: Grab the uuid from /etc/iiab/uuid, into register stored_uuid
- name: Load /etc/iiab/uuid, into register stored_uuid
command: cat /etc/iiab/uuid
register: stored_uuid
- name: Place the uuid from register into variable/fact "uuid"
- name: Store it in Ansible variable 'uuid'
set_fact:
uuid: "{{ stored_uuid.stdout_lines[0] }}"