Merge "Open up firewall for the control-ports in the bundles"
[apex-tripleo-heat-templates.git] / docker / services / iscsid.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Iscsid service
5
6 parameters:
7   DockerIscsidImage:
8     description: image
9     type: string
10   DockerIscsidConfigImage:
11     description: The container image to use for the iscsid config_volume
12     type: string
13   EndpointMap:
14     default: {}
15     description: Mapping of service endpoint -> protocol. Typically set
16                  via parameter_defaults in the resource registry.
17     type: json
18   ServiceData:
19     default: {}
20     description: Dictionary packing service data
21     type: json
22   ServiceNetMap:
23     default: {}
24     description: Mapping of service_name -> network name. Typically set
25                  via parameter_defaults in the resource registry.  This
26                  mapping overrides those in ServiceNetMapDefaults.
27     type: json
28   RoleName:
29     default: ''
30     description: Role name on which the service is applied
31     type: string
32   RoleParameters:
33     default: {}
34     description: Parameters specific to the role
35     type: json
36   DefaultPasswords:
37     default: {}
38     type: json
39
40 resources:
41
42   ContainersCommon:
43     type: ./containers-common.yaml
44
45   IscsidBase:
46     type: ../../puppet/services/iscsid.yaml
47     properties:
48       EndpointMap: {get_param: EndpointMap}
49       ServiceNetMap: {get_param: ServiceNetMap}
50       DefaultPasswords: {get_param: DefaultPasswords}
51       RoleName: {get_param: RoleName}
52       RoleParameters: {get_param: RoleParameters}
53
54 outputs:
55   role_data:
56     description: Role data for the Iscsid role.
57     value:
58       service_name: {get_attr: [IscsidBase, role_data, service_name]}
59       config_settings: {get_attr: [IscsidBase, role_data, config_settings]}
60       step_config: &step_config
61         {get_attr: [IscsidBase, role_data, step_config]}
62       service_config_settings: {get_attr: [IscsidBase, role_data, service_config_settings]}
63       # BEGIN DOCKER SETTINGS
64       puppet_config:
65         config_volume: iscsid
66         puppet_tags: iscsid_config
67         step_config: *step_config
68         config_image: {get_param: DockerIscsidConfigImage}
69       kolla_config:
70         /var/lib/kolla/config_files/iscsid.json:
71           command: /usr/sbin/iscsid -f
72           config_files:
73             - source: "/var/lib/kolla/config_files/src-iscsid/*"
74               dest: "/"
75               merge: true
76               preserve_properties: true
77       docker_config:
78         step_3:
79           iscsid:
80             start_order: 2
81             image: {get_param: DockerIscsidImage}
82             net: host
83             privileged: true
84             restart: always
85             volumes:
86               list_concat:
87                 - {get_attr: [ContainersCommon, volumes]}
88                 -
89                   - /var/lib/kolla/config_files/iscsid.json:/var/lib/kolla/config_files/config.json:ro
90                   - /dev/:/dev/
91                   - /run/:/run/
92                   - /sys:/sys
93                   - /lib/modules:/lib/modules:ro
94                   - /var/lib/config-data/puppet-generated/iscsid/:/var/lib/kolla/config_files/src-iscsid:ro
95             environment:
96               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
97       host_prep_tasks:
98         - name: stat /lib/systemd/system/iscsid.socket
99           stat: path=/lib/systemd/system/iscsid.socket
100           register: stat_iscsid_socket
101         - name: Stop and disable iscsid.socket service
102           service: name=iscsid.socket state=stopped enabled=no
103           when: stat_iscsid_socket.stat.exists
104       upgrade_tasks:
105         - name: stat /lib/systemd/system/iscsid.service
106           tags: step2
107           stat: path=/lib/systemd/system/iscsid.service
108           register: stat_iscsid_service
109         - name: Stop and disable iscsid service
110           tags: step2
111           service: name=iscsid state=stopped enabled=no
112           when: stat_iscsid_service.stat.exists
113         - name: stat /lib/systemd/system/iscsid.socket
114           tags: step2
115           stat: path=/lib/systemd/system/iscsid.socket
116           register: stat_iscsid_socket
117         - name: Stop and disable iscsid.socket service
118           tags: step2
119           service: name=iscsid.socket state=stopped enabled=no
120           when: stat_iscsid_socket.stat.exists
121       metadata_settings: {}