Commit 59f1bef1 authored by Flávio Ramalho's avatar Flávio Ramalho
Browse files

Updated the roles to support the master of Monasca

- Dropped support for Ubuntu 14.04
- Changed default credentials for monasca and admin user
- Updated ansible version to 2.2.0
parent b73bdc84
......@@ -24,11 +24,13 @@ Install and configure the following services:
* 2 VCPU
* 4GB memory
* 20GB storage
* Ubuntu 16.04
2. monasca
* 4 VCPU
* 12GB memory
* 20GB storage
* Ubuntu 16.04
**Ports on security group:**
......@@ -45,7 +47,7 @@ Install and configure the following services:
sudo apt-get update && sudo apt-get install git -y
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
# Remember to configure the local.conf
# Configure local.conf
./stack
```
......@@ -59,4 +61,3 @@ sudo scripts/bootstrap-ansible.sh
# Add devstack and monasca IP address to the inventory file
ansible-playbook setup-everything.yml
```
openrc will be placed in /root at the monasca instance.
......@@ -17,13 +17,13 @@ notification_type: EMAIL
## Keystone
# admin credentials
os_username: "admin"
os_password: "secretadmin"
os_password: "password"
os_project_name: "admin"
# monasca-user credentials
os_mon_username: "mini-mon"
os_mon_username: "monasca"
os_mon_password: "password"
os_mon_project_name: "mini-mon"
os_mon_project_name: "monasca"
# monasca-agent credentials
os_mon_agent_username: "monasca-agent"
......@@ -34,7 +34,7 @@ os_mon_agent_password: "password"
horizon_dir: "/opt/stack/horizon"
## Database
mysql_root_pass: "secretdatabase"
mysql_root_pass: "password"
## NTP
ntp_servers:
......
# Sample ``local.conf`` for user-configurable variables in ``stack.sh``
# NOTE: Copy this file to the root DevStack directory for it to work properly.
# ``local.conf`` is a user-maintained settings file that is sourced from ``stackrc``.
# This gives it the ability to override any variables set in ``stackrc``.
# Also, most of the settings in ``stack.sh`` are written to only be set if no
# value has already been set; this lets ``local.conf`` effectively override the
# default values.
# This is a collection of some of the settings we have found to be useful
# in our DevStack development environments. Additional settings are described
# in http://devstack.org/local.conf.html
# These should be considered as samples and are unsupported DevStack code.
# The ``localrc`` section replaces the old ``localrc`` configuration file.
# Note that if ``localrc`` is present it will be used in favor of this section.
## This is the simplest local.conf required for monasca and monsaca-ui
[[local|localrc]]
ADMIN_PASSWORD=password
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
# Minimal Contents
# ----------------
# While ``stack.sh`` is happy to run without ``localrc``, devlife is better when
# there are a few minimal variables set:
# If the ``*_PASSWORD`` variables are not set here you will be prompted to enter
# values for them by ``stack.sh``and they will be added to ``local.conf``.
ADMIN_PASSWORD=secretadmin
DATABASE_PASSWORD=secretdatabase
RABBIT_PASSWORD=secretrabbit
SERVICE_PASSWORD=secretservice
SERVICE_TOKEN=111222333444
# ``HOST_IP`` and ``HOST_IPV6`` should be set manually for best results if
# the NIC configuration of the host is unusual, i.e. ``eth1`` has the default
# route but ``eth0`` is the public interface. They are auto-detected in
# ``stack.sh`` but often is indeterminate on later runs due to the IP moving
# from an Ethernet interface to a bridge on the host. Setting it here also
# makes it available for ``openrc`` to include when setting ``OS_AUTH_URL``.
# Neither is set by default.
#HOST_IP=w.x.y.z
#HOST_IPV6=2001:db8::7
# Logging
# -------
# By default ``stack.sh`` output only goes to the terminal where it runs. It can
# be configured to additionally log to a file by setting ``LOGFILE`` to the full
# path of the destination log file. A timestamp will be appended to the given name.
LOGFILE=$DEST/logs/stack.sh.log
LOGDIR=$DEST/logs
LOG_COLOR=False
# Old log files are automatically removed after 7 days to keep things neat. Change
# the number of days by setting ``LOGDAYS``.
LOGDAYS=2
# Nova logs will be colorized if ``SYSLOG`` is not set; turn this off by setting
# ``LOG_COLOR`` false.
#LOG_COLOR=False
# Using milestone-proposed branches
# ---------------------------------
# Uncomment these to grab the milestone-proposed branches from the
# repos:
#CINDER_BRANCH=milestone-proposed
#GLANCE_BRANCH=milestone-proposed
#HORIZON_BRANCH=milestone-proposed
#KEYSTONE_BRANCH=milestone-proposed
#KEYSTONECLIENT_BRANCH=milestone-proposed
#NOVA_BRANCH=milestone-proposed
#NOVACLIENT_BRANCH=milestone-proposed
#NEUTRON_BRANCH=milestone-proposed
#SWIFT_BRANCH=milestone-proposed
# Using git versions of clients
# -----------------------------
# By default clients are installed from pip. See LIBS_FROM_GIT in
# stackrc for details on getting clients from specific branches or
# revisions. e.g.
# LIBS_FROM_GIT="python-ironicclient"
# IRONICCLIENT_BRANCH=refs/changes/44/2.../1
# Swift
# -----
# Swift is now used as the back-end for the S3-like object store. Setting the
# hash value is required and you will be prompted for it if Swift is enabled
# so just set it to something already:
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
# For development purposes the default of 3 replicas is usually not required.
# Set this to 1 to save some resources:
SWIFT_REPLICAS=1
# The data for Swift is stored by default in (``$DEST/data/swift``),
# or (``$DATA_DIR/swift``) if ``DATA_DIR`` has been set, and can be
# moved by setting ``SWIFT_DATA_DIR``. The directory will be created
# if it does not exist.
SWIFT_DATA_DIR=$DEST/data
# Enable heat services
enable_service h-eng h-api h-api-cfn h-api-cw
# Enable neutron services
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
# Disable openstack services
disable_service c-api c-sch c-vol # Disable Cinder services
disable_service g-api g-reg # Disable Glance services
disable_service n-api n-cond n-sch n-novnc n-cauth n-cpu # Disable Nova services
disable_service q-svc q-agt q-dhcp q-l3 q-meta # Disable Neutron services
# Disable tempest
disable_service tempest
......@@ -17,6 +17,13 @@
hosts: monasca-agent
user: ubuntu
become: yes
pre_tasks:
pre_tasks:
- name: "Install python 2 when not installed"
raw: "test -e /usr/bin/python || (apt -y update && apt install -y python-simplejson)"
- name: "Gather facts"
setup:
roles:
- { role: "os_monasca_agent", tags: [ "os-monasca-agent" ] }
vars:
......
......@@ -14,20 +14,18 @@
# limitations under the License.
- name: Install Monasca
hosts: monasca
user: ubuntu
become: yes
roles:
- { role: "os_monasca", tags: [ "os-monasca" ] }
vars:
- keystone_ip_address: "{{ groups['devstack'][0] }}"
- name: Configure standard alarm definitions
hosts: monasca
user: ubuntu
become: yes
gather_facts: no
pre_tasks:
- name: "Install python 2 when not installed"
raw: "test -e /usr/bin/python || (apt -y update && apt install -y python-simplejson)"
- name: "Gather facts"
setup:
roles:
- { role: "os_monasca", tags: [ "os-monasca" ] }
- { role: "os_monasca_alarms", tags: [ "os-monasca-alarms" ] }
vars:
- keystone_ip_address: "{{ groups['devstack'][0] }}"
......
virtualenv>=14.0.0 # Used for Ansible isolation
###
### These are pinned to ensure exactly the same behaviour forever! ###
### These pins are updated through the sources-branch-updater script ###
###
pip==8.1.2
setuptools==21.1.0
wheel==0.29.0
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pip>=7.1.0 # MIT
PyYAML>=3.10.0 # MIT
virtualenv>=13.1.0 # MIT
......@@ -35,33 +35,33 @@ Role Variables
monasca_git_branch: "master"
## Grafana
grafana_plugins_git_repo: "https://github.com/twc-openstack/grafana-plugins.git"
grafana_plugins_git_branch: "v2.6.0"
grafana_datasource_git_repo: "https://github.com/openstack/monasca-grafana-datasource.git"
grafana_git_branch: "master"
grafana_git_repo: "https://github.com/twc-openstack/grafana.git"
grafana_git_branch: "v2.6.0-keystone"
grafana_git_branch: "master-keystone"
## Keystone
keystone_ip_address: "127.0.0.1"
# admin credentials
os_username: "admin"
os_password: "secretadmin"
os_password: "password"
os_project_name: "admin"
# monasca-user credentials
os_mon_username: "mini-mon"
os_mon_username: "monasca"
os_mon_password: "password"
os_mon_project_name: "mini-mon"
os_mon_project_name: "monasca"
# monasca-read-only-user credentials
os_mon_read_only_username: "monasca-read-only-user"
os_mon_read_only_password: "password"
os_mon_read_only_password: "password"
# monasca-agent credentials
os_mon_agent_username: "monasca-agent"
os_mon_agent_password: "password"
## Database
mysql_root_pass: "secretdatabase"
mysql_root_pass: "password"
## InfluxDB
influxdb_version: "0.9.5"
......@@ -71,11 +71,16 @@ Role Variables
kafka_version: "2.9.2-{{ base_kafka_version }}"
## Storm
storm_version: "1.0.1"
storm_logback_dir: "log4j2"
storm_version: "1.0.2"
## Go
go_version: "1.7.1"
## NodeJS
node_js_version: "4.0.0"
## NVM
nvm_version: "0.32.1"
## NTP
ntp_servers:
......@@ -120,7 +125,7 @@ Example Playbook
Tested on
---------
Ubuntu 14.04 trusty tahr
Ubuntu 16.04 xenial xerus
Author Information
------------------
......
......@@ -24,22 +24,22 @@ monasca_client_git_repo: "https://git.openstack.org/openstack/python-monascaclie
monasca_git_branch: "master"
## Grafana
grafana_plugins_git_repo: "https://github.com/twc-openstack/grafana-plugins.git"
grafana_plugins_git_branch: "v2.6.0"
grafana_datasource_git_repo: "https://github.com/openstack/monasca-grafana-datasource.git"
grafana_datasource_git_branch: "master"
grafana_git_repo: "https://github.com/twc-openstack/grafana.git"
grafana_git_branch: "v2.6.0-keystone"
grafana_git_branch: "master-keystone"
## Keystone
keystone_ip_address: "127.0.0.1"
# admin credentials
os_username: "admin"
os_password: "secretadmin"
os_password: "password"
os_project_name: "admin"
# monasca-user credentials
os_mon_username: "mini-mon"
os_mon_username: "monasca"
os_mon_password: "password"
os_mon_project_name: "mini-mon"
os_mon_project_name: "monasca"
# monasca-read-only-user credentials
os_mon_read_only_username: "monasca-read-only-user"
......@@ -50,7 +50,7 @@ os_mon_agent_username: "monasca-agent"
os_mon_agent_password: "password"
## Database
mysql_root_pass: "secretdatabase"
mysql_root_pass: "password"
## InfluxDB
influxdb_version: "0.9.5"
......@@ -61,11 +61,16 @@ kafka_version: "2.9.2-{{ base_kafka_version }}"
## Storm
storm_version: "1.0.2"
storm_logback_dir: "log4j2"
## Go
go_version: "1.7.1"
## NodeJS
node_js_version: "4.0.0"
## NVM
nvm_version: "0.32.1"
## NTP
ntp_servers:
- ntp.lsd.ufcg.edu.br
......
......@@ -35,23 +35,23 @@
- name: Clone grafana git repositories
git:
repo: "{{ item.repo }}"
dest: "/opt/cloned-repos/{{ item.dest }}"
dest: "{{ item.dest }}"
version: "{{ item.version }}"
force: "yes"
with_items:
- repo: "{{ grafana_plugins_git_repo }}"
dest: "grafana-plugins"
version: "v2.6.0"
- repo: "{{ grafana_datasource_git_repo }}"
dest: "/var/lib/grafana/plugins"
version: "{{ grafana_datasource_git_branch }}"
- repo: "{{ grafana_git_repo }}"
dest: "grafana"
version: "v2.6.0-keystone"
dest: "/opt/cloned-repos/grafana"
version: "{{ grafana_git_branch }}"
tags:
- monasca-grafana-clone-repos
- monasca-install-grafana
- name: Copy grafana install script
copy:
src: "install_grafana.sh"
template:
src: "grafana/install_grafana.sh.j2"
dest: "/opt/grafana-build/install_grafana.sh"
mode: "0750"
register: grafana_script
......@@ -75,11 +75,11 @@
group: "{{ item.group }}"
mode: "{{ item.mode|default('0644') }}"
with_items:
- src: "grafana/grafana-server.j2"
dest: "/etc/init.d/grafana-server"
- src: "grafana/grafana-server.service.j2"
dest: "/etc/systemd/system/grafana-server.service"
owner: "root"
group: "root"
mode: "0775"
mode: "0644"
- src: "grafana/grafana.ini.j2"
dest: "/etc/grafana/grafana.ini"
owner: "root"
......@@ -89,6 +89,13 @@
- monasca-grafana-config
- monasca-install-grafana
- name: Ensure grafana launches on boot
service:
name: "grafana-server"
enabled: "yes"
tags:
- monasca-grafana-boot
- name: Restart grafana
service:
name: "grafana-server"
......
......@@ -57,10 +57,3 @@
tags:
- influxdb-restart
- monasca-install-influxdb
- name: Sleep for 60 seconds to let Influxdb elect a leader
pause:
minutes: 1
when: influxdb_config.changed
tags:
- monasca-install-influxdb
......@@ -59,8 +59,8 @@
owner: "root"
group: "root"
mode: "0775"
- src: "kafka/kafka.conf.j2"
dest: "/etc/init/kafka.conf"
- src: "kafka/kafka.service.j2"
dest: "/etc/systemd/system/kafka.service"
owner: "root"
group: "root"
- src: "kafka/log4j.properties.j2"
......@@ -76,6 +76,13 @@
- monasca-kafka-config
- monasca-install-kafka
- name: Ensure kafka launches on boot
service:
name: "kafka"
enabled: "yes"
tags:
- monasca-kafka-boot
- name: Restart kafka
service:
name: "kafka"
......
......@@ -59,11 +59,11 @@
group: "{{ item.group }}"
mode: "{{ item.mode }}"
with_items:
- src: "monasca-api/monasca-api-init.conf.j2"
dest: "/etc/init/monasca-api.conf"
- src: "monasca-api/monasca-api.service.j2"
dest: "/etc/systemd/system/monasca-api.service"
owner: "root"
group: "root"
mode: "0744"
mode: "0644"
- src: "monasca-api/api-config.conf.j2"
dest: "/etc/monasca/api-config.conf"
owner: "mon-api"
......@@ -74,6 +74,11 @@
owner: "mon-api"
group: "root"
mode: "0660"
- src: "monasca-api/api-logging.conf.j2"
dest: "/etc/monasca/api-logging.conf"
owner: "mon-api"
group: "root"
mode: "0660"
tags:
- monasca-api-config
- monasca-install-api
......@@ -86,10 +91,19 @@
with_items:
- "api-config.conf"
- "api-config.ini"
- "api-logging.conf"
tags:
- monasca-api-links
- monasca-install-api
- name: Ensure monasca-api launches on boot
service:
name: "monasca-api"
enabled: "yes"
tags:
- monasca-api-boot
- name: Restart monasca-api
service:
name: "monasca-api"
......
......@@ -57,11 +57,11 @@
group: "{{ item.group }}"
mode: "{{ item.mode }}"
with_items:
- src: "monasca-notification/monasca-notification-init.conf.j2"
dest: "/etc/init/monasca-notification.conf"
- src: "monasca-notification/monasca-notification.service.j2"
dest: "/etc/systemd/system/monasca-notification.service"
owner: "root"
group: "root"
mode: "0744"
mode: "0644"
- src: "monasca-notification/notification.yaml.j2"
dest: "/etc/monasca/notification.yaml"
owner: "mon-notification"
......@@ -71,6 +71,13 @@
- monasca-notification-config
- monasca-install-notification
- name: Ensure monasca-notification launches on boot
service:
name: "monasca-notification"
enabled: "yes"
tags:
- monasca-monasca-notification
- name: Restart monasca-notification
service:
name: "monasca-notification"
......
......@@ -57,11 +57,11 @@
group: "{{ item.group }}"
mode: "{{ item.mode }}"
with_items:
- src: "monasca-persister/monasca-persister-init.conf.j2"
dest: "/etc/init/monasca-persister.conf"
- src: "monasca-persister/monasca-persister.service.j2"
dest: "/etc/systemd/system/monasca-persister.service"
owner: "root"
group: "root"
mode: "0744"
mode: "0644"
- src: "monasca-persister/persister.conf.j2"
dest: "/etc/monasca/persister.conf"
owner: "mon-persister"
......@@ -76,6 +76,13 @@
- monasca-persister-config
- monasca-install-persister
- name: Ensure monasca-persister launches on boot
service:
name: "monasca-persister"
enabled: "yes"
tags:
- monasca-persister-boot
- name: Restart monasca-persister
service:
name: "monasca-persister"
......
......@@ -53,15 +53,22 @@
owner: "root"
group: "monasca"
mode: "0640"
- src: "monasca-thresh/monasca-thresh.j2"
dest: "/etc/init.d/monasca-thresh"
- src: "monasca-thresh/monasca-thresh.service.j2"
dest: "/etc/systemd/system/monasca-thresh.service"
owner: "root"
group: "root"
mode: "0744"
mode: "0644"
tags:
- monasca-thresh-config
- monasca-install-thresh
- name: Ensure monasca-thresh launches on boot
service:
name: "monasca-thresh"
enabled: "yes"
tags:
- monasca-thresh-boot
- name: Restart monasca-thresh
service:
name: "monasca-thresh"
......
......@@ -49,6 +49,16 @@
- monasca-mysql-dbcreate
- monasca-install-schema
- name: Create database users
mysql_user:
name: "{{ item[0] }}"
password: "password"
priv: "mon.*:ALL"
host: "{{ item[1] }}"
with_nested:
- ['notification', 'monapi', 'thresh']
- ['%', 'localhost', '{{ ansible_hostname }}']
- name: Setup mysql schemas
mysql_db:
state: "import"
......
......@@ -13,15 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Set facts based on storm version
set_fact:
storm_version: "0.9.6"
storm_logback_dir: "logback"
when: monasca_git_branch == "stable/mitaka"
tags:
- monasca-storm-version