Skip to content

Commit

Permalink
Use glance action where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
bigjools committed Jan 31, 2017
1 parent 32cd1e8 commit d957827
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions tasks/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,29 @@
register: ironic_ipa_pxe_image_downloaded

- name: Upload IPA kernel image to Glance
shell: "glance image-create --name deploy-vmlinuz --visibility public --disk-format aki --container-format aki < {{ ironic_bin|dirname }}/coreos_production_pxe.vmlinuz"
glance:
command: image-create
credentials_path: "{{ metapod_credentials_path }}"
user_type: admin
image_name: deploy-vmlinuz
image_path: "{{ironic_bin | dirname }}/coreos_production_pxe.vmlinuz"
image_container_format: aki
image_disk_format: aki
image_is_public: True
# shell: "glance image-create --name deploy-vmlinuz --visibility public --disk-format aki --container-format aki < {{ ironic_bin|dirname }}/coreos_production_pxe.vmlinuz"
when: ironic_ipa_vmlinux_downloaded|changed

- name: Upload IPA disk image to Glance
shell: "glance image-create --name deploy-initrd --visibility public --disk-format ari --container-format ari < {{ ironic_bin|dirname }}/coreos_production_pxe_image-oem.cpio.gz"
glance:
command: image-create
credentials_path: "{{ metapod_credentials_path }}"
user_type: admin
image_name: deploy-initrd
image_path: "{{ironic_bin | dirname }}/coreos_production_pxe_image-oem.cpio.gz"
image_container_format: ari
image_disk_format: ari
image_is_public: True
# shell: "glance image-create --name deploy-initrd --visibility public --disk-format ari --container-format ari < {{ ironic_bin|dirname }}/coreos_production_pxe_image-oem.cpio.gz"
when: ironic_ipa_pxe_image_downloaded|changed

- stat:
Expand Down Expand Up @@ -79,4 +97,4 @@
- name: Upload DIB instance image to Glance
# NOTE: Can't use the glance action as it doesn't support properties.
shell: "glance image-create --name ubuntu-image --visibility public --disk-format qcow2 --container-format bare --property kernel_id={{ glance_images['ubuntu-kernel']['id'] }} --property ramdisk_id={{ glance_images['ubuntu-image.initrd']['id'] }} < {{ ironic_bin | dirname }}/ubuntu-image.qcow2"

when: ironic_dib_image_built | changed

0 comments on commit d957827

Please sign in to comment.