diff options
author | Patrick Darley <patrick.darley@codethink.co.uk> | 2015-04-17 14:10:53 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-17 17:30:20 +0000 |
commit | 63c135ee31fa870650039bc7657c54b028fa7f70 (patch) | |
tree | f042fc24e49e9834f4fdb6a01e800b2ec6429c69 /openstack/usr/share | |
parent | 3505ba2dda17bbc5c2790db129ae7cc50db97f14 (diff) | |
download | definitions-63c135ee31fa870650039bc7657c54b028fa7f70.tar.gz |
Openstack: Make Ceilometer configurable
This commit configures ceilometer to integrate with Keystone, Glance,
Cinder and Nova.
Change-Id: I19e8580de87858033ce1c2caf86a828d6377bb91
Diffstat (limited to 'openstack/usr/share')
6 files changed, 139 insertions, 41 deletions
diff --git a/openstack/usr/share/openstack/ceilometer.yml b/openstack/usr/share/openstack/ceilometer.yml new file mode 100644 index 00000000..33a29a89 --- /dev/null +++ b/openstack/usr/share/openstack/ceilometer.yml @@ -0,0 +1,95 @@ +--- +- hosts: localhost + vars_files: + - "/etc/openstack/ceilometer.conf" + tasks: + - name: Create the ceilometer user. + user: + name: ceilometer + comment: Openstack Ceilometer Daemons + shell: /sbin/nologin + home: /var/lib/ceilometer + + - name: Create the /var folders for ceilometer + file: + path: "{{ item }}" + state: directory + owner: ceilometer + group: ceilometer + with_items: + - /var/run/ceilometer + - /var/lock/ceilometer + - /var/log/ceilometer + - /var/lib/ceilometer + + - name: Create /etc/ceilometer directory + file: + path: /etc/ceilometer + state: directory + + - name: Add the configuration needed for ceilometer in /etc/ceilometer using templates + template: + src: /usr/share/openstack/ceilometer/{{ item }} + dest: /etc/ceilometer/{{ item }} + with_lines: + - cd /usr/share/openstack/ceilometer && find -type f + + - name: Create ceilometer service user in service tenant + keystone_user: + user: "{{ CEILOMETER_SERVICE_USER }}" + password: "{{ CEILOMETER_SERVICE_PASSWORD }}" + tenant: service + token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}" + + - name: Assign admin role to ceilometers service user in the service tenant + keystone_user: + role: admin + user: "{{ CEILOMETER_SERVICE_USER }}" + tenant: service + token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}" + + - name: Add ceilometer endpoint + keystone_service: + name: ceilometer + type: metering + description: Openstack Metering Service + publicurl: http://{{ CONTROLLER_HOST_ADDRESS }}:8777 + internalurl: http://{{ CONTROLLER_HOST_ADDRESS }}:8777 + adminurl: http://{{ CONTROLLER_HOST_ADDRESS }}:8777 + region: regionOne + token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}" + + - name: Create postgresql user for ceilometer + postgresql_user: + name: "{{ CEILOMETER_DB_USER }}" + login_host: "{{ CONTROLLER_HOST_ADDRESS }}" + password: "{{ CEILOMETER_DB_PASSWORD }}" + sudo: yes + sudo_user: ceilometer + + - name: Create database for ceilometer services + postgresql_db: + name: ceilometer + owner: "{{ CEILOMETER_DB_USER }}" + login_host: "{{ CONTROLLER_HOST_ADDRESS }}" + sudo: yes + sudo_user: ceilometer + + - name: Initiate ceilometer database + command: ceilometer-dbsync + sudo: yes + sudo_user: ceilometer + + - name: Enable and start openstack-ceilometer services + service: + name: "{{ item }}" + enabled: yes + state: started + with_items: + - openstack-ceilometer-api.service + - openstack-ceilometer-alarm-evaluator.service + - openstack-ceilometer-alarm-notifier.service + - openstack-ceilometer-central.service + - openstack-ceilometer-collector.service + - openstack-ceilometer-compute.service + - openstack-ceilometer-notification.service diff --git a/openstack/usr/share/openstack/ceilometer/ceilometer.conf b/openstack/usr/share/openstack/ceilometer/ceilometer.conf index 927379be..b572d40f 100644 --- a/openstack/usr/share/openstack/ceilometer/ceilometer.conf +++ b/openstack/usr/share/openstack/ceilometer/ceilometer.conf @@ -55,7 +55,7 @@ # The strategy to use for auth: noauth or keystone. (string # value) -#auth_strategy=keystone +auth_strategy=keystone # Deploy the deprecated v1 API. (boolean value) #enable_v1_api=true @@ -202,7 +202,7 @@ # Publish error events (boolean value) #publish_errors=false - + # Make deprecations fatal (boolean value) #fatal_deprecations=false @@ -246,7 +246,7 @@ # Use syslog for logging. Existing syslog format is DEPRECATED # during I, and then will be changed in J to honor RFC5424 # (boolean value) -#use_syslog=false +use_syslog=true # (Optional) Use syslog rfc5424 format for logging. If # enabled, will add APP-NAME (RFC5424) before the MSG part of @@ -310,7 +310,7 @@ # The messaging module to use, defaults to kombu. (string # value) -#rpc_backend=ceilometer.openstack.common.rpc.impl_kombu +rpc_backend=rabbit # Size of RPC thread pool (integer value) #rpc_thread_pool_size=64 @@ -371,26 +371,28 @@ # The RabbitMQ broker address where a single node is used # (string value) -#rabbit_host=localhost +rabbit_host = {{ RABBITMQ_HOST }} + # The RabbitMQ broker port where a single node is used # (integer value) -#rabbit_port=5672 +rabbit_port= {{ RABBITMQ_PORT }} # RabbitMQ HA cluster host:port pairs (list value) #rabbit_hosts=$rabbit_host:$rabbit_port # Connect over SSL for RabbitMQ (boolean value) -#rabbit_use_ssl=false +rabbit_use_ssl=false # The RabbitMQ userid (string value) -#rabbit_userid=guest +rabbit_userid= {{ RABBITMQ_USER }} # The RabbitMQ password (string value) -#rabbit_password=guest +rabbit_password = {{ RABBITMQ_PASSWORD }} + # The RabbitMQ virtual host (string value) -#rabbit_virtual_host=/ +rabbit_virtual_host=/ # How frequently to retry connecting with RabbitMQ (integer # value) @@ -523,7 +525,7 @@ # # Exchange name for Cinder notifications. (string value) -#cinder_control_exchange=cinder +cinder_control_exchange=cinder [alarm] @@ -631,8 +633,8 @@ # Deprecated group/name - [DEFAULT]/sql_connection # Deprecated group/name - [DATABASE]/sql_connection # Deprecated group/name - [sql]/connection -#connection=sqlite:////ceilometer/openstack/common/db/$sqlite_db - +connection=postgresql://{{ CEILOMETER_DB_USER }}:{{ CEILOMETER_DB_PASSWORD }}@{{ CONTROLLER_HOST_ADDRESS }}/ceilometer + # The SQLAlchemy connection string used to connect to the # slave database (string value) #slave_connection= @@ -753,7 +755,9 @@ #auth_protocol=https # Complete public Identity API endpoint (string value) -#auth_uri=<None> +auth_uri= http://{{ CONTROLLER_HOST_ADDRESS }}:5000/v2.0 +identity_uri = http://{{ CONTROLLER_HOST_ADDRESS }}:35357 + # API version of the admin Identity API endpoint (string # value) @@ -784,14 +788,14 @@ #admin_token=<None> # Keystone account username (string value) -#admin_user=<None> +admin_user = {{ CEILOMETER_SERVICE_USER }} # Keystone account password (string value) -#admin_password=<None> +admin_password = {{ CEILOMETER_SERVICE_PASSWORD }} # Keystone service account tenant name to validate user tokens # (string value) -#admin_tenant_name=admin +admin_tenant_name = service # Env key for the swift cache (string value) #cache=<None> @@ -912,8 +916,8 @@ # Secret value for signing metering messages. (string value) # Deprecated group/name - [DEFAULT]/metering_secret # Deprecated group/name - [publisher_rpc]/metering_secret -#metering_secret=change this or be hacked - +# It should be set to some random value +metering_secret = {{ METERING_SECRET }} [publisher_rpc] @@ -944,10 +948,10 @@ # User name to use for OpenStack service access. (string # value) -#os_username=ceilometer +os_username = {{ CEILOMETER_SERVICE_USER }} # Password to use for OpenStack service access. (string value) -#os_password=admin +os_password = {{ CEILOMETER_SERVICE_PASSWORD }} # Tenant ID to use for OpenStack service access. (string # value) @@ -955,21 +959,21 @@ # Tenant name to use for OpenStack service access. (string # value) -#os_tenant_name=admin +os_tenant_name = service # Certificate chain for SSL validation. (string value) #os_cacert=<None> # Auth URL to use for OpenStack service access. (string value) -#os_auth_url=http://localhost:5000/v2.0 - +os_auth_url = http://{{ CONTROLLER_HOST_ADDRESS }}:5000/v2.0 + # Region name to use for OpenStack service endpoints. (string # value) -#os_region_name=<None> +os_region_name=regionOne # Type of endpoint in Identity service catalog to use for # communication with OpenStack services. (string value) -#os_endpoint_type=publicURL +os_endpoint_type=internalURL # Disables X.509 certificate validation when an SSL connection # to Identity Service is established. (boolean value) diff --git a/openstack/usr/share/openstack/cinder/cinder.conf b/openstack/usr/share/openstack/cinder/cinder.conf index 1ca21082..a58004b5 100644 --- a/openstack/usr/share/openstack/cinder/cinder.conf +++ b/openstack/usr/share/openstack/cinder/cinder.conf @@ -162,7 +162,7 @@ rabbit_password={{ RABBITMQ_PASSWORD }} # Driver or drivers to handle sending notifications. (multi # valued) -#notification_driver= +notification_driver=messagingv2 # AMQP topic used for OpenStack notifications. (list value) # Deprecated group/name - [rpc_notifier2]/topics @@ -183,7 +183,7 @@ rpc_backend=rabbit # The default exchange under which topics are scoped. May be # overridden by an exchange name specified in the # transport_url option. (string value) -#control_exchange=openstack +control_exchange=cinder # diff --git a/openstack/usr/share/openstack/glance/glance-api.conf b/openstack/usr/share/openstack/glance/glance-api.conf index 675062a6..39257a6d 100644 --- a/openstack/usr/share/openstack/glance/glance-api.conf +++ b/openstack/usr/share/openstack/glance/glance-api.conf @@ -207,7 +207,7 @@ registry_client_protocol = http # Driver or drivers to handle sending notifications. Set to # 'messaging' to send notifications to a message queue. -# notification_driver = noop +notification_driver = messagingv2 # Default publisher_id for outgoing notifications. # default_publisher_id = image.localhost diff --git a/openstack/usr/share/openstack/glance/glance-registry.conf b/openstack/usr/share/openstack/glance/glance-registry.conf index e663148d..302f4138 100644 --- a/openstack/usr/share/openstack/glance/glance-registry.conf +++ b/openstack/usr/share/openstack/glance/glance-registry.conf @@ -82,21 +82,20 @@ use_syslog = True # Driver or drivers to handle sending notifications. Set to # 'messaging' to send notifications to a message queue. -# notification_driver = noop +notification_driver = messagingv2 # Default publisher_id for outgoing notifications. # default_publisher_id = image.localhost # Messaging driver used for 'messaging' notifications driver -# rpc_backend = 'rabbit' +rpc_backend=rabbit -# Configuration options if sending notifications via rabbitmq (these are -# the defaults) -rabbit_host = localhost -rabbit_port = 5672 +# Configuration options if sending notifications via rabbitmq +rabbit_host = {{ RABBITMQ_HOST }} +rabbit_port = {{ RABBITMQ_PORT }} rabbit_use_ssl = false -rabbit_userid = guest -rabbit_password = guest +rabbit_userid = {{ RABBITMQ_USER }} +rabbit_password = {{ RABBITMQ_PASSWORD }} rabbit_virtual_host = / rabbit_notification_exchange = glance rabbit_notification_topic = notifications diff --git a/openstack/usr/share/openstack/nova/nova.conf b/openstack/usr/share/openstack/nova/nova.conf index 6e49b4cc..43343cdd 100644 --- a/openstack/usr/share/openstack/nova/nova.conf +++ b/openstack/usr/share/openstack/nova/nova.conf @@ -161,7 +161,7 @@ rabbit_password={{ RABBITMQ_PASSWORD }} # Driver or drivers to handle sending notifications. (multi # valued) -#notification_driver= +notification_driver=messagingv2 # AMQP topic used for OpenStack notifications. (list value) # Deprecated group/name - [rpc_notifier2]/topics @@ -262,7 +262,7 @@ my_ip={{ MANAGEMENT_INTERFACE_IP_ADDRESS }} # notifications, "vm_state" for notifications on VM state # changes, or "vm_and_task_state" for notifications on VM and # task state changes. (string value) -#notify_on_state_change=<None> +notify_on_state_change=vm_and_task_state # If set, send api.fault notifications on caught exceptions in # the API service. (boolean value) @@ -466,7 +466,7 @@ compute_manager={{ COMPUTE_MANAGER }} # Time period to generate instance usages for. Time period # must be hour, day, month or year (string value) -#instance_usage_audit_period=month +instance_usage_audit_period=hour # Path to the rootwrap configuration file to use for running # commands as root (string value) @@ -847,7 +847,7 @@ osapi_compute_extension=nova.api.openstack.compute.contrib.standard_extensions # Generate periodic compute.instance.exists notifications # (boolean value) -#instance_usage_audit=false +instance_usage_audit=True # Number of 1 second retries needed in live_migration (integer # value) |