Fix monasca

This ensures the dependencies on the monasca roles are deployed
after the initial deploy steps of monasca. This allows us to
install on the host the packages required for the extra roles,
until they are fixed. Moreover, the grafana-ansible role is being
moved to ansible-grafana from cloudalchemy repository.

Change-Id: I9381c4994e38933fd12c02c673bfe409daf2a59c
Co-Authored-By: Guilherme Steinmüller <guilhermesp@lsd.ufcg.edu.br>
This commit is contained in:
Jean-Philippe Evrard 2018-06-28 09:56:48 +02:00 committed by Guilherme Steinmüller
parent 4b46ce34a7
commit 0e4da819fd
15 changed files with 116 additions and 91 deletions

View File

@ -71,9 +71,9 @@ monasca_system_shell: /bin/false
monasca_system_comment: monasca system user
monasca_system_user_home: "/var/lib/{{ monasca_system_user_name }}"
## DB info
magnum_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
magnum_galera_address: "{{ galera_address | default('127.0.0.1') }}"
## Database info
monasca_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
monasca_galera_address: "{{ galera_address | default('127.0.0.1') }}"
monasca_galera_database: monasca
monasca_galera_user: monasca
@ -276,6 +276,7 @@ monasca_pip_packages:
- PyOpenSSL
- python-monascaclient
- python-memcached
- future
## Service Names
monasca_services:
@ -320,3 +321,4 @@ monasca_persister_config_overrides: {}
monasca_persister_logging_config_overrides: {}
monasca_thresh_config_overrides: {}
monasca_notification_config_overrides: {}

View File

@ -0,0 +1,71 @@
---
# Copyright 2018, SUSE LINUX GmbH.
#
# 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.
#
# (c) 2018 Jean-Philippe Evrard <jean-philippe@evrard.me>
- name: Install ansible-zookeeper
hosts: monasca_zookeeper
roles:
- ansible-zookeeper
tags:
- zookeeper
- skip_ansible_lint
- monasca-install
- name: Install ansible-kafka
hosts: monasca_kafka
roles:
- ansible-kafka
vars:
kafka_listen_address: "{{ ansible_host }}"
tags:
- kafka
- skip_ansible_lint
- monasca-install
- name: Install ansible-storm
hosts: monasca_api
roles:
- ansible-storm
vars:
storm_nimbus_enabled: True
storm_supervisor_enabled: True
nimbus_host: "{{ ansible_ssh_host }}"
tags:
- storm
- skip_ansible_lint
- monasca-install
- name: Install ansible-influxdb
hosts: monasca_influxdb
roles:
- ansible-influxdb
tags:
- influxdb
- skip_ansible_lint
- monasca-install
- name: Install ansible-grafana
hosts: monasca_grafana
roles:
- ansible-grafana
vars:
grafana_security:
admin_user: admin
admin_password: "{{ monasca_grafana_password | default('password') }}" #TODO(evrardjp) remove this when ready
tags:
- grafana
- skip_ansible_lint
- monasca-install

View File

@ -11,6 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Please check your inventory to install the appropriate
# dependencies for your monasca install
# Please also make sure the appropriate roles are installed.
- name: Install monasca dependencies
include: monasca-dependencies.yml
- name: Install monasca server
hosts: monasca_all
user: root

View File

@ -1,16 +0,0 @@
---
- name: ansible-zookeeper
scm: git
src: https://github.com/Chillisystems/ansible-zookeeper
- name: ansible-kafka
scm: git
src: https://github.com/flaviodsr/ansible-kafka
- name: ansible-storm
scm: git
src: https://github.com/flaviodsr/ansible-storm
- name: ansible-influxdb
scm: git
src: https://github.com/flaviodsr/ansible-influxdb
- name: grafana-ansible
scm: git
src: https://github.com/flaviodsr/grafana-ansible

View File

@ -1,6 +1,7 @@
---
grafana_admin_password:
grafana_galera_password:
monasca_grafana_password:
monasca_container_mysql_password:
monasca_influxdb_admin_password:
monasca_api_influxdb_password:

View File

@ -144,17 +144,7 @@ import os # NOQA
try:
from monascaclient import client
except ImportError:
# In many installs the python-monascaclient is available in a venv, switch
# to the most common location
activate_this = os.path.realpath(
'/opt/venvs/monasca-client/bin/activate_this.py')
try:
execfile(activate_this, dict(__file__=activate_this))
from monascaclient import client
except ImportError:
monascaclient_found = False
else:
monascaclient_found = True
monascaclient_found = False
else:
monascaclient_found = True
@ -306,7 +296,7 @@ def main():
)
if not monascaclient_found:
module.fail_json(msg="python-monascaclient >= 1.6.1 is required")
module.fail_json(msg="python-monascaclient is required")
definition = MonascaDefinition(module)
definition.run()

View File

@ -120,17 +120,7 @@ import os # NOQA
try:
from monascaclient import client
except ImportError:
# In many installs the python-monascaclient is available in a venv, switch
# to the most common location
activate_this = os.path.realpath(
'/opt/venvs/monasca-client/bin/activate_this.py')
try:
execfile(activate_this, dict(__file__=activate_this))
from monascaclient import client
except ImportError:
monascaclient_found = False
else:
monascaclient_found = True
monascaclient_found = False
else:
monascaclient_found = True
@ -251,7 +241,7 @@ def main():
)
if not monascaclient_found:
module.fail_json(msg="python-monascaclient >= 1.6.1 is required")
module.fail_json(msg="python-monascaclient is required")
notification = MonascaNotification(module)
notification.run()

View File

@ -40,42 +40,3 @@ dependencies:
- role: apt_package_pinning
when:
- ansible_pkg_mgr == 'apt'
- role: ansible-zookeeper
when:
- inventory_hostname in groups['monasca_zookeeper']
tags:
- zookeeper
- skip_ansible_lint
- role: ansible-kafka
kafka_listen_address: "{{ ansible_host }}"
when:
- inventory_hostname in groups['monasca_kafka']
tags:
- kafka
- skip_ansible_lint
- role: ansible-storm
storm_nimbus_enabled: True
storm_supervisor_enabled: True
nimbus_host: "{{ ansible_ssh_host }}"
when:
- inventory_hostname in groups['monasca_api']
tags:
- storm
- skip_ansible_lint
- role: ansible-influxdb
when:
- inventory_hostname in groups['monasca_influxdb']
tags:
- influxdb
- skip_ansible_lint
- role: grafana-ansible
grafana_mysql_host: "{{ galera_address }}"
grafana_mysql_root_user: "{{ galera_root_user }}"
grafana_mysql_root_password: "{{ galera_root_password }}"
grafana_mysql_password: "{{ grafana_galera_password }}"
grafana_keystone_url: "{{ keystone_service_internaluri }}"
when:
- inventory_hostname in groups['monasca_grafana']
tags:
- grafana
- skip_ansible_lint

View File

@ -32,6 +32,14 @@
monasca_api_url: "{{ monasca_service_internalurl }}"
register: default_notification
no_log: True
# TODO(evrardjp): Add conditional for deploy from
# packages to set the python_interpreter to the
# system's one.
# Make sure the module doesn't load the code on the
# target node, but inside target node's venv when
# deploying from source
vars:
ansible_python_interpreter: "{{ monasca_bin }}/python"
- name: Create default alarm definitions
monasca_alarm_definition:
@ -53,3 +61,11 @@
monasca_api_url: "{{ monasca_service_internalurl }}"
with_items: "{{ monasca_default_alarms }}"
no_log: True
# TODO(evrardjp): Add conditional for deploy from
# packages to set the python_interpreter to the
# system's one.
# Make sure the module doesn't load the code on the
# target node, but inside target node's venv when
# deploying from source
vars:
ansible_python_interpreter: "{{ monasca_bin }}/python"

View File

@ -42,11 +42,10 @@
influxdb_user:
hostname: "{{ monasca_influxdb_host }}"
port: "{{ monasca_influxdb_port }}"
database_name: "{{ monasca_influxdb_database }}"
username: "{{ monasca_influxdb_admin }}"
password: "{{ monasca_influxdb_admin_password }}"
user_name: "{{ item.username }}"
user_pass: "{{ item.password }}"
user_password: "{{ item.password }}"
with_items:
- "{{ monasca_influxdb_users }}"
no_log: True

View File

@ -109,8 +109,8 @@ sporadicMetricNamespaces:
- foo
database:
driverClass: "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
url: "jdbc:mysql://{{ monasca_galera_address }}/{{ monasca_galera_database }}?useSSL=true"
driverClass: "org.drizzle.jdbc.DrizzleDriver"
url: "jdbc:drizzle://{{ monasca_galera_address }}:3306/{{ monasca_galera_database }}"
user: "{{ monasca_galera_user }}"
password: "{{ monasca_container_mysql_password }}"
properties:

View File

@ -60,11 +60,11 @@
scm: git
version: master
- name: ansible-influxdb
src: https://github.com/flaviodsr/ansible-influxdb
src: https://github.com/guilhermesteinmuller/ansible-influxdb.git
scm: git
version: master
- name: grafana-ansible
src: https://github.com/flaviodsr/grafana-ansible
- name: ansible-grafana
src: https://github.com/cloudalchemy/ansible-grafana
scm: git
version: master
- name: systemd_service

View File

@ -14,6 +14,8 @@
influxdb_host: "{{ internal_lb_vip_address }}"
influxdb_port: 8086
zookeeper_client_port: 2181
zookeeper_hosts: "{% for host in groups['monasca_zookeeper'] %}{{ hostvars[host]['ansible_host'] }}:{{ zookeeper_client_port }}{% if not loop.last %},{% endif %}{% endfor %}"
kafka_port: 9092
kafka_hosts: "{% for host in groups['monasca_kafka'] %}{{ hostvars[host]['ansible_host'] }}:{{ kafka_port }}{% if not loop.last %},{% endif %}{% endfor %}"

View File

@ -16,6 +16,8 @@
# (c) 2016 Donovan Francesco <donovan.francesco@is.co.za>
# (c) 2016 Paul Stevens <paul.stevens@is.co.za>
- include: "{{ playbook_dir }}/../examples/monasca-dependencies.yml"
- name: Install monasca server
hosts: monasca_all
remote_user: root

View File

@ -17,8 +17,8 @@
check:
jobs:
- openstack-ansible-linters
- openstack-ansible-functional-ubuntu-xenial:
voting: false
- openstack-ansible-functional-ubuntu-xenial
gate:
jobs:
- openstack-ansible-linters
- openstack-ansible-functional-ubuntu-xenial