Add role specific information to the service template
[apex-tripleo-heat-templates.git] / docker / services / ironic-pxe.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Ironic PXE service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerIronicPxeImage:
12     description: image
13     default: 'centos-binary-ironic-pxe:latest'
14     type: string
15   DockerIronicConfigImage:
16     description: image
17     default: 'centos-binary-ironic-pxe: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   DefaultPasswords:
31     default: {}
32     type: json
33   RoleName:
34     default: ''
35     description: Role name on which the service is applied
36     type: string
37   RoleParameters:
38     default: {}
39     description: Parameters specific to the role
40
41 resources:
42
43   ContainersCommon:
44     type: ./containers-common.yaml
45
46 outputs:
47   role_data:
48     description: Role data for the Ironic PXE role.
49     value:
50       service_name: ironic_pxe
51       config_settings: {}
52       step_config: &step_config ''
53       service_config_settings: {}
54       # BEGIN DOCKER SETTINGS
55       puppet_config:
56         config_volume: ironic
57         puppet_tags: ironic_config
58         step_config: *step_config
59         config_image:
60           list_join:
61             - '/'
62             - [ {get_param: DockerNamespace}, {get_param: DockerIronicConfigImage} ]
63       kolla_config:
64         /var/lib/kolla/config_files/ironic_pxe_http.json:
65           command: /usr/sbin/httpd -DFOREGROUND
66         /var/lib/kolla/config_files/ironic_pxe_tftp.json:
67           command: /usr/sbin/in.tftpd --foreground --user root --address 0.0.0.0:69 --map-file /var/lib/ironic/tftpboot/map-file /var/lib/ironic/tftpboot
68           permissions:
69             - path: /var/log/ironic
70               owner: ironic:ironic
71               recurse: true
72       docker_config:
73         step_4:
74           ironic_pxe_tftp:
75             start_order: 90
76             image: &ironic_pxe_image
77               list_join:
78                 - '/'
79                 - [ {get_param: DockerNamespace}, {get_param: DockerIronicPxeImage} ]
80             net: host
81             privileged: false
82             restart: always
83             volumes:
84               list_concat:
85                 - {get_attr: [ContainersCommon, volumes]}
86                 -
87                   - /var/lib/kolla/config_files/ironic_pxe_tftp.json:/var/lib/kolla/config_files/config.json:ro
88                   - /var/lib/config-data/ironic/etc/ironic/:/etc/ironic/:ro
89                   # TODO(mandre) check how docker like mounting in a bind-mounted tree
90                   # This directory may contain migrated data from BM
91                   - /var/lib/ironic:/var/lib/ironic/
92                   # These files were generated by puppet inside the config container
93                   # TODO(mandre) check the mount permission (ro/rw)
94                   - /var/lib/config-data/ironic/var/lib/ironic/tftpboot/chain.c32:/var/lib/ironic/tftpboot/chain.c32
95                   - /var/lib/config-data/ironic/var/lib/ironic/tftpboot/pxelinux.0:/var/lib/ironic/tftpboot/pxelinux.0
96                   - /var/lib/config-data/ironic/var/lib/ironic/tftpboot/ipxe.efi:/var/lib/ironic/tftpboot/ipxe.efi
97                   - /var/lib/config-data/ironic/var/lib/ironic/tftpboot/undionly.kpxe:/var/lib/ironic/tftpboot/undionly.kpxe
98                   - /var/lib/config-data/ironic/var/lib/ironic/tftpboot/map-file:/var/lib/ironic/tftpboot/map-file
99                   - /dev/log:/dev/log
100                   - /var/log/containers/ironic:/var/log/ironic
101             environment:
102               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
103           ironic_pxe_http:
104             start_order: 91
105             image: *ironic_pxe_image
106             net: host
107             privileged: false
108             restart: always
109             volumes:
110               list_concat:
111                 - {get_attr: [ContainersCommon, volumes]}
112                 -
113                   - /var/lib/kolla/config_files/ironic_pxe_http.json:/var/lib/kolla/config_files/config.json:ro
114                   - /var/lib/config-data/ironic/etc/ironic/:/etc/ironic/:ro
115                   - /var/lib/config-data/ironic/etc/httpd/:/etc/httpd/:ro
116                   - /var/lib/config-data/ironic/var/www/:/var/www/:ro
117                   - /var/lib/ironic:/var/lib/ironic/
118                   - /var/log/containers/ironic:/var/log/ironic
119             environment:
120               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
121       host_prep_tasks:
122         - name: create persistent directories
123           file:
124             path: "{{ item }}"
125             state: directory
126           with_items:
127             - /var/lib/ironic
128             - /var/log/containers/ironic