Add support for running crontabs in containers
[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   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     type: json
41
42 resources:
43
44   ContainersCommon:
45     type: ./containers-common.yaml
46
47 outputs:
48   role_data:
49     description: Role data for the Ironic PXE role.
50     value:
51       service_name: ironic_pxe
52       config_settings: {}
53       step_config: &step_config ''
54       service_config_settings: {}
55       # BEGIN DOCKER SETTINGS
56       puppet_config:
57         config_volume: ironic
58         puppet_tags: ironic_config
59         step_config: *step_config
60         config_image:
61           list_join:
62             - '/'
63             - [ {get_param: DockerNamespace}, {get_param: DockerIronicConfigImage} ]
64       kolla_config:
65         /var/lib/kolla/config_files/ironic_pxe_http.json:
66           command: /usr/sbin/httpd -DFOREGROUND
67           config_files:
68             - source: "/var/lib/kolla/config_files/src/*"
69               dest: "/"
70               merge: true
71               preserve_properties: true
72         /var/lib/kolla/config_files/ironic_pxe_tftp.json:
73           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
74           config_files:
75             - source: "/var/lib/kolla/config_files/src/*"
76               dest: "/"
77               merge: true
78               preserve_properties: true
79           permissions:
80             - path: /var/log/ironic
81               owner: ironic:ironic
82               recurse: true
83       docker_config:
84         step_4:
85           ironic_pxe_tftp:
86             start_order: 90
87             image: &ironic_pxe_image
88               list_join:
89                 - '/'
90                 - [ {get_param: DockerNamespace}, {get_param: DockerIronicPxeImage} ]
91             net: host
92             privileged: false
93             restart: always
94             volumes:
95               list_concat:
96                 - {get_attr: [ContainersCommon, volumes]}
97                 -
98                   - /var/lib/kolla/config_files/ironic_pxe_tftp.json:/var/lib/kolla/config_files/config.json:ro
99                   - /var/lib/config-data/puppet-generated/ironic/:/var/lib/kolla/config_files/src:ro
100                   - /var/lib/ironic:/var/lib/ironic/
101                   - /dev/log:/dev/log
102                   - /var/log/containers/ironic:/var/log/ironic
103             environment:
104               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
105           ironic_pxe_http:
106             start_order: 91
107             image: *ironic_pxe_image
108             net: host
109             privileged: false
110             restart: always
111             volumes:
112               list_concat:
113                 - {get_attr: [ContainersCommon, volumes]}
114                 -
115                   - /var/lib/kolla/config_files/ironic_pxe_http.json:/var/lib/kolla/config_files/config.json:ro
116                   - /var/lib/config-data/puppet-generated/ironic/:/var/lib/kolla/config_files/src: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