From f8704927fb505e709fd58f756317fa35eb4dd912 Mon Sep 17 00:00:00 2001 From: Crest Date: Mon, 4 Jul 2022 02:58:24 +0200 Subject: [PATCH] Use path variables for bhyve. Changes #31 --- roles/bhyve-s6/tasks/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/bhyve-s6/tasks/main.yml b/roles/bhyve-s6/tasks/main.yml index 1fc9b54..1e75949 100644 --- a/roles/bhyve-s6/tasks/main.yml +++ b/roles/bhyve-s6/tasks/main.yml @@ -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: