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