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: Mapping of service_name -> network name. Typically set
21 via parameter_defaults in the resource registry. This
22 mapping overrides those in ServiceNetMapDefaults.
29 description: Role name on which the service is applied
33 description: Parameters specific to the role
39 type: ./containers-common.yaml
42 type: ../../puppet/services/ironic-conductor.yaml
44 EndpointMap: {get_param: EndpointMap}
45 ServiceNetMap: {get_param: ServiceNetMap}
46 DefaultPasswords: {get_param: DefaultPasswords}
47 RoleName: {get_param: RoleName}
48 RoleParameters: {get_param: RoleParameters}
52 description: Role data for the Ironic Conductor role.
54 service_name: {get_attr: [IronicConductorBase, role_data, service_name]}
57 - get_attr: [IronicConductorBase, role_data, config_settings]
58 # to avoid hard linking errors we store these on the same
59 # volume/device as the ironic master_path
60 # https://github.com/docker/docker/issues/7457
61 - ironic::drivers::pxe::tftp_root: /var/lib/ironic/tftpboot
62 - ironic::drivers::pxe::tftp_master_path: /var/lib/ironic/tftpboot/master_images
63 - ironic::pxe::tftp_root: /var/lib/ironic/tftpboot
64 - ironic::pxe::http_root: /var/lib/ironic/httpboot
65 - ironic::conductor::http_root: /var/lib/ironic/httpboot
66 step_config: &step_config
67 get_attr: [IronicConductorBase, role_data, step_config]
68 service_config_settings: {get_attr: [IronicConductorBase, role_data, service_config_settings]}
69 # BEGIN DOCKER SETTINGS
72 puppet_tags: ironic_config
73 step_config: *step_config
74 config_image: {get_param: DockerIronicConfigImage}
76 /var/lib/kolla/config_files/ironic_conductor.json:
77 command: /usr/bin/ironic-conductor
79 - source: "/var/lib/kolla/config_files/src/*"
82 preserve_properties: true
84 - path: /var/lib/ironic
87 - path: /var/log/ironic
94 image: {get_param: DockerIronicConductorImage}
100 - {get_attr: [ContainersCommon, volumes]}
102 - /var/lib/kolla/config_files/ironic_conductor.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 - /lib/modules:/lib/modules:ro
108 - /var/lib/ironic:/var/lib/ironic
109 - /var/log/containers/ironic:/var/log/ironic
111 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
113 - name: create persistent directories
118 - /var/log/containers/ironic
120 - name: stat /httpboot
122 register: stat_httpboot
123 - name: stat /tftpboot
125 register: stat_tftpboot
126 - name: stat /var/lib/ironic/httpboot
127 stat: path=/var/lib/ironic/httpboot
128 register: stat_ironic_httpboot
129 - name: stat /var/lib/ironic/tftpboot
130 stat: path=/var/lib/ironic/tftpboot
131 register: stat_ironic_tftpboot
132 # cannot use 'copy' module as with 'remote_src' it doesn't support recursion
133 - name: migrate /httpboot to containerized (if applicable)
134 command: /bin/cp -R /httpboot /var/lib/ironic/httpboot
135 when: stat_httpboot.stat.exists and not stat_ironic_httpboot.stat.exists
136 - name: migrate /tftpboot to containerized (if applicable)
137 command: /bin/cp -R /tftpboot /var/lib/ironic/tftpboot
138 when: stat_tftpboot.stat.exists and not stat_ironic_tftpboot.stat.exists
139 # Even if there was nothing to copy from original locations,
140 # we need to create the dirs before starting the containers
141 - name: ensure ironic pxe directories exist
143 path: /var/lib/ironic/{{ item }}
149 - name: Stop and disable ironic_conductor service
151 service: name=openstack-ironic-conductor state=stopped enabled=no