Merge "Support deploying Monasca Notification engine"
This commit is contained in:
commit
5d2d270eee
@ -463,6 +463,9 @@ monasca
|
|||||||
[monasca-thresh:children]
|
[monasca-thresh:children]
|
||||||
monasca
|
monasca
|
||||||
|
|
||||||
|
[monasca-notification:children]
|
||||||
|
monasca
|
||||||
|
|
||||||
# Storm
|
# Storm
|
||||||
[storm-worker:children]
|
[storm-worker:children]
|
||||||
storm
|
storm
|
||||||
|
@ -472,6 +472,9 @@ monasca
|
|||||||
[monasca-thresh:children]
|
[monasca-thresh:children]
|
||||||
monasca
|
monasca
|
||||||
|
|
||||||
|
[monasca-notification:children]
|
||||||
|
monasca
|
||||||
|
|
||||||
# Storm
|
# Storm
|
||||||
[storm-worker:children]
|
[storm-worker:children]
|
||||||
storm
|
storm
|
||||||
|
@ -83,6 +83,16 @@ monasca_services:
|
|||||||
- "monasca_thresh:/var/lib/monasca-thresh/"
|
- "monasca_thresh:/var/lib/monasca-thresh/"
|
||||||
- "kolla_logs:/var/log/kolla"
|
- "kolla_logs:/var/log/kolla"
|
||||||
dimensions: "{{ monasca_thresh_dimensions }}"
|
dimensions: "{{ monasca_thresh_dimensions }}"
|
||||||
|
monasca-notification:
|
||||||
|
container_name: monasca_notification
|
||||||
|
group: monasca-notification
|
||||||
|
enabled: true
|
||||||
|
image: "{{ monasca_notification_image_full }}"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/monasca-notification/:{{ container_config_directory }}/:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla"
|
||||||
|
dimensions: "{{ monasca_notification_dimensions }}"
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Databases
|
# Databases
|
||||||
@ -141,12 +151,17 @@ monasca_thresh_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{
|
|||||||
monasca_thresh_tag: "{{ monasca_tag }}"
|
monasca_thresh_tag: "{{ monasca_tag }}"
|
||||||
monasca_thresh_image_full: "{{ monasca_thresh_image }}:{{ monasca_thresh_tag }}"
|
monasca_thresh_image_full: "{{ monasca_thresh_image }}:{{ monasca_thresh_tag }}"
|
||||||
|
|
||||||
|
monasca_notification_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ monasca_install_type }}-monasca-notification"
|
||||||
|
monasca_notification_tag: "{{ monasca_tag }}"
|
||||||
|
monasca_notification_image_full: "{{ monasca_notification_image }}:{{ monasca_notification_tag }}"
|
||||||
|
|
||||||
monasca_api_dimensions: "{{ default_container_dimensions }}"
|
monasca_api_dimensions: "{{ default_container_dimensions }}"
|
||||||
monasca_log_api_dimensions: "{{ default_container_dimensions }}"
|
monasca_log_api_dimensions: "{{ default_container_dimensions }}"
|
||||||
monasca_log_transformer_dimensions: "{{ default_container_dimensions }}"
|
monasca_log_transformer_dimensions: "{{ default_container_dimensions }}"
|
||||||
monasca_log_persister_dimensions: "{{ default_container_dimensions }}"
|
monasca_log_persister_dimensions: "{{ default_container_dimensions }}"
|
||||||
monasca_log_metrics_dimensions: "{{ default_container_dimensions }}"
|
monasca_log_metrics_dimensions: "{{ default_container_dimensions }}"
|
||||||
monasca_thresh_dimensions: "{{ default_container_dimensions }}"
|
monasca_thresh_dimensions: "{{ default_container_dimensions }}"
|
||||||
|
monasca_notification_dimensions: "{{ default_container_dimensions }}"
|
||||||
|
|
||||||
|
|
||||||
####################
|
####################
|
||||||
|
@ -130,3 +130,23 @@
|
|||||||
or monasca_thresh_confs.changed | bool
|
or monasca_thresh_confs.changed | bool
|
||||||
or monasca_thresh_storm_conf.changed | bool
|
or monasca_thresh_storm_conf.changed | bool
|
||||||
or monasca_thresh_container.changed | bool
|
or monasca_thresh_container.changed | bool
|
||||||
|
|
||||||
|
- name: Restart monasca-notification container
|
||||||
|
vars:
|
||||||
|
service_name: "monasca-notification"
|
||||||
|
service: "{{ monasca_services[service_name] }}"
|
||||||
|
config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
|
monasca_notification_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
|
kolla_docker:
|
||||||
|
action: "recreate_or_restart_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
name: "{{ service.container_name }}"
|
||||||
|
image: "{{ service.image }}"
|
||||||
|
volumes: "{{ service.volumes }}"
|
||||||
|
when:
|
||||||
|
- kolla_action != "config"
|
||||||
|
- inventory_hostname in groups[service.group]
|
||||||
|
- service.enabled | bool
|
||||||
|
- config_json.changed | bool
|
||||||
|
or monasca_notification_confs.changed | bool
|
||||||
|
or monasca_notification_container.changed | bool
|
||||||
|
@ -216,6 +216,26 @@
|
|||||||
notify:
|
notify:
|
||||||
- Restart monasca-thresh container
|
- Restart monasca-thresh container
|
||||||
|
|
||||||
|
- name: Copying over monasca-notification config
|
||||||
|
vars:
|
||||||
|
service: "{{ monasca_services['monasca-notification'] }}"
|
||||||
|
merge_configs:
|
||||||
|
sources:
|
||||||
|
- "{{ role_path }}/templates/monasca-notification/{{ item }}.j2"
|
||||||
|
- "{{ node_custom_config }}/monasca/{{ item }}"
|
||||||
|
- "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/{{ item }}"
|
||||||
|
dest: "{{ node_config_directory }}/monasca-notification/{{ item }}"
|
||||||
|
mode: "0660"
|
||||||
|
become: true
|
||||||
|
register: monasca_notification_confs
|
||||||
|
with_items:
|
||||||
|
- notification.conf
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups[service['group']]
|
||||||
|
- service.enabled | bool
|
||||||
|
notify:
|
||||||
|
- Restart monasca-notification container
|
||||||
|
|
||||||
- name: Check monasca containers
|
- name: Check monasca containers
|
||||||
become: true
|
become: true
|
||||||
kolla_docker:
|
kolla_docker:
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
inventory_hostname in groups['monasca-log-transformer'] or
|
inventory_hostname in groups['monasca-log-transformer'] or
|
||||||
inventory_hostname in groups['monasca-log-persister'] or
|
inventory_hostname in groups['monasca-log-persister'] or
|
||||||
inventory_hostname in groups['monasca-log-metrics'] or
|
inventory_hostname in groups['monasca-log-metrics'] or
|
||||||
inventory_hostname in groups['monasca-thresh']
|
inventory_hostname in groups['monasca-thresh'] or
|
||||||
|
inventory_hostname in groups['monasca-notification']
|
||||||
|
|
||||||
- include_tasks: bootstrap.yml
|
- include_tasks: bootstrap.yml
|
||||||
when: inventory_hostname in groups['monasca-api']
|
when: inventory_hostname in groups['monasca-api']
|
||||||
@ -23,4 +24,5 @@
|
|||||||
inventory_hostname in groups['monasca-log-transformer'] or
|
inventory_hostname in groups['monasca-log-transformer'] or
|
||||||
inventory_hostname in groups['monasca-log-persister'] or
|
inventory_hostname in groups['monasca-log-persister'] or
|
||||||
inventory_hostname in groups['monasca-log-metrics'] or
|
inventory_hostname in groups['monasca-log-metrics'] or
|
||||||
inventory_hostname in groups['monasca-thresh']
|
inventory_hostname in groups['monasca-thresh'] or
|
||||||
|
inventory_hostname in groups['monasca-notification']
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"command": "monasca-notification /etc/monasca/notification.conf",
|
||||||
|
"config_files": [
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/notification.conf",
|
||||||
|
"dest": "/etc/monasca/notification.conf",
|
||||||
|
"owner": "monasca",
|
||||||
|
"perm": "0600"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"path": "/var/log/kolla/monasca",
|
||||||
|
"owner": "monasca:kolla",
|
||||||
|
"recurse": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
log_file = monasca-notification.log
|
||||||
|
log_dir = /var/log/kolla/monasca
|
||||||
|
debug = {{ monasca_logging_debug }}
|
||||||
|
|
||||||
|
[kafka]
|
||||||
|
url = {{ monasca_kafka_servers }}
|
||||||
|
alarm_topic = {{ monasca_alarm_state_transitions_topic }}
|
||||||
|
notification_topic = {{ monasca_alarm_notifications_topic }}
|
||||||
|
notification_retry_topic = {{ monasca_alarm_notifications_retry_topic }}
|
||||||
|
periodic = {{ monasca_periodic_notifications_period }}:{{ monasca_periodic_notifications_topic }}
|
||||||
|
|
||||||
|
[mysql]
|
||||||
|
host = {{ database_address }}
|
||||||
|
port = {{ database_port }}
|
||||||
|
user = {{ monasca_database_user }}
|
||||||
|
passwd = {{ monasca_database_password }}
|
||||||
|
db = {{ monasca_database_name }}
|
||||||
|
|
||||||
|
[statsd]
|
||||||
|
# TODO(dszumski): Enable when statsd is deployed
|
||||||
|
enable = false
|
||||||
|
|
||||||
|
[zookeeper]
|
||||||
|
url = {{ monasca_zookeeper_servers }}
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Add support for deploying the Monasca Notification service. The
|
||||||
|
Notification service is responsible for notifiying users when
|
||||||
|
an alert, as defined via the Monasca API, is generated by the
|
||||||
|
Monasca Thresh topology.
|
Loading…
Reference in New Issue
Block a user