Created
May 8, 2017 15:22
-
-
Save Znuff/bbbcc05f8a6183b18f49f1f3437650de 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: myuuidgen is not defined | |
| - name: save to facts | |
| set_fact: | |
| myuuidgen: "{{ uuidgen.stdout }}" | |
| when: myuuidgen is not defined | |
| - name: save to facts.d | |
| template: | |
| src: templates/uuid_template.j2 | |
| dest: /etc/ansible/facts.d/uuidgen | |
| 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