Clean up the ansible structure a bit

Change-Id: If478fae488c6f911871c418875e60840854328d1
This commit is contained in:
Tim Kuhlman 2015-05-05 14:11:14 -06:00
parent 6b267c0040
commit 354db26cae
6 changed files with 68 additions and 70 deletions

View File

@ -1,15 +1,6 @@
- hosts: devstack - hosts: devstack
sudo: yes sudo: yes
vars: vars:
monasca_api_host: 192.168.10.4
monasca_agent_user: monasca-agent
monasca_agent_password: password
monasca_agent_project: mini-mon
monasca_agent_check_frequency: 15
minimon:
user: mini-mon
password: password
monasca_api_url: http://{{ monasca_api_host }}:8080/v2.0
monasca_checks: monasca_checks:
host_alive: host_alive:
init_config: init_config:
@ -20,17 +11,6 @@
- name: mini-mon - name: mini-mon
host_name: 192.168.10.4 host_name: 192.168.10.4
alive_test: ssh alive_test: ssh
keystone_url: http://192.168.10.5:35357/v3
keystone_admin_token: ADMIN
keystone_users:
- username: mini-mon
project: mini-mon
password: password
role: monasca-user
- username: monasca-agent
password: password
project: mini-mon
role: monasca-agent
pre_tasks: pre_tasks:
- name: apt-get update - name: apt-get update
apt: update_cache=yes apt: update_cache=yes
@ -43,7 +23,7 @@
tags: tags:
- cli - cli
- name: Update cli - name: Update cli
pip: name=python-monascaclient state=latest pip: name=python-monascaclient state=latest virtualenv="{{monasca_virtualenv_dir}}"
tags: tags:
- cli - cli
roles: roles:
@ -51,4 +31,3 @@
- {role: monasca-keystone, tags: [devstack, keystone]} - {role: monasca-keystone, tags: [devstack, keystone]}
- {role: monasca-devstack, tags: [devstack]} - {role: monasca-devstack, tags: [devstack]}
- {role: monasca-agent, tags: [agent]} - {role: monasca-agent, tags: [agent]}

14
group_vars/all Normal file
View File

@ -0,0 +1,14 @@
---
devstack: 192.168.10.5
mini_mon: 192.168.10.4
keystone_url: "http://{{devstack}}:35357/v3"
monasca_api_host: "{{mini_mon}}"
monasca_api_url: http://{{ monasca_api_host }}:8080/v2.0
monasca_agent_check_frequency: 15
monasca_virtualenv_dir: /opt/monasca
keystone_admin_token: ADMIN
monasca_agent_user: monasca-agent
monasca_agent_password: password
monasca_agent_project: mini-mon

10
host_vars/devstack Normal file
View File

@ -0,0 +1,10 @@
---
keystone_users:
- username: mini-mon
project: mini-mon
password: password
role: monasca-user
- username: monasca-agent
password: password
project: mini-mon
role: monasca-agent

36
host_vars/mini-mon Normal file
View File

@ -0,0 +1,36 @@
---
api_region: useast
influxdb:
raft_port: 8086
seed_servers: []
replication_factor: 1
influxdb_version: 0.9.0-rc28
influxdb_url: "http://{{mini_mon}}:8086"
kafka_events_partitions: 4
kafka_metrics_partitions: 4
kafka_replicas: 1
kafka_hosts: "{{mini_mon}}:9092"
kafka_listen_address: "{{mini_mon}}"
keystone_host: "{{devstack}}"
mysql_host: "{{mini_mon}}"
nimbus_host: "{{mini_mon}}"
percona_package: percona-xtradb-cluster-56
smtp_host: localhost
storm_worker_ports: [6701, 6702]
zookeeper_hosts: "{{mini_mon}}:2181"
# common credentials
influxdb_users:
mon_api: password
mon_persister: password
keystone_admin: admin
keystone_admin_password: ""
keystone_auth_method: token
keystone_user: mini-mon
keystone_password: password
mysql_admin_password: password
mysql_root_password: password
mysql_users:
notification: password
monapi: password
thresh: password

View File

@ -1,14 +1,6 @@
- name: Installs DBs, kafka and other core dependencies. - name: Installs DBs, kafka and other core dependencies.
hosts: mini-mon hosts: mini-mon
sudo: yes sudo: yes
vars:
influxdb:
raft_port: 8086
seed_servers: []
replication_factor: 1
influxdb_version: 0.9.0-rc28 # Also set in the next play
mini_mon_host: 192.168.10.4
zookeeper_hosts: "{{mini_mon_host}}:2181"
pre_tasks: pre_tasks:
- name: apt-get update - name: apt-get update
apt: update_cache=yes apt: update_cache=yes
@ -25,31 +17,15 @@
apt: name=python-dev state=present apt: name=python-dev state=present
roles: roles:
- {role: zookeeper, tags: [zookeeper]} - {role: zookeeper, tags: [zookeeper]}
- {role: kafka, kafka_listen_address: "{{mini_mon_host}}", tags: [kafka]} - {role: kafka, tags: [kafka]}
- {role: influxdb, tags: [influxdb]} - {role: influxdb, tags: [influxdb]}
- {role: percona, mysql_root_password: password, percona_package: percona-xtradb-cluster-56, tags: [mysql, percona]} - {role: percona, tags: [mysql, percona]}
- name: Sets up schema and Installs Monasca apps - name: Sets up schema and install Monasca apps
hosts: mini-mon hosts: mini-mon
sudo: yes sudo: yes
vars: vars:
mini_mon_host: 192.168.10.4
influxdb_url: "http://{{mini_mon_host}}:8086"
influxdb_users:
mon_api: password
mon_persister: password
influxdb_version: 0.9.0-rc28 # Also set in the previous play
kafka_events_partitions: 4
kafka_metrics_partitions: 4
kafka_replicas: 1
kafka_hosts: "{{mini_mon_host}}:9092"
keystone_url: http://192.168.10.5:35357/v3
monasca_agent_user: monasca-agent
monasca_agent_password: password
monasca_agent_project: mini-mon
monasca_agent_service: monitoring monasca_agent_service: monitoring
monasca_agent_check_frequency: 15
monasca_api_url: http://192.168.10.4:8080/v2.0
monasca_checks: monasca_checks:
host_alive: host_alive:
init_config: init_config:
@ -60,13 +36,6 @@
- name: devstack - name: devstack
host_name: 192.168.10.5 host_name: 192.168.10.5
alive_test: ssh alive_test: ssh
mysql_host: "{{mini_mon_host}}"
mysql_users:
notification: password
monapi: password
thresh: password
storm_worker_ports: [6701, 6702]
zookeeper_hosts: "{{mini_mon_host}}:2181"
tasks: tasks:
- name: Setup the monasca cli credentials in the default environment - name: Setup the monasca cli credentials in the default environment
copy: src=tests/env.sh dest=/etc/profile.d/monasca_cli.sh owner=root group=root mode=0644 copy: src=tests/env.sh dest=/etc/profile.d/monasca_cli.sh owner=root group=root mode=0644
@ -77,16 +46,10 @@
tags: tags:
- cli - cli
roles: roles:
- {role: monasca-schema, mysql_admin_password: password, tags: [schema]} - {role: monasca-schema, tags: [schema]}
- {role: monasca-api, - {role: monasca-api,
api_region: useast,
influxdb_user: mon_api, influxdb_user: mon_api,
influxdb_password: password, influxdb_password: password,
keystone_host: 192.168.10.5,
keystone_auth_method: token,
keystone_admin: admin,
keystone_admin_password: "",
keystone_admin_token: ADMIN,
mysql_user: monapi, mysql_user: monapi,
mysql_password: password, mysql_password: password,
tags: [api]} tags: [api]}
@ -97,9 +60,8 @@
- {role: monasca-notification, - {role: monasca-notification,
mysql_user: notification, mysql_user: notification,
mysql_password: password, mysql_password: password,
smtp_host: localhost,
tags: [notification]} tags: [notification]}
- {role: storm, nimbus_host: "{{mini_mon_host}}", storm_nimbus_enabled: true, storm_supervisor_enabled: true, tags: [storm]} - {role: storm, storm_nimbus_enabled: true, storm_supervisor_enabled: true, tags: [storm]}
- {role: monasca-thresh, - {role: monasca-thresh,
mysql_user: thresh, mysql_user: thresh,
mysql_password: password, mysql_password: password,
@ -109,9 +71,5 @@
- name: Define default alarms - name: Define default alarms
hosts: mini-mon hosts: mini-mon
gather_facts: no gather_facts: no
vars:
keystone_url: http://192.168.10.5:35357/v3/
keystone_user: mini-mon
keystone_password: password
roles: roles:
- {role: monasca-default-alarms, tags: [alarms]} - {role: monasca-default-alarms, tags: [alarms]}

View File

@ -1,7 +1,8 @@
- hosts: mini-mon - hosts: mini-mon
gather_facts: no
tasks: tasks:
- name: Run the smoke test - name: Run the smoke test
command: /vagrant/tests/smoke.py command: /vagrant/tests/smoke.py
environment:
PATH: "{{ansible_env.PATH}}:{{monasca_virtualenv_dir}}/bin"
register: smoke register: smoke
- debug: var=smoke.stdout_lines - debug: var=smoke.stdout_lines