Kapisi/roles/Sharingan-Data/tasks/main.yml
2020-10-18 23:49:25 -05:00

96 lines
2.0 KiB
YAML

---
- name: Sharingan data filers
become: yes
package:
state: present
name:
- syslog-ng
- name: Sharingan-Data apps dir
become: yes
file:
path: /etc/syslog-ng/apps.d
state: directory
- name: Sharingan-Data include apps dir
become: yes
lineinfile:
path: /etc/syslog-ng/syslog-ng.conf
line: "{{ item }}"
loop:
- '# Allow compartmentalization of config'
- '@include "apps.d/*.conf"'
- name: Sharingan-Data conf
become: yes
template:
src: graylog.conf.j2
dest: /etc/syslog-ng/apps.d/graylog.conf
owner: root
group: root
mode: 0750
- name: Sharingan-Data filer service
become: yes
copy:
remote_src: yes
src: /usr/lib/systemd/system/syslog-ng@.service
dest: /usr/lib/systemd/system/sharingan-data.service
owner: root
group: root
mode: 0750
- name: Sharingan-Data replace content
become: yes
replace:
path: /usr/lib/systemd/system/sharingan-data.service
regexp: '%i'
replace: 'default'
- name: Sharingan-Data set vanity description
become: yes
lineinfile:
path: /usr/lib/systemd/system/sharingan-data.service
regexp: 'Description='
line: 'Description=AniNIX/Sharingan | Data filer'
- name: Sharingan-Data heartbeat service
become: yes
copy:
src: sharingan-heartbeat.service
dest: /usr/lib/systemd/system
owner: root
group: root
mode: 0750
- name: Sharingan-Data heartbeat timer
become: yes
copy:
src: sharingan-heartbeat.timer
dest: /usr/lib/systemd/system
owner: root
group: root
mode: 0750
- systemd:
daemon_reload: yes
become: yes
- name: Start Sharingan-Data services
become: yes
service:
name: "{{ item }}"
state: started
enabled: yes
loop:
- sharingan-heartbeat.timer
- sharingan-data.service
- name: Disable default service
become: yes
service:
name: syslog-ng@default.service
state: stopped
enabled: no