Skip to content

Commit

Permalink
Add a new extra variable for holding the update's parameters
Browse files Browse the repository at this point in the history
Make sure that, when we use downstream repo setup we don't hardcode
cifmw_repo_setup_promotion.

To that end, and to add more flexibility to the variables that need to
be overwritten during update, take the key/value of the
`cifmw_update_extras` hash. It should be defined in a job and would
look like this:

```
cifmw_update_extras:
 cifmw_repo_setup_promotion: promotion
 other_var: value
 ...
```

That enables the job definition to pass all variables needed for the
update job with having new variable name for each override.

It also solves the problem of the hardcoded
`cifmw_repo_setup_promotion` as now the job has total control over the
variables passed.
  • Loading branch information
sathlan committed Jul 1, 2024
1 parent 7713020 commit d08936e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ci/playbooks/edpm/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@
{%- endif %}
-e update_playbook_run=true
-e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml"
-e "cifmw_repo_setup_promotion={{ cifmw_repo_setup_promotion_target }}"
{%- if cifmw_update_extras is defined %}
{%- for key, value in cifmw_update_extras.items() %}
-e "{{key}}={{value}}"
{%- endfor %}
{%- endif %}
2 changes: 1 addition & 1 deletion roles/update/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Role to run update

## Parameters
* `param_1`: this is an example
* ``cifmw_update_extras`: (hash) Hold job variable that get set when running the update playbook.

## Examples

0 comments on commit d08936e

Please sign in to comment.