Merge "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   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 outputs:
46   role_data:
47     description: Role data for the Iscsid API role.
48     value:
49       service_name: iscsid
50       config_settings: {}
51       step_config: ''
52       service_config_settings: {}
53       # BEGIN DOCKER SETTINGS
54       puppet_config:
55         config_volume: iscsid
56         #puppet_tags: file
57         step_config: ''
58         config_image: {get_param: DockerIscsidConfigImage}
59       kolla_config:
60         /var/lib/kolla/config_files/iscsid.json:
61           command: /usr/sbin/iscsid -f
62       docker_config:
63         step_3:
64           iscsid:
65             start_order: 2
66             image: {get_param: DockerIscsidImage}
67             net: host
68             privileged: true
69             restart: always
70             volumes:
71               list_concat:
72                 - {get_attr: [ContainersCommon, volumes]}
73                 -
74                   - /var/lib/kolla/config_files/iscsid.json:/var/lib/kolla/config_files/config.json:ro
75                   - /dev/:/dev/
76                   - /run/:/run/
77                   - /sys:/sys
78                   - /lib/modules:/lib/modules:ro
79                   - /etc/iscsi:/etc/iscsi
80             environment:
81               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
82       host_prep_tasks:
83         - name: create /etc/iscsi
84           file:
85             path: /etc/iscsi
86             state: directory
87         - name: stat /lib/systemd/system/iscsid.socket
88           stat: path=/lib/systemd/system/iscsid.socket
89           register: stat_iscsid_socket
90         - name: Stop and disable iscsid.socket service
91           service: name=iscsid.socket state=stopped enabled=no
92           when: stat_iscsid_socket.stat.exists
93       upgrade_tasks:
94         - name: stat /lib/systemd/system/iscsid.service
95           tags: step2
96           stat: path=/lib/systemd/system/iscsid.service
97           register: stat_iscsid_service
98         - name: Stop and disable iscsid service
99           tags: step2
100           service: name=iscsid state=stopped enabled=no
101           when: stat_iscsid_service.stat.exists
102         - name: stat /lib/systemd/system/iscsid.socket
103           tags: step2
104           stat: path=/lib/systemd/system/iscsid.socket
105           register: stat_iscsid_socket
106         - name: Stop and disable iscsid.socket service
107           tags: step2
108           service: name=iscsid.socket state=stopped enabled=no
109           when: stat_iscsid_socket.stat.exists
110       metadata_settings: {}