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/ironic-conductor.yaml
48 EndpointMap: {get_param: EndpointMap}
49 ServiceData: {get_param: ServiceData}
50 ServiceNetMap: {get_param: ServiceNetMap}
51 DefaultPasswords: {get_param: DefaultPasswords}
52 RoleName: {get_param: RoleName}
53 RoleParameters: {get_param: RoleParameters}
57 description: Role data for the Ironic Conductor role.
59 service_name: {get_attr: [IronicConductorBase, role_data, service_name]}
62 - get_attr: [IronicConductorBase, role_data, config_settings]
63 # to avoid hard linking errors we store these on the same
64 # volume/device as the ironic master_path
65 # https://github.com/docker/docker/issues/7457
66 - ironic::drivers::pxe::tftp_root: /var/lib/ironic/tftpboot
67 - ironic::drivers::pxe::tftp_master_path: /var/lib/ironic/tftpboot/master_images
68 - ironic::pxe::tftp_root: /var/lib/ironic/tftpboot
69 - ironic::pxe::http_root: /var/lib/ironic/httpboot
70 - ironic::conductor::http_root: /var/lib/ironic/httpboot
71 step_config: &step_config
72 get_attr: [IronicConductorBase, role_data, step_config]
73 service_config_settings: {get_attr: [IronicConductorBase, role_data, service_config_settings]}
74 # BEGIN DOCKER SETTINGS
77 puppet_tags: ironic_config
78 step_config: *step_config
79 config_image: {get_param: DockerIronicConfigImage}
81 /var/lib/kolla/config_files/ironic_conductor.json:
82 command: /usr/bin/ironic-conductor
84 - source: "/var/lib/kolla/config_files/src/*"
87 preserve_properties: true
89 - path: /var/lib/ironic
92 - path: /var/log/ironic
99 image: {get_param: DockerIronicConductorImage}
105 - {get_attr: [ContainersCommon, volumes]}
107 - /var/lib/kolla/config_files/ironic_conductor.json:/var/lib/kolla/config_files/config.json:ro
108 - /var/lib/config-data/puppet-generated/ironic/:/var/lib/kolla/config_files/src:ro
109 - /lib/modules:/lib/modules:ro
113 - /var/lib/ironic:/var/lib/ironic
114 - /var/log/containers/ironic:/var/log/ironic
116 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
118 - name: create persistent directories
123 - /var/log/containers/ironic
125 - name: stat /httpboot
127 register: stat_httpboot
128 - name: stat /tftpboot
130 register: stat_tftpboot
131 - name: stat /var/lib/ironic/httpboot
132 stat: path=/var/lib/ironic/httpboot
133 register: stat_ironic_httpboot
134 - name: stat /var/lib/ironic/tftpboot
135 stat: path=/var/lib/ironic/tftpboot
136 register: stat_ironic_tftpboot
137 # cannot use 'copy' module as with 'remote_src' it doesn't support recursion
138 - name: migrate /httpboot to containerized (if applicable)
139 command: /bin/cp -R /httpboot /var/lib/ironic/httpboot
140 when: stat_httpboot.stat.exists and not stat_ironic_httpboot.stat.exists
141 - name: migrate /tftpboot to containerized (if applicable)
142 command: /bin/cp -R /tftpboot /var/lib/ironic/tftpboot
143 when: stat_tftpboot.stat.exists and not stat_ironic_tftpboot.stat.exists
144 # Even if there was nothing to copy from original locations,
145 # we need to create the dirs before starting the containers
146 - name: ensure ironic pxe directories exist
148 path: /var/lib/ironic/{{ item }}
154 - name: Stop and disable ironic_conductor service
156 service: name=openstack-ironic-conductor state=stopped enabled=no