redhat-openstack / ansible-role-tripleo-image-build

An ansible role used to create and publish quickstart built images
Apache License 2.0
5 stars 3 forks source link

unify how env for DIB is generated --> .j2 #11

Closed halcyondude closed 8 years ago

halcyondude commented 8 years ago

Presently, the set of env vars set for disk-image-create (part of DIB) is specified both in Ansible as well as bash format.

- name: Build the ironic-python-agent ramdisk
  shell: |
    source {{ working_dir }}/dib-optional-env-inject.sh
    disk-image-create \
*** SNIP: DIB elements and packages ***
    --min-tmpfs 5 2>&1 | tee {{ working_dir }}/dib-agent-ramdisk.log
  environment:
    DIB_LOCAL_IMAGE: "{{ working_dir }}/minimal-base.qcow2"
    DIB_DEFAULT_INSTALLTYPE: package
    ELEMENTS_PATH: "{{ dib_elements_path }}"

While the way the local image and elements path are defined is more "Ansible nice" - the common theme through quickstart / CI is to emit bash that remove ambiguity about what was executed, and allows for ssh'ing to a machine and re-running exactly what was run.

This issue is to track ensuring that the "ansible" style env variables migrate to thejinja template. This file should also be renamed to remove the "optional" part.

halcyondude commented 8 years ago

This is being resolved by a combination of refactoring the inputs to make the role completely declarative (e.g. no hard coding image names and elements), and to use support from tripleo-common to wrap DIB, vs the shell blocks shown above. At this point tripleo-common support has been merged #17. Closing this, as for DIB at least we're not going to wrap this in a jinja template, we've instead opted to align more tightly with upstream DIB wrap mechanism.