tripleo-quickstart-extras/roles/tht-prep-config
Bogdan Dobrelya 36569be28d Unify custom t-h-t install steps for UC/OC/upgrade
Allow undercloud installations/upgrades from custom t-h-t, similarly to
overcloud_templates_* et al.

Unify and share custom t-h-t install script for OC and UC and mixed
update/upgrade cases via new shared role tht-prep-config.

To diverge undercloud from overcloud install/update/upgrade cases, use
the following shared mappings (vars on the right correspond to UC
cases):

  * tht_templates_path: undercloud_templates_path (defaults to RPM dir)
  * tht_templates_repo: undercloud_templates_repo
  * tht_templates_branch: undercloud_templates_branch
  * tht_templates_refspec: undercloud_templates_refspec

and a 2nd group (defaults set to do nothing, but only disable the
t-h-t prepare script's code blocks under control of those):

  * composable_scenario:  undercloud_composable_scenario
  * upgrade_composable_scenario: undercloud_upgrade_composable_scenario
  * prep_post_hook_script: undercloud_prep_post_hook_script
  * download_templates_rpm: download_undercloud_templates_rpm
  * tht_rpm_url: undercloud_tht_rpm_url

Those in group 2 may be customized to mimic the overcloud mixed
upgrades logic for underclouds/all-in-one for future use.

And for overclouds respectively, use mappings:

  * composable_scenario: remains unchanged
  * upgrade_composable_scenario: remains unchanged
  * prep_post_hook_script: overcloud_prep_post_hook_script
  * download_templates_rpm: download_overcloud_templates_rpm
  * tht_rpm_url: remains unchanged
  * tht_templates_path: overcloud_templates_path
  ...

Related-bug: #1691467
Closes-bug: #1781227
Change-Id: I4e0dcf24b93b8e4afb8359cb5108c4b7b5ba3d55
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
2018-08-06 08:03:37 +00:00
..
defaults Unify custom t-h-t install steps for UC/OC/upgrade 2018-08-06 08:03:37 +00:00
meta Unify custom t-h-t install steps for UC/OC/upgrade 2018-08-06 08:03:37 +00:00
tasks Unify custom t-h-t install steps for UC/OC/upgrade 2018-08-06 08:03:37 +00:00
templates Unify custom t-h-t install steps for UC/OC/upgrade 2018-08-06 08:03:37 +00:00
README.md Unify custom t-h-t install steps for UC/OC/upgrade 2018-08-06 08:03:37 +00:00

README.md

ansible-role-tripleo-tht-prep-config

An Ansible "meta" role (do not use it on its own, its for imports only) to prepare TripleO Heat Templates for TripleO deployments with Heat and Ansible.

Requirements

No requirements. The role should only be used via include/import_roles with tasks_from.

Role Variables

  • working_dir: -- the working dir to contain the cloned and checked-out t-h-t. Defined in roles/extras-common
  • download_templates_rpm: if set to true, allow the user to download a tripleo-heat-templates rpm package from a url defined by the variable tht_rpm_url
  • tht_templates_path: -- the destination path inside of the working dir to clone and checkout t-h-t from the given tht_templates_repo/_branch/_refspec.
  • prep_post_hook_script: if set to a non-empty string, it should be the content of a bash script that will be run at the end of the t-h-t preparation configuration step. This should only be use in rare case.
  • composable_scenario: -- controls specific steps for the composable deployments.
  • upgrade_composable_scenario: -- controls specific steps for the composable updates/upgrades.

Dependencies

None

Example Playbook

Here is an example tasks snippet for a playbook (omitted the remaining parts):

  vars:
    my_custom_tht_script: clone_tht_script.j2.sh
    my_custom_tht_log: clone_tht_script.log
  tasks:
    - name: Prepare custom t-h-t for my super deployment
      include_role:
        name: tht-prep-config
      vars:
        custom_tht_log: "{{ my_custom_tht_log }}"
        custom_tht_script: "{{ my_custom_tht_script }}"
        tht_templates_repo: "{{ my_templates_repo|default('') }}"
        tht_templates_refspec: "{{ my_templates_refspec|default('') }}"
        tht_templates_branch: "{{ my_templates_branch|default('') }}"
        tht_templates_path: "{{ my_templates_path }}"
        download_templates_rpm: "{{ download_my_templates_rpm|default('') }}"
        prep_post_hook_script: "{{ my_prep_post_hook_script|default('') }}"

This puts into the current directory clone-tht-script.sh j2 rendered from clone_tht_script.j2.sh (it should be placed under tht-prep-config/templates), then executes the script and logs results into clone_tht_script.log.

License

Apache 2.0

Author Information

RDO-CI and Tripleo Deployment Framework teams