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