Merge "Initial VIP ipv6 minor update code"
[apex-tripleo-heat-templates.git] / docker / services / keystone.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Keystone service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerKeystoneImage:
12     description: image
13     default: 'centos-binary-keystone:latest'
14     type: string
15   EndpointMap:
16     default: {}
17     description: Mapping of service endpoint -> protocol. Typically set
18                  via parameter_defaults in the resource registry.
19     type: json
20   ServiceNetMap:
21     default: {}
22     description: Mapping of service_name -> network name. Typically set
23                  via parameter_defaults in the resource registry.  This
24                  mapping overrides those in ServiceNetMapDefaults.
25     type: json
26   DefaultPasswords:
27     default: {}
28     type: json
29   AdminPassword:
30     description: The password for the keystone admin account, used for monitoring, querying neutron etc.
31     type: string
32     hidden: true
33   KeystoneTokenProvider:
34     description: The keystone token format
35     type: string
36     default: 'fernet'
37     constraints:
38       - allowed_values: ['uuid', 'fernet']
39   EnableInternalTLS:
40     type: boolean
41     default: false
42
43 resources:
44
45   ContainersCommon:
46     type: ./containers-common.yaml
47
48   KeystoneBase:
49     type: ../../puppet/services/keystone.yaml
50     properties:
51       EndpointMap: {get_param: EndpointMap}
52       ServiceNetMap: {get_param: ServiceNetMap}
53       DefaultPasswords: {get_param: DefaultPasswords}
54
55 conditions:
56
57   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
58
59 outputs:
60   role_data:
61     description: Role data for the Keystone API role.
62     value:
63       service_name: {get_attr: [KeystoneBase, role_data, service_name]}
64       config_settings:
65         map_merge:
66           - get_attr: [KeystoneBase, role_data, config_settings]
67           - apache::default_vhost: false
68       step_config: &step_config
69         list_join:
70           - "\n"
71           - - "['Keystone_user', 'Keystone_endpoint', 'Keystone_domain', 'Keystone_tenant', 'Keystone_user_role', 'Keystone_role', 'Keystone_service'].each |String $val| { noop_resource($val) }"
72             - {get_attr: [KeystoneBase, role_data, step_config]}
73       service_config_settings: {get_attr: [KeystoneBase, role_data, service_config_settings]}
74       # BEGIN DOCKER SETTINGS
75       puppet_config:
76         config_volume: keystone
77         puppet_tags: keystone_config
78         step_config: *step_config
79         config_image: &keystone_image
80           list_join:
81             - '/'
82             - [ {get_param: DockerNamespace}, {get_param: DockerKeystoneImage} ]
83       kolla_config:
84         /var/lib/kolla/config_files/keystone.json:
85           command: /usr/sbin/httpd -DFOREGROUND
86       docker_config:
87         step_3:
88           keystone-init-log:
89             start_order: 0
90             image: *keystone_image
91             user: root
92             command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && mkdir -p /var/log/keystone && chown keystone:keystone /var/log/keystone']
93             volumes:
94               - logs:/var/log
95           keystone_db_sync:
96             start_order: 1
97             image: *keystone_image
98             net: host
99             privileged: false
100             detach: false
101             volumes: &keystone_volumes
102               list_concat:
103                 - {get_attr: [ContainersCommon, volumes]}
104                 -
105                   - /var/lib/kolla/config_files/keystone.json:/var/lib/kolla/config_files/config.json:ro
106                   - /var/lib/config-data/keystone/var/www/:/var/www/:ro
107                   - /var/lib/config-data/keystone/etc/keystone/:/etc/keystone/:ro
108                   - /var/lib/config-data/keystone/etc/httpd/:/etc/httpd/:ro
109                   - logs:/var/log
110                   -
111                     if:
112                       - internal_tls_enabled
113                       - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
114                       - ''
115                   -
116                     if:
117                       - internal_tls_enabled
118                       - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
119                       - ''
120             environment:
121               - KOLLA_BOOTSTRAP=True
122               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
123           keystone:
124             start_order: 1
125             image: *keystone_image
126             net: host
127             privileged: false
128             restart: always
129             volumes: *keystone_volumes
130             environment:
131               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
132           keystone_bootstrap:
133             start_order: 2
134             action: exec
135             command:
136               [ 'keystone', 'keystone-manage', 'bootstrap', '--bootstrap-password', {get_param: AdminPassword} ]
137       docker_puppet_tasks:
138         # Keystone endpoint creation occurs only on single node
139         step_3:
140           config_volume: 'keystone_init_tasks'
141           puppet_tags: 'keystone_config,keystone_domain_config,keystone_endpoint,keystone_identity_provider,keystone_paste_ini,keystone_role,keystone_service,keystone_tenant,keystone_user,keystone_user_role,keystone_domain'
142           step_config: 'include ::tripleo::profile::base::keystone'
143           config_image: *keystone_image
144       upgrade_tasks:
145         - name: Stop and disable keystone service (running under httpd)
146           tags: step2
147           service: name=httpd state=stopped enabled=no
148       metadata_settings:
149         get_attr: [KeystoneBase, role_data, metadata_settings]