Commit 3085f053 authored by Flávio Ramalho's avatar Flávio Ramalho
Browse files

Support for deployment in an existing OpenStack

    - Added configuration for the monasca-agent/monasca-user users;
    - Added variable for specifying the horizon directory;
    - Deleted tasks for removing plugins causing error, ignore
      erros instead.
parent f50c53dc
......@@ -20,11 +20,19 @@ os_username: "admin"
os_password: "secretadmin"
os_project_name: "admin"
# mini-mon credentials
# monasca-user credentials
os_mon_username: "mini-mon"
os_mon_password: "password"
os_mon_project_name: "mini-mon"
# monasca-agent credentials
os_mon_agent_username: "monasca-agent"
os_mon_agent_password: "password"
## Horizon
# dashboard directory
horizon_dir: "/opt/stack/horizon"
## Database
mysql_root_pass: "secretdatabase"
......
......@@ -42,10 +42,20 @@ Role Variables
## Keystone
keystone_ip_address: "127.0.0.1"
# admin credentials
os_username: "admin"
os_password: "secretadmin"
os_project_name: "admin"
# monasca-user credentials
os_mon_username: "mini-mon"
os_mon_password: "password"
os_mon_project_name: "mini-mon"
# monasca-agent credentials
os_mon_agent_username: "monasca-agent"
os_mon_agent_password: "password"
## Database
mysql_root_pass: "secretdatabase"
......
......@@ -31,10 +31,20 @@ grafana_git_branch: "v2.6.0-keystone"
## Keystone
keystone_ip_address: "127.0.0.1"
# admin credentials
os_username: "admin"
os_password: "secretadmin"
os_project_name: "admin"
# monasca-user credentials
os_mon_username: "mini-mon"
os_mon_password: "password"
os_mon_project_name: "mini-mon"
# monasca-agent credentials
os_mon_agent_username: "monasca-agent"
os_mon_agent_password: "password"
## Database
mysql_root_pass: "secretdatabase"
......
......@@ -146,26 +146,22 @@ def main(argv):
""" Get credentials to create a keystoneauth Session to instantiate a
Keystone Client and then call methods to add users, projects and roles"""
users = [
{'username': 'mini-mon',
'project': 'mini-mon',
'password': 'password',
{'username': '{{ os_mon_username }}',
'project': '{{ os_mon_project_name }}',
'password': '{{ os_mon_password }}',
'role': 'monasca-user'},
{'username': 'monasca-agent',
'project': 'mini-mon',
'password': 'password',
{'username': '{{ os_mon_agent_username }}',
'project': '{{ os_mon_project_name }}',
'password': '{{ os_mon_agent_password }}',
'role': 'monasca-agent'},
{'username': 'mini-mon',
'project': 'mini-mon',
'password': 'password',
{'username': '{{ os_mon_username }}',
'project': '{{ os_mon_project_name }}',
'password': '{{ os_mon_password }}',
'role': 'admin'},
{'username': 'admin',
'project': 'admin',
'password': 'secretadmin',
{'username': '{{ os_username }}',
'project': '{{ os_project_name }}',
'password': '{{ os_password }}',
'role': 'monasca-user'},
{'username': 'demo',
'project': 'demo',
'password': 'secretadmin',
'role': 'monasca-user'}
]
url = 'http://{{ keystone_ip_address }}:35357/v3'
......
......@@ -20,7 +20,7 @@
# Environment variables for use with python-monascaclient
. /opt/venvs/monasca-client/bin/activate
export OS_USERNAME=mini-mon
export OS_PASSWORD=password
export OS_PROJECT_NAME=mini-mon
export OS_USERNAME={{ os_mon_username }}
export OS_PASSWORD={{ os_mon_password }}
export OS_PROJECT_NAME={{ os_mon_project_name }}
export OS_AUTH_URL=http://{{ keystone_ip_address }}:35357/v3/
......@@ -26,7 +26,7 @@ alarmHistoryConfiguration:
# See http://kafka.apache.org/documentation.html#api for semantics and defaults.
topic: alarm-state-transitions
groupId: 1_alarm-state-transitions
consumerId: "mini-mon"
consumerId: "{{ os_mon_username }}"
clientId : 1
metricConfiguration:
......@@ -36,7 +36,7 @@ metricConfiguration:
# See http://kafka.apache.org/documentation.html#api for semantics and defaults.
topic: metrics
groupId: 1_metrics
consumerId: "mini-mon"
consumerId: "{{ os_mon_username }}"
clientId : 1
#Kafka settings.
......
......@@ -28,6 +28,7 @@ Role Variables
## Database
mysql_root_pass: "secretdatabase"
mysql_host: "127.0.0.1"
## NTP
agent_ntp_servers:
......
......@@ -27,6 +27,7 @@ os_project_name: "admin"
## Database
mysql_root_pass: "secretdatabase"
mysql_host: "127.0.0.1"
## NTP
agent_ntp_servers:
......
......@@ -61,29 +61,6 @@
- monasca-agent-config
- monasca-install-agent
- name: Remove monasca plugins throwing error on stable/mitaka
file:
path: "/opt/venvs/monasca-agent/local/lib/python2.7/site-packages/monasca_setup/detection/plugins/{{ item }}.py"
state: "absent"
when: monasca_git_branch == "stable/mitaka"
with_items:
- rabbitmq
tags:
- monasca-rm-plugins
- monasca-install-agent
- name: Remove monasca plugins throwing error on master
file:
path: "/opt/venvs/monasca-agent/local/lib/python2.7/site-packages/monasca_setup/detection/plugins/{{ item }}.py"
state: "absent"
when: monasca_git_branch == "master"
with_items:
- vcenter
- apache
tags:
- monasca-rm-plugins
- monasca-install-agent
- name: Drop mysql config
template:
src: "my.cnf.j2"
......@@ -97,6 +74,9 @@
command: "/usr/local/bin/monasca-reconfigure"
register: reconfigure_result
changed_when: "reconfigure_result.rc == 0"
ignore_errors: true
notify:
- Restart monasca-agent
tags:
- monasca-agent-reconfigure
- monasca-install-agent
#!/bin/sh
'/opt/venvs/monasca-agent/bin/monasca-setup' \
-u 'monasca-agent' \
-p 'password' \
-u '{{ os_mon_agent_username }}' \
-p '{{ os_mon_agent_password }}' \
-s 'monitoring' \
--keystone_url 'http://{{ keystone_ip_address }}:35357/v3' \
--project_name 'mini-mon' \
--project_name '{{ os_mon_project_name }}' \
--monasca_url 'http://{{ monasca_ip_address }}:8070/v2.0' \
\
--check_frequency '15' \
......
[client]
user=root
password={{ mysql_root_pass }}
host=127.0.0.1
host= {{ mysql_host }}
......@@ -14,8 +14,12 @@ Role Variables
## Monasca
monasca_ui_git_repo: "https://git.openstack.org/openstack/monasca-ui.git"
monasca_git_branch: "master"
## Grafana
## Horizon
# dashboard directory
horizon_dir: "/opt/stack/horizon/openstack_dashboard"
## Grafana
grafana_ip_address: "127.0.0.1"
## System
......
......@@ -17,6 +17,10 @@
monasca_ui_git_repo: "https://git.openstack.org/openstack/monasca-ui.git"
monasca_git_branch: "master"
## Horizon
# dashboard directory
horizon_dir: "/opt/stack/horizon/openstack_dashboard"
## Grafana
grafana_ip_address: "127.0.0.1"
......
......@@ -51,9 +51,9 @@
state: link
with_items:
- src: "/opt/cloned-repos/monasca-ui/monitoring/enabled/_50_admin_add_monitoring_panel.py"
dest: "/opt/stack/horizon/openstack_dashboard/local/enabled/_50_admin_add_monitoring_panel.py"
dest: "{{ horizon_dir }}/openstack_dashboard/local/enabled/_50_admin_add_monitoring_panel.py"
- src: "/opt/cloned-repos/monasca-ui/monitoring"
dest: "/opt/stack/horizon/monitoring"
dest: "{{ horizon_dir }}/monitoring"
register: monasca_links
tags:
- monasca-ui-links
......@@ -68,7 +68,7 @@
- monasca-install-ui
- name: Collect and compress static files
command: "python /opt/stack/horizon/{{ item }}"
command: "{{ horizon_dir }}/{{ item }}"
with_items:
- "manage.py collectstatic --noinput"
- "manage.py compress --force"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment