Merge "Open up firewall for the control-ports in the bundles"
[apex-tripleo-heat-templates.git] / docker / services / nova-migration-target.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Nova Migration Target service
5
6 parameters:
7   DockerNovaComputeImage:
8     description: image
9     type: string
10   DockerNovaLibvirtConfigImage:
11     description: The container image to use for the nova_libvirt config_volume
12     type: string
13   ServiceData:
14     default: {}
15     description: Dictionary packing service data
16     type: json
17   ServiceNetMap:
18     default: {}
19     description: Mapping of service_name -> network name. Typically set
20                  via parameter_defaults in the resource registry.  This
21                  mapping overrides those in ServiceNetMapDefaults.
22     type: json
23   DefaultPasswords:
24     default: {}
25     type: json
26   RoleName:
27     default: ''
28     description: Role name on which the service is applied
29     type: string
30   RoleParameters:
31     default: {}
32     description: Parameters specific to the role
33     type: json
34   EndpointMap:
35     default: {}
36     description: Mapping of service endpoint -> protocol. Typically set
37                  via parameter_defaults in the resource registry.
38     type: json
39   DockerNovaMigrationSshdPort:
40     default: 2022
41     description: Port that dockerized nova migration target sshd service
42                  binds to.
43     type: number
44
45 resources:
46
47   ContainersCommon:
48     type: ./containers-common.yaml
49
50   SshdBase:
51     type: ../../puppet/services/sshd.yaml
52     properties:
53       EndpointMap: {get_param: EndpointMap}
54       ServiceNetMap: {get_param: ServiceNetMap}
55       DefaultPasswords: {get_param: DefaultPasswords}
56       RoleName: {get_param: RoleName}
57       RoleParameters: {get_param: RoleParameters}
58
59   NovaMigrationTargetBase:
60     type: ../../puppet/services/nova-migration-target.yaml
61     properties:
62       EndpointMap: {get_param: EndpointMap}
63       ServiceNetMap: {get_param: ServiceNetMap}
64       DefaultPasswords: {get_param: DefaultPasswords}
65       RoleName: {get_param: RoleName}
66       RoleParameters: {get_param: RoleParameters}
67
68 outputs:
69   role_data:
70     description: Role data for the Nova Migration Target service.
71     value:
72       service_name: nova_migration_target
73       config_settings:
74         map_merge:
75           - get_attr: [SshdBase, role_data, config_settings]
76           - get_attr: [NovaMigrationTargetBase, role_data, config_settings]
77           - tripleo.nova_migration_target.firewall_rules:
78               '113 nova_migration_target':
79                 dport:
80                   - {get_param: DockerNovaMigrationSshdPort}
81       step_config: &step_config
82         list_join:
83           - "\n"
84           - - get_attr: [SshdBase, role_data, step_config]
85             - get_attr: [NovaMigrationTargetBase, role_data, step_config]
86       puppet_config:
87         config_volume: nova_libvirt
88         step_config: *step_config
89         config_image: {get_param: DockerNovaLibvirtConfigImage}
90       kolla_config:
91         /var/lib/kolla/config_files/nova-migration-target.json:
92           command:
93             str_replace:
94               template: "/usr/sbin/sshd -D -p SSHDPORT"
95               params:
96                 SSHDPORT: {get_param: DockerNovaMigrationSshdPort}
97           config_files:
98             - source: "/var/lib/kolla/config_files/src/*"
99               dest: "/"
100               merge: true
101               preserve_properties: true
102             - source: /host-ssh/ssh_host_*_key
103               dest: /etc/ssh/
104               owner: "root"
105               perm: "0600"
106       docker_config:
107         step_4:
108           nova_migration_target:
109             image: {get_param: DockerNovaComputeImage}
110             net: host
111             privileged: true
112             user: root
113             restart: always
114             volumes:
115               list_concat:
116                 - {get_attr: [ContainersCommon, volumes]}
117                 -
118                   - /var/lib/kolla/config_files/nova-migration-target.json:/var/lib/kolla/config_files/config.json:ro
119                   - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
120                   - /etc/ssh/:/host-ssh/:ro
121                   - /run:/run
122                   - /var/lib/nova:/var/lib/nova
123             environment:
124              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS