ansible-role-chisel/tasks/main.yml
2020-11-25 10:50:28 +01:00

51 lines
1.7 KiB
YAML

---
# tasks file for ansible-role-chisel
# Variable setup.
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- include_tasks: setup-Archlinux.yml
when: ansible_os_family == 'Archlinux'
- name: create chisel service group
group:
name: "{{chisel_group}}"
state: present
when: chisel_server == true
- name: create chisel service user
user:
name: "{{chisel_user}}"
group: "{{chisel_group}}"
shell: /sbin/nologin
append: yes
state: present
create_home: no
when: chisel_server == true
- name: apply chisel server config template
template:
src: chisel-server.conf.j2
dest: "{{ chisel_config_location }}/chisel-server.conf"
mode: 0740
notify:
- restart daemon service
when: chisel_server == true
- name: apply chisel systemd template
template:
dest: "{{ chisel_systemd_location }}/chisel-server.service"
src: chisel-server.service.j2
notify:
- Reload systemd
- restart daemon service
when: chisel_server == true
- name: enable chisel server
service:
name: chisel-server # required. Name of the service.
enabled: true # not required. Whether the service should start on boot. B(At least one of state and enabled are required.)
state: started # not required. choices: reloaded;restarted;started;stopped. C(started)/C(stopped) are idempotent actions that will not run commands unless necessary. C(restarted) will always bounce the service. C(reloaded) will always reload. B(At least one of state and enabled are required.) Note that reloaded will start the service if it is not already started, even if your chosen init system wouldn't normally.
when: chisel_server == true