Merge "Containerize Congress API service"
[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   CongressDebug:
37     default: ''
38     description: Set to True to enable debugging Glance service.
39     type: string
40   KeystoneRegion:
41     type: string
42     default: 'regionOne'
43     description: Keystone region for endpoint
44   RabbitPassword:
45     description: The password for RabbitMQ
46     type: string
47     hidden: true
48   RabbitUserName:
49     default: guest
50     description: The username for RabbitMQ
51     type: string
52   RabbitClientUseSSL:
53     default: false
54     description: >
55         Rabbit client subscriber parameter to specify
56         an SSL connection to the RabbitMQ host.
57     type: string
58   RabbitClientPort:
59     default: 5672
60     description: Set rabbit subscriber port, change this if using SSL
61     type: number
62   CongressPolicies:
63     description: |
64       A hash of policies to configure for Congress.
65       e.g. { congress-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
66     default: {}
67     type: json
68
69 conditions:
70   service_debug_unset: {equals : [{get_param: CongressDebug}, '']}
71
72 outputs:
73   role_data:
74     description: Role data for the Congress role.
75     value:
76       service_name: congress
77       config_settings:
78         congress_password: {get_param: CongressPassword}
79         congress::db::database_connection:
80           make_url:
81             scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
82             username: congress
83             password: {get_param: CongressPassword}
84             host: {get_param: [EndpointMap, MysqlInternal, host]}
85             path: /congress
86             query:
87               read_default_file: /etc/my.cnf.d/tripleo.cnf
88               read_default_group: tripleo
89         congress::debug:
90           if:
91           - service_debug_unset
92           - {get_param: Debug }
93           - {get_param: CongressDebug }
94         congress::rpc_backend: rabbit
95         congress::rabbit_userid: {get_param: RabbitUserName}
96         congress::rabbit_password: {get_param: RabbitPassword}
97         congress::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
98         congress::rabbit_port: {get_param: RabbitClientPort}
99         congress::server::bind_host: {get_param: [ServiceNetMap, CongressApiNetwork]}
100
101         congress::keystone::authtoken::password: {get_param: CongressPassword}
102         congress::keystone::authtoken::project_name: 'service'
103         congress::keystone::authtoken::user_domain_name: 'Default'
104         congress::keystone::authtoken::project_domain_name: 'Default'
105         congress::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
106         congress::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
107
108         congress::db::mysql::password: {get_param: CongressPassword}
109         congress::db::mysql::user: congress
110         congress::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
111         congress::db::mysql::dbname: congress
112         congress::db::mysql::allowed_hosts:
113           - '%'
114           - {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
115         congress::policy::policies: {get_param: CongressPolicies}
116
117       service_config_settings:
118         keystone:
119           congress::keystone::auth::tenant: 'service'
120           congress::keystone::auth::region: {get_param: KeystoneRegion}
121           congress::keystone::auth::password: {get_param: CongressPassword}
122           congress::keystone::auth::public_url: {get_param: [EndpointMap, CongressPublic, uri]}
123           congress::keystone::auth::internal_url: {get_param: [EndpointMap, CongressInternal, uri]}
124           congress::keystone::auth::admin_url: {get_param: [EndpointMap, CongressAdmin, uri]}
125
126       step_config: |
127         include ::tripleo::profile::base::congress
128
129       upgrade_tasks:
130         - name: Check if congress is deployed
131           command: systemctl is-enabled openstack-congress-server
132           tags: common
133           ignore_errors: True
134           register: congress_enabled
135         - name: "PreUpgrade step0,validation: Check service openstack-congress-server is running"
136           shell: /usr/bin/systemctl show 'openstack-congress-server' --property ActiveState | grep '\bactive\b'
137           when: congress_enabled.rc == 0
138           tags: step0,validation
139         - name: Stop congress service
140           tags: step1
141           when: congress_enabled.rc == 0
142           service: name=openstack-congress-server state=stopped
143         - name: Install openstack-congress package if it was disabled
144           tags: step3
145           yum: name=openstack-congress state=latest
146           when: congress_enabled.rc != 0