diff --git a/devstack.yml b/devstack.yml index fd05c47..77cbccf 100644 --- a/devstack.yml +++ b/devstack.yml @@ -1,15 +1,6 @@ - hosts: devstack sudo: yes 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: host_alive: init_config: @@ -20,17 +11,6 @@ - name: mini-mon host_name: 192.168.10.4 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: - name: apt-get update apt: update_cache=yes @@ -43,7 +23,7 @@ tags: - cli - name: Update cli - pip: name=python-monascaclient state=latest + pip: name=python-monascaclient state=latest virtualenv="{{monasca_virtualenv_dir}}" tags: - cli roles: @@ -51,4 +31,3 @@ - {role: monasca-keystone, tags: [devstack, keystone]} - {role: monasca-devstack, tags: [devstack]} - {role: monasca-agent, tags: [agent]} - diff --git a/group_vars/all b/group_vars/all new file mode 100644 index 0000000..661c0d1 --- /dev/null +++ b/group_vars/all @@ -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 diff --git a/host_vars/devstack b/host_vars/devstack new file mode 100644 index 0000000..c7336a3 --- /dev/null +++ b/host_vars/devstack @@ -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 diff --git a/host_vars/mini-mon b/host_vars/mini-mon new file mode 100644 index 0000000..a8d7afb --- /dev/null +++ b/host_vars/mini-mon @@ -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 diff --git a/mini-mon.yml b/mini-mon.yml index e0769f5..e0b7fb9 100644 --- a/mini-mon.yml +++ b/mini-mon.yml @@ -1,14 +1,6 @@ - name: Installs DBs, kafka and other core dependencies. hosts: mini-mon 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: - name: apt-get update apt: update_cache=yes @@ -25,31 +17,15 @@ apt: name=python-dev state=present roles: - {role: zookeeper, tags: [zookeeper]} - - {role: kafka, kafka_listen_address: "{{mini_mon_host}}", tags: [kafka]} + - {role: kafka, tags: [kafka]} - {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 sudo: yes 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_check_frequency: 15 - monasca_api_url: http://192.168.10.4:8080/v2.0 monasca_checks: host_alive: init_config: @@ -60,13 +36,6 @@ - name: devstack host_name: 192.168.10.5 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: - 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 @@ -77,16 +46,10 @@ tags: - cli roles: - - {role: monasca-schema, mysql_admin_password: password, tags: [schema]} + - {role: monasca-schema, tags: [schema]} - {role: monasca-api, - api_region: useast, influxdb_user: mon_api, 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_password: password, tags: [api]} @@ -97,9 +60,8 @@ - {role: monasca-notification, mysql_user: notification, mysql_password: password, - smtp_host: localhost, 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, mysql_user: thresh, mysql_password: password, @@ -109,9 +71,5 @@ - name: Define default alarms hosts: mini-mon gather_facts: no - vars: - keystone_url: http://192.168.10.5:35357/v3/ - keystone_user: mini-mon - keystone_password: password roles: - {role: monasca-default-alarms, tags: [alarms]} diff --git a/smoke.yml b/smoke.yml index 0a30983..b082530 100644 --- a/smoke.yml +++ b/smoke.yml @@ -1,7 +1,8 @@ - hosts: mini-mon - gather_facts: no tasks: - name: Run the smoke test command: /vagrant/tests/smoke.py + environment: + PATH: "{{ansible_env.PATH}}:{{monasca_virtualenv_dir}}/bin" register: smoke - debug: var=smoke.stdout_lines