diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index 85110a68e..9fabe55e7 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -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] }}"