clean up attributes for mq and database

Registered by Salman Baset

There are currently a wide variety of naming schemas and places defining the current attributes for the mq and db services. The proposal is to unify them under a consistent pattern and only define them in the openstack-common cookbook. openstack-common is the logical location for them because openstack-ops-database and openstack-ops-messaging are considered "reference implementations" and other cookbooks depend on their attributes. Setting them centrally keeps them logically constrained.

The proposed consistent naming schema is to put the database attributes under

    node['openstack']['db']
    node['openstack']['db']['platform']
    node['openstack']['db']['service_type']
    node['openstack']['db']['bind_interface']

Anything specific to a database implementation would be nested under the particular service type. For example

    db_type = node['openstack']['db']['service_type']

    node['openstack']['db'][db_type]['cluster'] = false
    node['openstack']['db'][db_type]['host'] = '127.0.0.1'

    node['openstack']['db']['mysql']['port'] = '3306'
    node['openstack']['db']['mysql']['root_user_key'] = 'mysqlroot'

or similarly for messaging

    node['openstack']['mq']['qpid']['heartbeat'] = 60
    node['openstack']['mq']['qpid']['host'] = '127.0.0.1'
    node['openstack']['mq']['qpid']['password'] = ''
    node['openstack']['mq']['qpid']['port'] = '5672'

For OpenStack services that may need to have specific settings, the namespace is
    node['openstack']['db'][SERVICE]

    node['openstack']['db']['compute']['db_name'] = 'nova'
    node['openstack']['db']['compute'][db_type]['host'] = '127.0.0.1'
    node['openstack']['db']['compute'][db_type]['port'] = node['openstack']['db'][db_type]['port']

or similarly for messaging

    node['openstack']['mq']['compute']['qpid']['reconnect_interval_min'] = 0
    node['openstack']['mq']['compute']['qpid']['reconnect_limit'] = 0
    node['openstack']['mq']['compute']['qpid']['reconnect_timeout'] = 0

The proposed changes are:
1) All node[openstack][db] attributes will be defined in openstack-common/attributes/database.rb and removed from openstack-ops-database and other OpenStack cookbooks.
2) All node[openstack][mq] attributes will be defined in openstack-common/attributes/messaging.rb and removed from openstack-ops-messaging and other OpenStack cookbooks.
3) The attribute namespaces will be consolidated as described above.

Blueprint information

Status:
Complete
Approver:
Matt Ray
Priority:
Medium
Drafter:
None
Direction:
Needs approval
Assignee:
Matt Thompson
Definition:
Approved
Series goal:
Accepted for havana
Implementation:
Implemented
Milestone target:
milestone icon havana-stable
Started by
Justin Shepherd
Completed by
Matt Thompson

Whiteboard

Many reviews to follow

Gerrit topic: https://review.openstack.org/#q,topic:bp/clean-up-attr-for-mq-and-db,n,z

Addressed by: https://review.openstack.org/66873
    Move db and mq attributes into separate files

Addressed by: https://review.openstack.org/67242
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67243
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67244
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67245
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67246
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67248
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67249
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67250
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

Addressed by: https://review.openstack.org/67445
    bp/clean-up-attr-for-mq-and-db work

Addressed by: https://review.openstack.org/68100
    Clean up cookbook for bp/clean-up-attr-for-mq-and-db

(?)

Work Items

Work items:
[mattt416] Create openstack-common/attributes/{database,messaging}.rb and move db/mq attributes from default.rb into {database,messaging}.rb: DONE
[mattt416] Copy openstack.SERVICE.db.username attribute from openstack-{compute,dashboard,identity,image,metering,network} cookbooks to openstack-common and fix namespace to openstack.db.SERVICE.username: DONE
[mattt416] Copy openstack.SERVICE.mq and openstack.SERVICE.rabbit attributes from cookbook-openstack-{block-storage,compute,image,metering,network} to openstack-common/attributes/messaging.rb while transforming attribute namespace to openstack.mq.SERVICE and openstack.mq.SERVICE.rabbit: DONE
[mattt416] Update openstack-ops-database/recipes/openstack-db.rb changing openstack.SERVICE.db.username to openstack.db.SERVICE.username: DONE
[mattt416] Update cookbook-openstack-{block-storage,compute,image,metering,network} to reference openstack.mq.SERVICE instead of openstack.SERVICE.mq and openstack.SERVICE.rabbit: DONE
[mattt416] Remove openstack.mq and openstack.SERVICE.rabbit attributes from openstack-ops-messaging: DONE
[mattt416] Remove openstack.SERVICE.mq and openstack.SERVICE.rabbit attributes from cookbook-openstack-{block-storage,compute,image,metering,network}: DONE
[mattt416] Remove openstack.SERVICE.db.username attribute from openstack-{compute,dashboard,identity,image,metering,network} cookbooks and update recipes in each cookbook to reference openstack.db.SERVICE.username instead: DONE

This blueprint contains Public information 
Everyone can see this information.