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