Last active
May 8, 2017 15:54
-
-
Save Znuff/e960d12fec30ccc758c79543bd6c1bcb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: uuidgen for libvirtd config | |
| hosts: cloudini-hosts | |
| gather_facts: True | |
| # facts.d will automatically be read, so that myuuidgen will be populated if it is defined | |
| tasks: | |
| - name: create directory for ansible custom facts | |
| file: state=directory recurse=yes path=/etc/ansible/facts.d | |
| - name: run uuidgen if necessary | |
| shell: uuidgen | |
| register: uuidgen | |
| when: uuid is not defined | |
| - name: save to facts | |
| set_fact: | |
| uuid: "{{ uuidgen.stdout }}" | |
| when: uuid is not defined | |
| - name: save to facts.d | |
| template: | |
| src: templates/uuid_template.j2 | |
| dest: /etc/ansible/facts.d/uuid | |
| force: False | |
| - name: re-read facts | |
| setup: filter=ansible_local | |
| - name: configure libvirtd.conf with uuid | |
| template: | |
| src: templates/libvirtd.conf.j2 | |
| dest: /etc/libvirt/libvirtd.conf | |
| force: True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment