|
|
|
|
@ -5,10 +5,6 @@
|
|
|
|
|
# Parameters:
|
|
|
|
|
# playbook inventory
|
|
|
|
|
# stage := the type of the stage (e.g. dev, int, qa, prod)
|
|
|
|
|
# tenant_id := (unique key for the tenant, e.g. customer)
|
|
|
|
|
# cluster_name := (business name for the cluster, e.g. product, department )
|
|
|
|
|
# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave)
|
|
|
|
|
# cluster_services_str := (services to setup, e.g. 'connect,wordpress')
|
|
|
|
|
# smardigo message callback
|
|
|
|
|
# scope_id := (scope id of the management process)
|
|
|
|
|
# process_instance_id := (process instance id of the management process)
|
|
|
|
|
@ -32,20 +28,21 @@
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
cluster_services: "{{ cluster_services_str | split(',') }}"
|
|
|
|
|
- name: "Import autodiscover pre-tasks"
|
|
|
|
|
include_tasks: tasks/autodiscover_pre_tasks.yml
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
- name: Add prometheus servers to hosts if necessary
|
|
|
|
|
add_host:
|
|
|
|
|
name: "{{ stage }}-prometheus-01"
|
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
|
groups:
|
|
|
|
|
- "stage_{{ stage }}"
|
|
|
|
|
- "{{ item }}"
|
|
|
|
|
- "{{ item.service }}"
|
|
|
|
|
stage_server_infos: "{{ stage_server_infos }}"
|
|
|
|
|
changed_when: False
|
|
|
|
|
with_items: "{{ cluster_services }}"
|
|
|
|
|
with_items: "{{ stage_server_infos }}"
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
|
|
|
|
@ -53,27 +50,16 @@
|
|
|
|
|
# update monitoring
|
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
|
|
- hosts: "stage_{{ stage }}"
|
|
|
|
|
- hosts: "{{ stage }}-prometheus-01"
|
|
|
|
|
serial: "{{ serial_number | default(1) }}"
|
|
|
|
|
remote_user: root
|
|
|
|
|
vars:
|
|
|
|
|
ansible_ssh_host: "{{ stage_server_domain }}"
|
|
|
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
|
- name: "Import autodiscover pre-tasks"
|
|
|
|
|
include_tasks: tasks/autodiscover_pre_tasks.yml
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
|
|
|
|
- name: "Parsing cluster_services_str into cluster_services"
|
|
|
|
|
set_fact:
|
|
|
|
|
cluster_services: "{{ cluster_services_str | split(',') }}"
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
- include_role:
|
|
|
|
|
name: prometheus
|
|
|
|
|
tasks_from: _update_config
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
|
|
|
|
@ -81,7 +67,7 @@
|
|
|
|
|
# Sending smardigo management message to process
|
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
|
|
- hosts: "stage_{{ stage }}"
|
|
|
|
|
- hosts: "{{ stage }}-prometheus-01"
|
|
|
|
|
serial: "{{ serial_number | default(1) }}"
|
|
|
|
|
gather_facts: false
|
|
|
|
|
connection: local
|
|
|
|
|
|