Merge "Adds network/cidr mapping into a new service property"
[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: The container image to use for the ironic config_volume
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   ServiceData:
25     default: {}
26     description: Dictionary packing service data
27     type: json
28   ServiceNetMap:
29     default: {}
30     description: Mapping of service_name -> network name. Typically set
31                  via parameter_defaults in the resource registry.  This
32                  mapping overrides those in ServiceNetMapDefaults.
33     type: json
34   DefaultPasswords:
35     default: {}
36     type: json
37   RoleName:
38     default: ''
39     description: Role name on which the service is applied
40     type: string
41   RoleParameters:
42     default: {}
43     description: Parameters specific to the role
44     type: json
45
46 resources:
47
48   ContainersCommon:
49     type: ./containers-common.yaml
50
51 outputs:
52   role_data:
53     description: Role data for the Ironic PXE role.
54     value:
55       service_name: ironic_pxe
56       config_settings: {}
57       step_config: &step_config ''
58       service_config_settings: {}
59       # BEGIN DOCKER SETTINGS
60       puppet_config:
61         config_volume: ironic
62         puppet_tags: ironic_config
63         step_config: *step_config
64         config_image:
65           list_join:
66             - '/'
67             - [ {get_param: DockerNamespace}, {get_param: DockerIronicConfigImage} ]
68       kolla_config:
69         /var/lib/kolla/config_files/ironic_pxe_http.json:
70           command: /usr/sbin/httpd -DFOREGROUND
71           config_files:
72             - source: "/var/lib/kolla/config_files/src/*"
73               dest: "/"
74               merge: true
75               preserve_properties: true
76         /var/lib/kolla/config_files/ironic_pxe_tftp.json:
77           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
78           config_files:
79             - source: "/var/lib/kolla/config_files/src/*"
80               dest: "/"
81               merge: true
82               preserve_properties: true
83           permissions:
84             - path: /var/log/ironic
85               owner: ironic:ironic
86               recurse: true
87       docker_config:
88         step_4:
89           ironic_pxe_tftp:
90             start_order: 90
91             image: &ironic_pxe_image
92               list_join:
93                 - '/'
94                 - [ {get_param: DockerNamespace}, {get_param: DockerIronicPxeImage} ]
95             net: host
96             privileged: false
97             restart: always
98             volumes:
99               list_concat:
100                 - {get_attr: [ContainersCommon, volumes]}
101                 -
102                   - /var/lib/kolla/config_files/ironic_pxe_tftp.json:/var/lib/kolla/config_files/config.json:ro
103                   - /var/lib/config-data/puppet-generated/ironic/:/var/lib/kolla/config_files/src:ro
104                   - /var/lib/ironic:/var/lib/ironic/
105                   - /dev/log:/dev/log
106                   - /var/log/containers/ironic:/var/log/ironic
107             environment:
108               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
109           ironic_pxe_http:
110             start_order: 91
111             image: *ironic_pxe_image
112             net: host
113             privileged: false
114             restart: always
115             volumes:
116               list_concat:
117                 - {get_attr: [ContainersCommon, volumes]}
118                 -
119                   - /var/lib/kolla/config_files/ironic_pxe_http.json:/var/lib/kolla/config_files/config.json:ro
120                   - /var/lib/config-data/puppet-generated/ironic/:/var/lib/kolla/config_files/src:ro
121                   - /var/lib/ironic:/var/lib/ironic/
122                   - /var/log/containers/ironic:/var/log/ironic
123             environment:
124               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
125       host_prep_tasks:
126         - name: create persistent directories
127           file:
128             path: "{{ item }}"
129             state: directory
130           with_items:
131             - /var/lib/ironic
132             - /var/log/containers/ironic