Jakub Pavlik | 1af183b | 2015-02-22 18:25:28 +0100 | [diff] [blame] | 1 | {% from "libvirt/map.jinja" import server with context %} |
| 2 | |
| 3 | {%- if server.enabled %} |
| 4 | |
| 5 | libvirt_packages: |
| 6 | pkg.installed: |
| 7 | - names: {{ server.pkgs }} |
| 8 | |
| 9 | libvirtd_config: |
| 10 | file.managed: |
| 11 | - name: {{ server.config }} |
| 12 | - source: salt://libvirt/files/libvirtd.conf.{{ grains.os_family }} |
| 13 | - template: jinja |
| 14 | - require: |
| 15 | - pkg: libvirt_packages |
| 16 | |
| 17 | libvirt_sysconfig: |
| 18 | file.append: |
| 19 | - name: {{ server.config_sys }} |
| 20 | - text: 'LIBVIRTD_ARGS="--listen"' |
| 21 | - require: |
| 22 | - pkg: libvirt_packages |
| 23 | |
| 24 | libvirt_service: |
| 25 | service.running: |
| 26 | - name: {{ server.service }} |
| 27 | - enable: true |
| 28 | - reload: true |
| 29 | - watch: |
Jakub Pavlik | 4c68b14 | 2015-02-22 18:54:05 +0100 | [diff] [blame^] | 30 | - file: libvirtd_config |
Jakub Pavlik | 1af183b | 2015-02-22 18:25:28 +0100 | [diff] [blame] | 31 | |
| 32 | {%- endif %} |