Deduplicate path literals

Changes #31
This commit is contained in:
Crest 2022-07-04 02:41:15 +02:00
parent b7db27558b
commit 050fb34846
2 changed files with 14 additions and 13 deletions

View file

@ -11,13 +11,13 @@
group: wheel
mode: 0755
with_items:
- /etc/s6-rc
- /etc/s6-rc/service
- /etc/s6-rc/service/enabled
- '{{ s6_etc_dir }}'
- '{{ s6_etc_dir }}/service'
- '{{ s6_etc_dir }}/service/enabled'
- name: Define enabled services bundle
copy:
dest: /etc/s6-rc/service/enabled/type
dest: '{{ s6_etc_dir }}/service/enabled/type'
content: bundle
owner: root
group: wheel
@ -25,7 +25,7 @@
- name: Default to an empty set of enabled servics
file:
path: /etc/s6-rc/service/enabled/contents
path: '{{ s6_etc_dir }}/service/enabled/contents'
state: touch
owner: root
group: wheel
@ -46,15 +46,15 @@
command: >
s6-rc-compile -v 2 .compiled.{{ s6_uuid }} service
args:
creates: /etc/s6-rc/compiled
chdir: /etc/s6-rc
creates: '{{ s6_etc_dir }}/compiled'
chdir: '{{ s6_etc_dir }}'
- name: Link to the latest service database
command: >
env ln -shf .compiled.{{ s6_uuid }} compiled
args:
creates: /etc/s6-rc/compiled
chdir: /etc/s6-rc
creates: '{{ s6_etc_dir }}/compiled'
chdir: '{{ s6_etc_dir }}'
- name: Make sure that tmpfs support is loaded early
lineinfile:
@ -72,7 +72,7 @@
- name: Generate s6-svscan startup script
template:
dest: /etc/s6-rc/scan
dest: '{{ s6_etc_dir }}/scan'
src: scan.j2
owner: root
group: wheel
@ -82,7 +82,7 @@
lineinfile:
path: /etc/ttys
regexp: '^null'
line: 'null "/etc/s6-rc/scan" vt100 on secure'
line: 'null "{{ s6_etc_dir }}/scan" vt100 on secure'
notify:
- Reload /etc/ttys

View file

@ -1,6 +1,7 @@
#!/bin/sh -e
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
scan_dir="{{ s6_scan_dir }}"
install -d -o root -g wheel -m 755 /run/service
exec s6-svscan /run/service
install -d -o root -g wheel -m 755 -- "$scan_dir"
exec s6-svscan "$scan_dir"