ansible/roles/smokeping_prober/tasks/configure.yaml

55 lines
1.7 KiB
YAML
Raw Normal View History

---
- name: create group
ansible.builtin.group:
name: "{{ smokeping_prober_group }}"
system: true
- name: create user
ansible.builtin.user:
name: "{{ smokeping_prober_user }}"
shell: "{{ smokeping_prober_user_shell }}"
home: "{{ smokeping_prober_user_home }}"
system: true
group: "{{ smokeping_prober_group }}"
- name: create var path
ansible.builtin.file:
path: "{{ smokeping_prober_var_path }}"
owner: "{{ smokeping_prober_var_path_owner }}"
group: "{{ smokeping_prober_var_path_group }}"
mode: "{{ smokeping_prober_var_path_mode }}"
state: "{{ smokeping_prober_var_path_state }}"
- name: create etc path
ansible.builtin.file:
path: "{{ smokeping_prober_etc_path }}"
owner: "{{ smokeping_prober_etc_path_owner }}"
group: "{{ smokeping_prober_etc_path_group }}"
mode: "{{ smokeping_prober_etc_path_mode }}"
state: "{{ smokeping_prober_etc_path_state }}"
- name: configure
ansible.builtin.copy:
dest: "{{ smokeping_prober_config_path }}"
owner: "{{ smokeping_prober_config_path_owner }}"
group: "{{ smokeping_prober_config_path_group }}"
mode: "{{ smokeping_prober_config_path_mode }}"
content: "{{ smokeping_prober_config | to_yaml }}"
notify:
- restart smokeping_prober
- name: configure systemd unit
ansible.builtin.template:
src: smokeping_prober.service.j2
dest: "/etc/systemd/system/{{ smokeping_prober_service_name }}"
owner: root
group: root
mode: 0444
notify:
- restart smokeping_prober
- name: manage service
ansible.builtin.service:
name: "{{ smokeping_prober_service_name }}"
enabled: "{{ smokeping_prober_service_enabled | default(true) }}"
state: "{{ smokeping_prober_service_state | default('started') }}"