Basic implementation of masakari-monitors
With this change masakari-monitors will be installed on hosts which are in group masakari-monitor (supposed to be nova compute hosts) hostmonitor depends on pacemaker with corosync, which are implemented by https://github.com/mit-scripts/ansible-pacemaker-corosync Masakari api/engine config was simplified and unneccesary defaults were removed from it. Role now uses default ``systemd_service`` role for systemctl configuration Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk> Implements: blueprint masakari-ansible-plugin Change-Id: I334877c0111a45d3f3a74e7f56931786f4301713
This commit is contained in:
parent
77022b2442
commit
d0e8674f92
@ -82,11 +82,19 @@ masakari_pip_packages:
|
||||
- uwsgi
|
||||
- keystoneauth1
|
||||
|
||||
masakari_monitor_pip_packages:
|
||||
- masakari-monitors
|
||||
- systemd-python
|
||||
|
||||
## Tunable overrides
|
||||
masakari_api_paste_ini_overrides: {}
|
||||
masakari_masakari_conf_overrides: {}
|
||||
masakari_policy_json_overrides: {}
|
||||
masakari_api_init_overrides: {}
|
||||
masakari_engine_init_overrides: {}
|
||||
masakari_monitors_conf_overrides: {}
|
||||
masakari_monitors_process_overrides: {}
|
||||
masakari_monitors_init_overrides: {}
|
||||
|
||||
## Service Type and Data
|
||||
masakari_service_region: RegionOne
|
||||
@ -120,6 +128,7 @@ masakari_api_service_port: 15868
|
||||
masakari_enable_v1_api: True
|
||||
|
||||
masakari_etc_dir: /etc/masakari
|
||||
masakari_monitor_etc_dir: /etc/masakarimonitors
|
||||
masakari_log_dir: /var/log/masakari
|
||||
masakari_config_options: --config-file {{ masakari_etc_dir }}/masakari.conf
|
||||
|
||||
@ -128,9 +137,28 @@ masakari_services:
|
||||
masakari-api:
|
||||
group: masakari_api
|
||||
service_name: masakari-api
|
||||
execstarts: "{{ masakari_bin }}/masakari-api"
|
||||
config_overrides: "{{ masakari_api_init_overrides }}"
|
||||
masakari-engine:
|
||||
group: masakari_engine
|
||||
service_name: masakari-engine
|
||||
execstarts: "{{ masakari_bin }}/masakari-engine"
|
||||
config_overrides: "{{ masakari_engine_init_overrides }}"
|
||||
masakari-hostmonitor:
|
||||
group: masakari_monitor
|
||||
service_name: masakari-hostmonitor
|
||||
execstarts: "{{ masakari_bin }}/masakari-hostmonitor"
|
||||
config_overrides: "{{ masakari_monitors_init_overrides }}"
|
||||
masakari-instancemonitor:
|
||||
group: masakari_monitor
|
||||
service_name: masakari-instancemonitor
|
||||
execstarts: "{{ masakari_bin }}/masakari-instancemonitor"
|
||||
config_overrides: "{{ masakari_monitors_init_overrides }}"
|
||||
masakari-processmonitor:
|
||||
group: masakari_monitor
|
||||
service_name: masakari-processmonitor
|
||||
execstarts: "{{ masakari_bin }}/masakari-processmonitor"
|
||||
config_overrides: "{{ masakari_monitors_init_overrides }}"
|
||||
|
||||
# This variable is used by the repo_build process to determine
|
||||
# which host group to check for members of before building the
|
||||
@ -167,3 +195,6 @@ masakari_oslomsg_amqp1_enabled: "{{ masakari_oslomsg_rpc_transport == 'amqp' }}"
|
||||
|
||||
masakari_optional_oslomsg_amqp1_pip_packages:
|
||||
- oslo.messaging[amqp1]
|
||||
|
||||
# The multicase interface for corocync to use for masakari hostmonitor
|
||||
masakari_monitor_corosync_multicast_interface: "br-mgmt"
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The ``os_masakari`` role now covers the monitors installation and configuration,
|
||||
completing the full service configuration.
|
@ -37,9 +37,33 @@
|
||||
tags:
|
||||
- masakari-config
|
||||
|
||||
- include_tasks: masakari_init_common.yml
|
||||
- name: Run the systemd service role
|
||||
include_role:
|
||||
name: systemd_service
|
||||
private: true
|
||||
vars:
|
||||
systemd_user_name: "{{ masakari_system_user_name }}"
|
||||
systemd_group_name: "{{ masakari_system_group_name }}"
|
||||
systemd_tempd_prefix: openstack
|
||||
systemd_slice_name: masakari
|
||||
systemd_lock_path: /var/lock/masakari
|
||||
systemd_CPUAccounting: true
|
||||
systemd_BlockIOAccounting: true
|
||||
systemd_MemoryAccounting: true
|
||||
systemd_TasksAccounting: true
|
||||
systemd_services: |-
|
||||
{% set services = [] %}
|
||||
{% for service in masakari_services.values() %}
|
||||
{% if service.group in group_names %}
|
||||
{% set _ = service.update({'enabled': 'yes', 'state': 'started'}) %}
|
||||
{% set _ = service.pop('group') %}
|
||||
{% set _ = services.append(service) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ services }}
|
||||
tags:
|
||||
- masakari-config
|
||||
- systemd-service
|
||||
|
||||
- import_tasks: mq_setup.yml
|
||||
when:
|
||||
|
@ -1,66 +0,0 @@
|
||||
---
|
||||
# Copyright (c) 2018 NTT DATA
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Create TEMP run dir
|
||||
file:
|
||||
path: "/var/run/{{ item.value.service_name }}"
|
||||
state: directory
|
||||
owner: "{{ masakari_system_user_name }}"
|
||||
group: "{{ masakari_system_group_name }}"
|
||||
mode: "02755"
|
||||
with_dict: "{{ masakari_services }}"
|
||||
when: inventory_hostname in groups[item.value.group]
|
||||
|
||||
- name: Create TEMP lock dir
|
||||
file:
|
||||
path: "/var/lock/{{ item.value.service_name }}"
|
||||
state: directory
|
||||
owner: "{{ masakari_system_user_name }}"
|
||||
group: "{{ masakari_system_group_name }}"
|
||||
mode: "02755"
|
||||
with_dict: "{{ masakari_services }}"
|
||||
when: inventory_hostname in groups[item.value.group]
|
||||
|
||||
- name: Cleanup old tmpfiles.d entry
|
||||
file:
|
||||
path: "/etc/tmpfiles.d/{{ item.value.service_name }}.conf"
|
||||
state: absent
|
||||
with_dict: "{{ masakari_services }}"
|
||||
when: inventory_hostname in groups[item.value.group]
|
||||
|
||||
- name: Create tmpfiles.d entry
|
||||
template:
|
||||
src: "masakari-systemd-tmpfiles.j2"
|
||||
dest: "/etc/tmpfiles.d/openstack-{{ item.value.service_name }}.conf"
|
||||
mode: "0644"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
with_dict: "{{ masakari_services }}"
|
||||
when: inventory_hostname in groups[item.value.group]
|
||||
|
||||
- name: Place the systemd init script
|
||||
config_template:
|
||||
src: "masakari-systemd-init.j2"
|
||||
dest: "/etc/systemd/system/{{ item.value.service_name }}.service"
|
||||
mode: "0644"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
# config_overrides: "{{ item.value.init_config_overrides }}"
|
||||
config_type: "ini"
|
||||
with_dict: "{{ masakari_services }}"
|
||||
when: inventory_hostname in groups[item.value.group]
|
||||
notify:
|
||||
- Restart masakari services
|
||||
|
@ -40,10 +40,45 @@
|
||||
private: yes
|
||||
vars:
|
||||
venv_install_destination_path: "{{ masakari_bin | dirname }}"
|
||||
venv_install_distro_package_list: "{{ masakari_distro_packages }}"
|
||||
venv_install_distro_package_list: >-
|
||||
{{ ('masakari_monitor' in group_names) | ternary(masakari_monitor_distro_packages, masakari_distro_packages) }}
|
||||
venv_build_distro_package_list: "{{ masakari_devel_distro_packages }}"
|
||||
venv_pip_install_args: "{{ masakari_pip_install_args }}"
|
||||
venv_pip_packages: "{{ (masakari_oslomsg_amqp1_enabled | bool) | ternary(masakari_pip_packages + masakari_optional_oslomsg_amqp1_pip_packages, masakari_pip_packages) }}"
|
||||
venv_pip_packages: "{{ masakari_venv_pip_packages }}"
|
||||
venv_facts_when_changed:
|
||||
- section: "masakari"
|
||||
option: "venv_tag"
|
||||
value: "{{ masakari_venv_tag }}"
|
||||
|
||||
- block:
|
||||
- name: Find the venv's python version
|
||||
find:
|
||||
paths: "{{ masakari_bin | dirname }}/lib/"
|
||||
patterns: "python*"
|
||||
file_type: directory
|
||||
recurse: no
|
||||
register: python_venv_details
|
||||
|
||||
- name: Set python venvs details
|
||||
set_fact:
|
||||
venv_python_version: "{{ (python_venv_details.files[0].path | basename) }}"
|
||||
venv_python_major_version: "{{ (python_venv_details.files[0].path | basename)[:-2] }}"
|
||||
venv_python_lib_folder: "{{ python_venv_details.files[0].path }}"
|
||||
|
||||
- name: Search for lib files to link
|
||||
shell: >-
|
||||
{{ (ansible_pkg_mgr == 'apt') | ternary('dpkg -L ' ~ (masakari_monitor_packages_to_symlink | join(' ')), 'rpm -ql ' ~ (masakari_monitor_packages_to_symlink | join(' ')) ) }}
|
||||
| egrep '^.*{{ venv_python_major_version }}.*/(site|dist)-packages/.*\.(py|so)'
|
||||
args:
|
||||
warn: no
|
||||
changed_when: false
|
||||
register: _python_files
|
||||
|
||||
- name: Link the python host package files into venv
|
||||
file:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ venv_python_lib_folder }}/site-packages/{{ item | basename }}"
|
||||
state: link
|
||||
force: yes
|
||||
with_items: "{{ _python_files.stdout_lines }}"
|
||||
when: "'masakari_monitor' in group_names"
|
||||
|
@ -28,13 +28,36 @@
|
||||
dest: "{{ masakari_etc_dir }}/api-paste.ini"
|
||||
config_overrides: "{{ masakari_api_paste_ini_overrides }}"
|
||||
config_type: "ini"
|
||||
condition: "{{ masakari_services['masakari-api']['group'] in group_names or masakari_services['masakari-engine']['group'] in group_names }}"
|
||||
- src: "masakari.conf.j2"
|
||||
dest: "{{ masakari_etc_dir }}/masakari.conf"
|
||||
config_overrides: "{{ masakari_masakari_conf_overrides }}"
|
||||
config_type: "ini"
|
||||
condition: "{{ masakari_services['masakari-api']['group'] in group_names or masakari_services['masakari-engine']['group'] in group_names }}"
|
||||
- src: "policy.json.j2"
|
||||
dest: "{{ masakari_etc_dir }}/policy.json"
|
||||
config_overrides: "{{ masakari_policy_json_overrides }}"
|
||||
config_type: "json"
|
||||
condition: "{{ masakari_services['masakari-api']['group'] in group_names or masakari_services['masakari-engine']['group'] in group_names }}"
|
||||
- src: "masakarimonitors.conf.j2"
|
||||
dest: "{{ masakari_monitor_etc_dir }}/masakarimonitors.conf"
|
||||
config_overrides: "{{ masakari_monitors_conf_overrides }}"
|
||||
config_type: "ini"
|
||||
condition: "{{ 'masakari_monitor' in group_names }}"
|
||||
- src: "process_list.yaml.j2"
|
||||
dest: "{{ masakari_monitor_etc_dir }}/process_list.yaml"
|
||||
config_overrides: "{{ masakari_monitors_process_overrides }}"
|
||||
config_type: "yaml"
|
||||
condition: "{{ 'masakari_monitor' in group_names }}"
|
||||
notify:
|
||||
- Restart masakari services
|
||||
|
||||
- name: Deploy masakari-monitors sudoers files
|
||||
template:
|
||||
src: "masakari_sudoers.j2"
|
||||
dest: "/etc/sudoers.d/masakari_sudoers"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0440"
|
||||
validate: '/usr/sbin/visudo -cf %s'
|
||||
when: "'masakari_monitor' in group_names"
|
||||
|
@ -38,11 +38,22 @@
|
||||
owner: "{{ item.owner|default(masakari_system_user_name) }}"
|
||||
group: "{{ item.group|default(masakari_system_group_name) }}"
|
||||
mode: "{{ item.mode|default(omit) }}"
|
||||
when: item.condition | default(True)
|
||||
with_items:
|
||||
- { path: "/openstack", mode: "0755", owner: "root", group: "root" }
|
||||
- { path: "{{ masakari_etc_dir }}", mode: "0750" }
|
||||
- { path: "{{ masakari_log_dir }}", mode: "0755" }
|
||||
- { path: "{{ masakari_system_user_home }}" }
|
||||
- { path: "{{ masakari_system_user_home }}/cache/api", mode: "0700" }
|
||||
- { path: "{{ masakari_system_user_home }}/cache/registry" }
|
||||
- { path: "{{ masakari_system_user_home }}/scrubber" }
|
||||
- path: "/openstack"
|
||||
mode: "0755"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
- path: "{{ masakari_etc_dir }}"
|
||||
mode: "0750"
|
||||
condition: "{{ masakari_services['masakari-api']['group'] in group_names or masakari_services['masakari-engine']['group'] in group_names }}"
|
||||
- path: "{{ masakari_monitor_etc_dir }}"
|
||||
mode: "0750"
|
||||
condition: "{{ inventory_hostname in groups['masakari_monitor'] }}"
|
||||
- path: "{{ masakari_log_dir }}"
|
||||
mode: "0755"
|
||||
- path: "{{ masakari_system_user_home }}"
|
||||
- path: "{{ masakari_system_user_home }}/cache/api"
|
||||
mode: "0700"
|
||||
- path: "{{ masakari_system_user_home }}/cache/registry"
|
||||
- path: "{{ masakari_system_user_home }}/scrubber"
|
||||
|
@ -1,34 +0,0 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Unit]
|
||||
Description=masakari openstack service
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ masakari_system_user_name }}
|
||||
Group={{ masakari_system_group_name }}
|
||||
|
||||
{% if item.value.program_override is defined %}
|
||||
ExecStart={{ item.value.program_override }} {{ item.value.program_config_options|default('') }} {{ item.value.log_string | default('--log-file=') }}/{{ masakari_log_dir }}/{{ item.value.service_name }}.log
|
||||
{% else %}
|
||||
ExecStart={{ masakari_bin }}/{{ item.value.service_name }} {{ item.value.program_config_options|default('') }} --log-file={{ masakari_log_dir }}/{{ item.value.service_name }}.log
|
||||
{% endif %}
|
||||
|
||||
# Give a reasonable amount of time for the server to start up/shut down
|
||||
TimeoutSec=120
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
# This creates a specific slice which all services will operate from
|
||||
# The accounting options give us the ability to see resource usage through
|
||||
# the `systemd-cgtop` command.
|
||||
Slice=masakari.slice
|
||||
CPUAccounting=true
|
||||
BlockIOAccounting=true
|
||||
MemoryAccounting=false
|
||||
TasksAccounting=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,5 +0,0 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
D /var/lock/{{ item.value.service_name }} 2755 {{ masakari_system_user_name }} {{ masakari_system_group_name }}
|
||||
D /var/run/{{ item.value.service_name }} 2755 {{ masakari_system_user_name }} {{ masakari_system_group_name }}
|
||||
|
@ -6,34 +6,20 @@ masakari_api_listen = 0.0.0.0
|
||||
# Enable to specify port other than default
|
||||
masakari_api_listen_port = 15868
|
||||
debug = False
|
||||
auth_strategy=keystone
|
||||
log_dir = {{ masakari_log_dir }}
|
||||
wait_period_after_service_update = 180
|
||||
masakari_topic = ha_engine
|
||||
engine_manager = masakari.engine.manager.MasakariManager
|
||||
host_failure_recovery_threads = 3
|
||||
wait_period_after_power_off = 60
|
||||
wait_period_after_evacuation = 90
|
||||
verify_interval = 1
|
||||
wait_period_after_power_off = 60
|
||||
verify_interval = 1
|
||||
auth_strategy = keystone
|
||||
notification_driver = taskflow_driver
|
||||
process_unfinished_notifications_interval = 120
|
||||
retry_notification_new_status_interval = 60
|
||||
duplicate_notification_detection_interval = 180
|
||||
osapi_max_limit = 1000
|
||||
retry_notification_new_status_interval = 60
|
||||
duplicate_notification_detection_interval = 180
|
||||
osapi_max_limit = 1000
|
||||
fatal_exception_format_errors = false
|
||||
nova_catalog_admin_info = compute:Compute Service:publicURL
|
||||
nova_api_insecure = false
|
||||
report_interval = 10
|
||||
periodic_enable = true
|
||||
periodic_interval_max = 300
|
||||
periodic_fuzzy_delay = 60
|
||||
use_ssl = false
|
||||
# Nova endpoint
|
||||
nova_catalog_admin_info = compute:nova:adminURL
|
||||
nova_api_insecure = "{{ keystone_service_adminuri_insecure | default("false") }}"
|
||||
# Priveleged credentials to interact with nova
|
||||
os_privileged_user_tenant = {{ masakari_service_project_name }}
|
||||
os_privileged_user_auth_url = {{ keystone_service_adminuri }}
|
||||
os_privileged_user_name = {{ masakari_service_user_name }}
|
||||
os_privileged_user_password = {{ masakari_service_password }}
|
||||
service_down_time = 60
|
||||
periodic_enable = true
|
||||
use_ssl = false
|
||||
|
||||
[wsgi]
|
||||
# The paste configuration file path
|
||||
@ -48,11 +34,14 @@ user_domain_id = {{ masakari_service_project_domain_id }}
|
||||
project_name = {{ masakari_service_project_name }}
|
||||
username = {{ masakari_service_user_name }}
|
||||
password = {{ masakari_service_password }}
|
||||
memcached_servers = {{ memcached_servers }}
|
||||
memcache_security_strategy = ENCRYPT
|
||||
memcache_secret_key = {{ memcached_encryption_key }}
|
||||
service_token_roles_required = True
|
||||
|
||||
[database]
|
||||
connection = mysql+pymysql://{{ masakari_galera_user }}:{{ masakari_container_mysql_password }}@{{ masakari_galera_address }}/{{ masakari_galera_database }}?charset=utf8{% if masakari_galera_use_ssl | bool %}&ssl_ca={{ masakari_galera_ssl_ca_cert }}{% endif %}
|
||||
|
||||
|
||||
[host_failure]
|
||||
evacuate_all_instances = true
|
||||
add_reserved_host_to_aggregate = false
|
||||
|
6
templates/masakari_sudoers.j2
Normal file
6
templates/masakari_sudoers.j2
Normal file
@ -0,0 +1,6 @@
|
||||
# Ansible managed
|
||||
|
||||
Defaults:masakari !requiretty
|
||||
Defaults:masakari secure_path="{{ masakari_bin }}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
masakari ALL = (root) NOPASSWD: {{ masakari_bin }}/privsep-helper
|
30
templates/masakarimonitors.conf.j2
Normal file
30
templates/masakarimonitors.conf.j2
Normal file
@ -0,0 +1,30 @@
|
||||
[DEFAULT]
|
||||
host = {{ ansible_host }}
|
||||
processmonitor_manager = masakarimonitors.processmonitor.process.ProcessmonitorManager
|
||||
hostmonitor_manager = masakarimonitors.hostmonitor.host.HostmonitorManager
|
||||
use_journal = true
|
||||
|
||||
[api]
|
||||
region = {{ masakari_service_region }}
|
||||
api_version = v1
|
||||
api_interface = internal
|
||||
auth_url = {{ keystone_service_adminuri }}
|
||||
www_authenticate_uri = {{ keystone_service_internaluri }}
|
||||
project_name = {{ masakari_service_project_name }}
|
||||
project_domain_id = {{ masakari_service_project_domain_id }}
|
||||
username = {{ masakari_service_user_name }}
|
||||
user_domain_id = {{ masakari_service_user_domain_id }}
|
||||
password = {{ masakari_service_password }}
|
||||
|
||||
[host]
|
||||
disable_ipmi_check = True
|
||||
corosync_multicast_interfaces = {{ masakari_monitor_corosync_multicast_interface }}
|
||||
corosync_multicast_ports = 5405
|
||||
|
||||
[process]
|
||||
check_interval = 5
|
||||
restart_retries = 3
|
||||
restart_interval = 5
|
||||
api_retry_max = 12
|
||||
api_retry_interval = 10
|
||||
process_list_path = /etc/masakarimonitors/process_list.yaml
|
62
templates/process_list.yaml.j2
Normal file
62
templates/process_list.yaml.j2
Normal file
@ -0,0 +1,62 @@
|
||||
# Define the monitoring processes as follows:
|
||||
# process_name: [Name of the process as it in 'ps -ef'.]
|
||||
# start_command: [Start command of the process.]
|
||||
# pre_start_command: [Command which is executed before start_command.]
|
||||
# post_start_command: [Command which is executed after start_command.]
|
||||
# restart_command: [Restart command of the process.]
|
||||
# pre_restart_command: [Command which is executed before restart_command.]
|
||||
# post_restart_command: [Command which is executed after restart_command.]
|
||||
# run_as_root: [Bool value whether to execute commands as root authority.]
|
||||
#
|
||||
# These definitions need to be set according to the environment to use.
|
||||
# Sample of definitions is shown below.
|
||||
-
|
||||
# libvirt-bin
|
||||
process_name: /usr/sbin/libvirtd
|
||||
start_command: systemctl start libvirt-bin
|
||||
pre_start_command:
|
||||
post_start_command:
|
||||
restart_command: systemctl restart libvirt-bin
|
||||
pre_restart_command:
|
||||
post_restart_command:
|
||||
run_as_root: True
|
||||
-
|
||||
# nova-compute
|
||||
process_name: {{ (ansible_local.openstack_ansible.nova.install_method == "source") | ternary("/openstack/venvs/nova-{{ nova_venv_tag }}/bin/nova-compute", "/usr/bin") }}
|
||||
start_command: systemctl start nova-compute
|
||||
pre_start_command:
|
||||
post_start_command:
|
||||
restart_command: systemctl restart nova-compute
|
||||
pre_restart_command:
|
||||
post_restart_command:
|
||||
run_as_root: True
|
||||
-
|
||||
# instancemonitor
|
||||
process_name: {{ masakari_bin }}/masakari-instancemonitor
|
||||
start_command: systemctl start masakari-instancemonitor
|
||||
pre_start_command:
|
||||
post_start_command:
|
||||
restart_command: systemctl restart masakari-instancemonitor
|
||||
pre_restart_command:
|
||||
post_restart_command:
|
||||
run_as_root: True
|
||||
-
|
||||
# hostmonitor
|
||||
process_name: {{ masakari_bin }}/masakari-hostmonitor
|
||||
start_command: systemctl start masakari-hostmonitor
|
||||
pre_start_command:
|
||||
post_start_command:
|
||||
restart_command: systemctl restart masakari-hostmonitor
|
||||
pre_restart_command:
|
||||
post_restart_command:
|
||||
run_as_root: True
|
||||
-
|
||||
# sshd
|
||||
process_name: /usr/sbin/sshd
|
||||
start_command: systemctl start ssh
|
||||
pre_start_command:
|
||||
post_start_command:
|
||||
restart_command: systemctl restart ssh
|
||||
pre_restart_command:
|
||||
post_restart_command:
|
||||
run_as_root: True
|
@ -39,6 +39,10 @@
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
|
||||
scm: git
|
||||
version: master
|
||||
- name: os_nova
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-os_nova
|
||||
scm: git
|
||||
version: master
|
||||
- name: os_tempest
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-os_tempest
|
||||
scm: git
|
||||
|
@ -18,7 +18,7 @@ container_networks:
|
||||
address: "{{ ansible_host }}"
|
||||
bridge: "br-mgmt"
|
||||
interface: "eth1"
|
||||
netmask: "255.255.252.0"
|
||||
netmask: "255.255.255.0"
|
||||
type: "veth"
|
||||
physical_host: localhost
|
||||
properties:
|
||||
|
@ -13,15 +13,4 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- include_tasks: masakari_init_systemd.yml
|
||||
when:
|
||||
- ansible_service_mgr == 'systemd'
|
||||
|
||||
- name: Load service
|
||||
service:
|
||||
name: "{{ item.value.service_name }}"
|
||||
enabled: "yes"
|
||||
with_dict: "{{ masakari_services }}"
|
||||
when: inventory_hostname in groups[item.value.group]
|
||||
notify:
|
||||
- Restart masakari services
|
||||
ansible_host: 10.1.1.1
|
@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ansible_host: 10.1.0.2
|
||||
ansible_host: 10.1.1.101
|
||||
container_name: infra1
|
||||
ansible_become: True
|
||||
ansible_user: root
|
||||
container_name: infra1
|
||||
|
@ -15,4 +15,4 @@
|
||||
|
||||
bridges:
|
||||
- name: "br-mgmt"
|
||||
ip_addr: "10.1.0.1"
|
||||
ip_addr: "10.1.1.1"
|
||||
|
@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ansible_host: 10.1.0.3
|
||||
ansible_host: 10.1.1.103
|
||||
container_name: masakari1
|
||||
ansible_become: True
|
||||
ansible_user: root
|
||||
container_name: masakari1
|
||||
|
19
tests/host_vars/openstack1.yml
Normal file
19
tests/host_vars/openstack1.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
# Copyright (c) 2018 NTT DATA
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ansible_host: 10.1.1.102
|
||||
container_name: openstack1
|
||||
ansible_become: True
|
||||
ansible_user: root
|
@ -2,9 +2,12 @@
|
||||
localhost
|
||||
infra1
|
||||
masakari1
|
||||
openstack1
|
||||
compute1
|
||||
|
||||
[all_containers]
|
||||
infra1
|
||||
openstack1
|
||||
masakari1
|
||||
|
||||
[oslomsg_rpc_all]
|
||||
@ -28,17 +31,45 @@ galera_all
|
||||
memcached_all
|
||||
|
||||
[keystone_all]
|
||||
infra1
|
||||
openstack1
|
||||
|
||||
[masakari_all:children]
|
||||
masakari_api
|
||||
masakari_engine
|
||||
masakari_monitor
|
||||
|
||||
[utility_all]
|
||||
masakari1
|
||||
openstack1
|
||||
|
||||
[masakari_api]
|
||||
masakari1
|
||||
|
||||
[masakari_engine]
|
||||
masakari1
|
||||
|
||||
[masakari_monitor]
|
||||
compute1
|
||||
|
||||
[nova_compute]
|
||||
compute1
|
||||
|
||||
[nova_conductor]
|
||||
openstack1
|
||||
|
||||
[nova_console]
|
||||
|
||||
[nova_api_metadata]
|
||||
|
||||
[nova_api_os_compute]
|
||||
openstack1
|
||||
|
||||
[nova_scheduler]
|
||||
|
||||
[nova_api_placement]
|
||||
openstack1
|
||||
|
||||
[nova_all:children]
|
||||
nova_compute
|
||||
nova_conductor
|
||||
nova_api_os_compute
|
||||
nova_api_placement
|
@ -22,6 +22,9 @@
|
||||
# Install Keystone
|
||||
- import_playbook: common/test-install-keystone.yml
|
||||
|
||||
# Install Nova
|
||||
- import_playbook: common/test-install-nova.yml
|
||||
|
||||
# Install Masakari
|
||||
- import_playbook: test-install-masakari.yml
|
||||
|
||||
|
27
vars/main.yml
Normal file
27
vars/main.yml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
# Copyright (c) 2018 NTT DATA
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
masakari_venv_pip_packages: |-
|
||||
{% set pip_packages = [] %}
|
||||
{% if masakari_services['masakari-api']['group'] in group_names or masakari_services['masakari-engine']['group'] in group_names %}
|
||||
{% set _ = pip_packages.extend(masakari_pip_packages) %}
|
||||
{% endif %}
|
||||
{% if 'masakari_monitor' in group_names %}
|
||||
{% set _ = pip_packages.extend(masakari_monitor_pip_packages) %}
|
||||
{% endif %}
|
||||
{% if masakari_oslomsg_amqp1_enabled | bool %}
|
||||
{% set _ = pip_packages.extend(masakari_optional_oslomsg_amqp1_pip_packages) %}
|
||||
{% endif %}
|
||||
{{ pip_packages }}
|
@ -15,7 +15,16 @@
|
||||
|
||||
masakari_distro_packages:
|
||||
- git
|
||||
- libxml2-devel
|
||||
- rpcbind
|
||||
- rsync
|
||||
- which
|
||||
|
||||
masakari_devel_distro_packages:
|
||||
- libxml2-devel
|
||||
- systemd-devel
|
||||
|
||||
masakari_monitor_distro_packages:
|
||||
- libvirt-python
|
||||
- systemd-devel
|
||||
|
||||
masakari_monitor_packages_to_symlink:
|
||||
- libvirt-python
|
||||
|
@ -1,23 +1,32 @@
|
||||
---
|
||||
# Copyright (c) 2018 NTT DATA
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
masakari_distro_packages:
|
||||
- cronie
|
||||
- cronie-anacron
|
||||
- git-core
|
||||
- libxml2-devel
|
||||
- rpcbind
|
||||
- rsync
|
||||
- which
|
||||
---
|
||||
# Copyright (c) 2018 NTT DATA
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
masakari_distro_packages:
|
||||
- cronie
|
||||
- cronie-anacron
|
||||
- git-core
|
||||
- rpcbind
|
||||
- which
|
||||
|
||||
masakari_devel_distro_packages:
|
||||
- libxml2-devel
|
||||
- systemd-devel
|
||||
|
||||
masakari_monitor_distro_packages:
|
||||
- "{{ (ansible_distribution_version is version ('42', '>=')) | ternary('libvirt-python', 'python2-libvirt-python') }}"
|
||||
- systemd-devel
|
||||
|
||||
masakari_monitor_packages_to_symlink:
|
||||
- "{{ (ansible_distribution_version is version ('42', '>=')) | ternary('libvirt-python', 'python2-libvirt-python') }}"
|
||||
|
@ -16,7 +16,16 @@
|
||||
## APT Cache options
|
||||
cache_timeout: 600
|
||||
|
||||
# Common apt packages
|
||||
masakari_distro_packages:
|
||||
- git
|
||||
|
||||
masakari_devel_distro_packages:
|
||||
- libsystemd-dev
|
||||
- libxml2-dev
|
||||
|
||||
masakari_monitor_distro_packages:
|
||||
- libsystemd-dev
|
||||
- python-libvirt
|
||||
|
||||
masakari_monitor_packages_to_symlink:
|
||||
- python-libvirt
|
||||
|
Loading…
x
Reference in New Issue
Block a user