aboutsummaryrefslogtreecommitdiffstats
path: root/roles/rc/tasks
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-15 18:21:17 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-15 21:39:50 +0000
commit2927544ce379f607670768cc61252039c627058a (patch)
tree216d9faab9f92e30db21a5f56954ab977b059730 /roles/rc/tasks
parent46113df6b183c392a016053c29c694d65d5a9cfb (diff)
downloadrules-2927544ce379f607670768cc61252039c627058a.tar.gz
roles: Add rc for service file creation
Supports openrc and rc for Alpine and OpenBSD
Diffstat (limited to 'roles/rc/tasks')
-rw-r--r--roles/rc/tasks/main.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/rc/tasks/main.yml b/roles/rc/tasks/main.yml
new file mode 100644
index 0000000..c691aae
--- /dev/null
+++ b/roles/rc/tasks/main.yml
@@ -0,0 +1,16 @@
+- name: check required variables
+ fail:
+ when: >
+ rc_name is none or
+ rc_user is none
+
+- name: include rc task per-system
+ include_vars: "os_{{ ansible_distribution | lower }}.yml"
+
+- name: generate rc script for desired service
+ template:
+ src: "os_{{ ansible_distribution | lower }}.j2"
+ dest: "{{ rc_dir }}/{{ rc_name }}"
+ owner: 0
+ group: 0
+ mode: 0755
remember that computers suck.