Add root password option to modify-image role

It can be useful (i.e. in baremetal deployments) to set the root
password on the overcloud image, this commit adds this ability to the
modify-image role.

Change-Id: Idf3ee95745c00fbbdbc3a9df4cc8d3e8ea71b46f
This commit is contained in:
Raoul Scarazzini 2017-02-23 10:35:51 +01:00
parent 0fe0892080
commit b9648724d8
3 changed files with 8 additions and 1 deletions

View File

@ -31,6 +31,8 @@ Role Variables
* `modify_image_vc_cpu` -- number of CPUs to give the virt-customize VM
* `modify_image_vc_verbose` -- whether to run virt-customize with verbose flag
* `modify_image_vc_trace` -- whether to run virt-customize with trace flag
* `modify_image_vc_root_password` -- password for the root account of the image
(useful for baremetal envs)
Example Usage
-------------

View File

@ -18,8 +18,9 @@ modify_image_install_packages: []
# By default we use the global working directory for modifying images
modify_image_working_dir: "{{ working_dir }}"
# ram and cpu are not set by default to take libguestfs defaults by default
# ram, cpu and root password are not set by default to take libguestfs defaults by default
# modify_image_vc_ram:
# modify_image_vc_cpu:
# modify_image_vc_root_password:
modify_image_vc_verbose: false
modify_image_vc_trace: false

View File

@ -42,6 +42,10 @@
set_fact: _vc_args="{{ _vc_args }} --run {{ modify_script }}"
when: modify_script is defined
- name: virt-customize args --> root password
set_fact: _vc_args="{{ _vc_args }} --root-password password:{{ modify_image_vc_root_password }}"
when: modify_image_vc_root_password is defined
- name: Run virt-customize on the provided image
shell: >
virt-customize {{ _vc_args }}