Merge "Remove package if service stopped and disabled" into stable/pike
[apex-tripleo-heat-templates.git] / docker / services / sshd.yaml
1 heat_template_version: pike
2
3 description: >
4   Configure sshd_config
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   MigrationSshPort:
34     default: 2022
35     description: Target port for migration over ssh
36     type: number
37
38 conditions:
39
40   # During Ocata->Pike upgrade initially configure the ssh service on port 22
41   # to proxy migration commands to the containerized sshd on port 2022.
42   # When the upgrade converges we can switch migrations over to port 2022.
43   enable_migration_proxy:
44     equals:
45       - {get_param: MigrationSshPort}
46       - 22
47
48 resources:
49    SshdBase:
50     type: ../../puppet/services/sshd.yaml
51     properties:
52       EndpointMap: {get_param: EndpointMap}
53       ServiceNetMap: {get_param: ServiceNetMap}
54       DefaultPasswords: {get_param: DefaultPasswords}
55       RoleName: {get_param: RoleName}
56       RoleParameters: {get_param: RoleParameters}
57
58 outputs:
59   role_data:
60     description: Role data for the ssh
61     value:
62       service_name: sshd
63       config_settings: {get_attr: [SshdBase, role_data, config_settings]}
64       step_config:
65         list_join:
66           - "\n"
67           - - get_attr: [SshdBase, role_data, step_config]
68             - if:
69               - enable_migration_proxy
70               - |
71                 include tripleo::profile::base::nova::migration::proxy
72               - ''