Use path variables for bhyve. Changes #31

This commit is contained in:
Crest 2022-07-04 02:58:24 +02:00
parent 50a3a3d270
commit f8704927fb
1 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
---
- name: Define bhyve guest service definitions
file:
path: '/etc/s6-rc/service/bhyve-{{ item.0.name }}{{ item.1 }}'
path: '{{ s6_etc_dir }}/service/bhyve-{{ item.0.name }}{{ item.1 }}'
state: directory
owner: root
group: wheel
@ -16,7 +16,7 @@
- name: Instantiating service templates
template:
dest: '/etc/s6-rc/service/bhyve-{{ item.0.name }}{{ item.1.name }}'
dest: '{{ s6_etc_dir }}/service/bhyve-{{ item.0.name }}{{ item.1.name }}'
src: 'bhyve{{ item.1.name }}.j2'
owner: root
group: wheel
@ -34,7 +34,7 @@
- name: Start enabled bhyve guests
command: >
fdmove -c 2 1 s6-rc -v 2 -u change bhyve-{{ item.name }}
fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -v 2 -u change bhyve-{{ item.name }}
register: change
when: item.enabled | default
changed_when: change.stdout | length > 0
@ -52,13 +52,13 @@
notify:
- Reload s6-rc
with_items:
- /etc/s6-rc/service/bhyve
- /etc/s6-rc/service/bhyve-disabled
- /etc/s6-rc/service/bhyve-enabled
- '{{ s6_etc_dir }}/service/bhyve'
- '{{ s6_etc_dir }}/service/bhyve-disabled'
- '{{ s6_etc_dir }}/service/bhyve-enabled'
- name: Declare bhyve service as bundle
copy:
dest: '/etc/s6-rc/service/{{ item }}/type'
dest: '{{ s6_etc_dir }}/service/{{ item }}/type'
content: bundle
owner: root
group: wheel
@ -72,7 +72,7 @@
- name: Define bhyve service bundles
template:
dest: '/etc/s6-rc/service/{{ item }}/contents'
dest: '{{ s6_etc_dir }}/service/{{ item }}/contents'
src: '{{ item }}-contents.j2'
owner: root
group: wheel
@ -89,13 +89,13 @@
- name: Stop disabled bhyve guests
command: >
fdmove -c 2 1 s6-rc -v 2 -d change bhyve-disabled
fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -v 2 -d change bhyve-disabled
register: change
changed_when: change.stdout | length > 0
- name: Autostart enabled bhyve guests
lineinfile:
path: /etc/s6-rc/service/enabled/contents
path: '{{ s6_etc_dir }}/service/enabled/contents'
regexp: '^bhyve-enabled$'
line: 'bhyve-enabled'
notify: