Add role specific information to the service template
[apex-tripleo-heat-templates.git] / puppet / services / congress.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Congress service configured with Puppet
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   CongressPassword:
30     description: The password for the congress service account.
31     type: string
32     hidden: true
33   Debug:
34     type: string
35     default: ''
36   KeystoneRegion:
37     type: string
38     default: 'regionOne'
39     description: Keystone region for endpoint
40   RabbitPassword:
41     description: The password for RabbitMQ
42     type: string
43     hidden: true
44   RabbitUserName:
45     default: guest
46     description: The username for RabbitMQ
47     type: string
48   RabbitClientUseSSL:
49     default: false
50     description: >
51         Rabbit client subscriber parameter to specify
52         an SSL connection to the RabbitMQ host.
53     type: string
54   RabbitClientPort:
55     default: 5672
56     description: Set rabbit subscriber port, change this if using SSL
57     type: number
58   CongressPolicies:
59     description: |
60       A hash of policies to configure for Congress.
61       e.g. { congress-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
62     default: {}
63     type: json
64
65 outputs:
66   role_data:
67     description: Role data for the Congress role.
68     value:
69       service_name: congress
70       config_settings:
71         congress_password: {get_param: CongressPassword}
72         congress::db::database_connection:
73           make_url:
74             scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
75             username: congress
76             password: {get_param: CongressPassword}
77             host: {get_param: [EndpointMap, MysqlInternal, host]}
78             path: /congress
79             query:
80               read_default_file: /etc/my.cnf.d/tripleo.cnf
81               read_default_group: tripleo
82         congress::debug: {get_param: Debug}
83         congress::rpc_backend: rabbit
84         congress::rabbit_userid: {get_param: RabbitUserName}
85         congress::rabbit_password: {get_param: RabbitPassword}
86         congress::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
87         congress::rabbit_port: {get_param: RabbitClientPort}
88         congress::server::bind_host: {get_param: [ServiceNetMap, CongressApiNetwork]}
89
90         congress::keystone::authtoken::password: {get_param: CongressPassword}
91         congress::keystone::authtoken::project_name: 'service'
92         congress::keystone::authtoken::user_domain_name: 'Default'
93         congress::keystone::authtoken::project_domain_name: 'Default'
94         congress::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
95         congress::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
96
97         congress::db::mysql::password: {get_param: CongressPassword}
98         congress::db::mysql::user: congress
99         congress::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
100         congress::db::mysql::dbname: congress
101         congress::db::mysql::allowed_hosts:
102           - '%'
103           - {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
104         congress::policy::policies: {get_param: CongressPolicies}
105
106       service_config_settings:
107         keystone:
108           congress::keystone::auth::tenant: 'service'
109           congress::keystone::auth::region: {get_param: KeystoneRegion}
110           congress::keystone::auth::password: {get_param: CongressPassword}
111           congress::keystone::auth::public_url: {get_param: [EndpointMap, CongressPublic, uri]}
112           congress::keystone::auth::internal_url: {get_param: [EndpointMap, CongressInternal, uri]}
113           congress::keystone::auth::admin_url: {get_param: [EndpointMap, CongressAdmin, uri]}
114
115       step_config: |
116         include ::tripleo::profile::base::congress
117
118       upgrade_tasks:
119         - name: Check if congress is deployed
120           command: systemctl is-enabled openstack-congress-server
121           tags: common
122           ignore_errors: True
123           register: congress_enabled
124         - name: "PreUpgrade step0,validation: Check service openstack-congress-server is running"
125           shell: /usr/bin/systemctl show 'openstack-congress-server' --property ActiveState | grep '\bactive\b'
126           when: congress_enabled.rc == 0
127           tags: step0,validation
128         - name: Stop congress service
129           tags: step1
130           when: congress_enabled.rc == 0
131           service: name=openstack-congress-server state=stopped
132         - name: Install openstack-congress package if it was disabled
133           tags: step3
134           yum: name=openstack-congress state=latest
135           when: congress_enabled.rc != 0