Merge "Add support for running crontabs in containers"
[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   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   TackerPassword:
30     description: The password for the tacker service account.
31     type: string
32     hidden: true
33   Debug:
34     type: string
35     default: ''
36   TackerDebug:
37     default: ''
38     description: Set to True to enable debugging Tacker 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   TackerPolicies:
63     description: |
64       A hash of policies to configure for Tacker.
65       e.g. { tacker-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
66     default: {}
67     type: json
68   NotificationDriver:
69     type: string
70     default: 'messagingv2'
71     description: Driver or drivers to handle sending notifications.
72     constraints:
73       - allowed_values: [ 'messagingv2', 'noop' ]
74
75 conditions:
76   service_debug_unset: {equals : [{get_param: TackerDebug}, '']}
77
78 outputs:
79   role_data:
80     description: Role data for the Tacker role.
81     value:
82       service_name: tacker
83       config_settings:
84         tacker_password: {get_param: TackerPassword}
85         tacker::db::database_connection:
86           make_url:
87             scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
88             username: tacker
89             password: {get_param: TackerPassword}
90             host: {get_param: [EndpointMap, MysqlInternal, host]}
91             path: /tacker
92             query:
93               read_default_file: /etc/my.cnf.d/tripleo.cnf
94               read_default_group: tripleo
95
96         tacker::debug:
97           if:
98           - service_debug_unset
99           - {get_param: Debug }
100           - {get_param: TackerDebug }
101         tacker::rpc_backend: rabbit
102         tacker::notification_driver: {get_param: NotificationDriver}
103         tacker::rabbit_userid: {get_param: RabbitUserName}
104         tacker::rabbit_password: {get_param: RabbitPassword}
105         tacker::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
106         tacker::rabbit_port: {get_param: RabbitClientPort}
107         tacker::server::bind_host: {get_param: [ServiceNetMap, TackerApiNetwork]}
108
109         tacker::keystone::authtoken::project_name: 'service'
110         tacker::keystone::authtoken::user_domain_name: 'Default'
111         tacker::keystone::authtoken::project_domain_name: 'Default'
112         tacker::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
113         tacker::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
114
115         tacker::db::mysql::password: {get_param: TackerPassword}
116         tacker::db::mysql::user: tacker
117         tacker::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
118         tacker::db::mysql::dbname: tacker
119         tacker::db::mysql::allowed_hosts:
120           - '%'
121           - {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
122         tacker::policy::policies: {get_param: TackerPolicies}
123
124       service_config_settings:
125         keystone:
126           tacker::keystone::auth::tenant: 'service'
127           tacker::keystone::auth::region: {get_param: KeystoneRegion}
128           tacker::keystone::auth::password: {get_param: TackerPassword}
129           tacker::keystone::auth::public_url: {get_param: [EndpointMap, TackerPublic, uri]}
130           tacker::keystone::auth::internal_url: {get_param: [EndpointMap, TackerInternal, uri]}
131           tacker::keystone::auth::admin_url: {get_param: [EndpointMap, TackerAdmin, uri]}
132
133       step_config: |
134         include ::tripleo::profile::base::tacker
135       upgrade_tasks:
136         - name: Check if tacker is deployed
137           command: systemctl is-enabled openstack-tacker-server
138           tags: common
139           ignore_errors: True
140           register: tacker_enabled
141         - name: "PreUpgrade step0,validation: Check service openstack-tacker-server is running"
142           shell: /usr/bin/systemctl show 'openstack-tacker-server' --property ActiveState | grep '\bactive\b'
143           when: tacker_enabled.rc == 0
144           tags: step0,validation
145         - name: Stop tacker service
146           tags: step1
147           when: tacker_enabled.rc == 0
148           service: name=openstack-tacker-server state=stopped
149         - name: Install openstack-tacker package if it was disabled
150           tags: step3
151           yum: name=openstack-tacker state=latest
152           when: tacker_enabled.rc != 0