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