Module "os_image" doesn't have "--location" option, any ideas?

67 views
Skip to first unread message

Thiago Martins

unread,
Mar 12, 2016, 1:26:50 AM3/12/16
to Ansible Project
Guys,

 Currently, I have a task that add a bunch of images on Glance, but using shell/command module, like this:

---
- name: Adding a few Operating System images into Glance
  environment: "{{admin_openrc_env}}"
  command: "{{item}}"
  with_items:
  - glance image-create --location http://uec-images.ubuntu.com/releases/14.04/14.04.4/ubuntu-14.04-server-cloudimg-i386-disk1.img --name "Ubuntu 14.04.4 LTS - Trusty Tahr - 32-bit - Cloud Based Image" --is-public true --container-format bare --disk-format qcow2
  - glance image-create --location http://uec-images.ubuntu.com/releases/14.04/14.04.4/ubuntu-14.04-server-cloudimg-amd64-disk1.img --name "Ubuntu 14.04.4 LTS - Trusty Tahr - 64-bit - Cloud Based Image" --is-public true --container-format bare --disk-format qcow2
  when: openstack_installation == 'yes'
---

 This is so great, because I don't need to download all those images during OpenStack provisioning, and Glance downloads each of those only by demand!

 However, I'm now exploring "os_image", and other Ansible OpenStack modules... Looks promising!

 But, "os_image" does not have something similar with "--location"! Do you guys have any suggestion?

 Does "filename" "os_image" option, supports URLs? Like "file:///", or "http://?

 I would like to move to "os_image", because then, I'll be able to get rid of my ugly "when contidion", called "openstack_installation"... Otherwise, Ansible will duplicates the images entries over and over again... On the other hand, new "os_image" doesn't duplicate anything on subsequent runs, which is great! But I need the "--location" feature...

 Thoughts?


Cheers!
Thiago

David Shrewsbury

unread,
Mar 14, 2016, 9:31:09 AM3/14/16
to Ansible Project
The os_image module does not support an option similar to 'location'. Support would first
have to be added to the shade library (used by os_image) before we could add support to
the module.

If you're interested in contributing, you can find the shade source here:

   http://git.openstack.org/cgit/openstack-infra/shade/

We discuss shade on #openstack-infra on Freenode.

-Dave
Reply all
Reply to author
Forward
0 new messages