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