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