1 heat_template_version: pike
4 OpenStack containerized Ironic Conductor service
7 DockerIronicConductorImage:
10 DockerIronicConfigImage:
11 description: The container image to use for the ironic config_volume
15 description: Mapping of service endpoint -> protocol. Typically set
16 via parameter_defaults in the resource registry.
20 description: Dictionary packing service data
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.
33 description: Role name on which the service is applied
37 description: Parameters specific to the role
43 type: ./containers-common.yaml
46 type: ../../puppet/services/database/mysql-client.yaml
49 type: ../../puppet/services/ironic-conductor.yaml
51 EndpointMap: {get_param: EndpointMap}
52 ServiceData: {get_param: ServiceData}
53 ServiceNetMap: {get_param: ServiceNetMap}
54 DefaultPasswords: {get_param: DefaultPasswords}
55 RoleName: {get_param: RoleName}
56 RoleParameters: {get_param: RoleParameters}
60 description: Role data for the Ironic Conductor role.
62 service_name: {get_attr: [IronicConductorBase, role_data, service_name]}
65 - get_attr: [IronicConductorBase, role_data, config_settings]
66 # to avoid hard linking errors we store these on the same
67 # volume/device as the ironic master_path
68 # https://github.com/docker/docker/issues/7457
69 - ironic::drivers::pxe::tftp_root: /var/lib/ironic/tftpboot
70 - ironic::drivers::pxe::tftp_master_path: /var/lib/ironic/tftpboot/master_images
71 - ironic::pxe::tftp_root: /var/lib/ironic/tftpboot
72 - ironic::pxe::http_root: /var/lib/ironic/httpboot
73 - ironic::conductor::http_root: /var/lib/ironic/httpboot
74 step_config: &step_config
77 - - {get_attr: [IronicConductorBase, role_data, step_config]}
78 - {get_attr: [MySQLClient, role_data, step_config]}
79 service_config_settings: {get_attr: [IronicConductorBase, role_data, service_config_settings]}
80 # BEGIN DOCKER SETTINGS
83 puppet_tags: ironic_config
84 step_config: *step_config
85 config_image: {get_param: DockerIronicConfigImage}
87 /var/lib/kolla/config_files/ironic_conductor.json:
88 command: /usr/bin/ironic-conductor
90 - source: "/var/lib/kolla/config_files/src/*"
93 preserve_properties: true
95 - path: /var/lib/ironic
98 - path: /var/log/ironic
105 image: {get_param: DockerIronicConductorImage}
111 - {get_attr: [ContainersCommon, volumes]}
113 - /var/lib/kolla/config_files/ironic_conductor.json:/var/lib/kolla/config_files/config.json:ro
114 - /var/lib/config-data/puppet-generated/ironic/:/var/lib/kolla/config_files/src:ro
115 - /lib/modules:/lib/modules:ro
119 - /var/lib/ironic:/var/lib/ironic
120 - /var/log/containers/ironic:/var/log/ironic
122 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
124 - name: create persistent directories
129 - /var/log/containers/ironic
131 - name: stat /httpboot
133 register: stat_httpboot
134 - name: stat /tftpboot
136 register: stat_tftpboot
137 - name: stat /var/lib/ironic/httpboot
138 stat: path=/var/lib/ironic/httpboot
139 register: stat_ironic_httpboot
140 - name: stat /var/lib/ironic/tftpboot
141 stat: path=/var/lib/ironic/tftpboot
142 register: stat_ironic_tftpboot
143 # cannot use 'copy' module as with 'remote_src' it doesn't support recursion
144 - name: migrate /httpboot to containerized (if applicable)
145 command: /bin/cp -R /httpboot /var/lib/ironic/httpboot
146 when: stat_httpboot.stat.exists and not stat_ironic_httpboot.stat.exists
147 - name: migrate /tftpboot to containerized (if applicable)
148 command: /bin/cp -R /tftpboot /var/lib/ironic/tftpboot
149 when: stat_tftpboot.stat.exists and not stat_ironic_tftpboot.stat.exists
150 # Even if there was nothing to copy from original locations,
151 # we need to create the dirs before starting the containers
152 - name: ensure ironic pxe directories exist
154 path: /var/lib/ironic/{{ item }}
160 - name: Stop and disable ironic_conductor service
162 service: name=openstack-ironic-conductor state=stopped enabled=no