src.dualinventive.com/devops/ansible-dtap/rootnet-roles/di-notification-service/tasks/main.yml

70 lines
1.9 KiB
YAML

---
- name: Ensure di-notification-service is present
apt:
name: "{{ item }}"
state: latest
update_cache: yes
cache_valid_time: 3600
with_items:
- "di-notification-service"
notify:
- restart di-notification-service-grpc
- restart di-notification-service-rest
- restart di-notification-service-zmq
- name: Restrict /etc/di directory
file:
path: "/etc/di"
owner: "root"
group: "di-config"
mode: "0750"
state: directory
- name: Template di-notification-service config
template:
src: "notification-service.conf.j2"
dest: "/etc/di/notification-service-{{ item.protocol }}.conf"
owner: "di"
group: "di-config"
mode: "0640"
with_items:
- protocol: "grpc"
logfile: "{{ di_notification_service_logfile_grpc }}"
loglevel: "{{ di_notification_service_loglevel_grpc }}"
- protocol: "rest"
logfile: "{{ di_notification_service_logfile_rest }}"
loglevel: "{{ di_notification_service_loglevel_rest }}"
- protocol: "zmq"
logfile: "{{ di_notification_service_logfile_zmq }}"
loglevel: "{{ di_notification_service_loglevel_zmq }}"
notify:
- restart di-notification-service-grpc
- restart di-notification-service-rest
- restart di-notification-service-zmq
- name: Template di-notification-service config
template:
src: "aws_config.ini.j2"
dest: "{{ di_aws_config_file }}"
owner: "di"
group: "di-config"
mode: "0640"
notify:
- restart di-notification-service-grpc
- restart di-notification-service-rest
- restart di-notification-service-zmq
- name: enable di-notification-service
service:
name: "{{ item }}"
enabled: yes
with_items:
- "di-notification-service-grpc"
- "di-notification-service-rest"
- "di-notification-service-zmq"
notify:
- restart di-notification-service-grpc
- restart di-notification-service-rest
- restart di-notification-service-zmq