Skip to content

Commit

Permalink
Fixed an issue when ee_pull_collections_from_hub was set to true, and…
Browse files Browse the repository at this point in the history
… build_steps were not defined, an error was raised. (#138)

* add getting help

* fix build step bug
  • Loading branch information
sean-m-sullivan authored Nov 28, 2023
1 parent b8d20fb commit 3288417
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use_default_rules: true
# verbosity: 1
skip_list:
- meta-runtime
- var-naming[no-role-prefix]
kinds:
- playbooks: "**/examples/*.{yml,yaml}"
- tasks: "**/examples/tasks/*.yml"
Expand Down
4 changes: 4 additions & 0 deletions changelogs/fragments/build_fixes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- Fixed an issue when ee_pull_collections_from_hub was set to true, and build_steps were not defined, an error was raised.
...
4 changes: 3 additions & 1 deletion roles/ee_builder/templates/execution_environment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ additional_build_files:
{% if (__execution_environment_definition.build_steps is defined and __execution_environment_definition.build_steps|length ) or
(ee_pull_collections_from_hub) %}
additional_build_steps:
{% if ee_pull_collections_from_hub and 'prepend_galaxy' not in __execution_environment_definition.build_steps %}
{% if ee_pull_collections_from_hub and (__execution_environment_definition.build_steps is not defined or (__execution_environment_definition.build_steps is defined and 'prepend_galaxy' not in __execution_environment_definition.build_steps)) %}
prepend_galaxy:
- ADD _build/configs/ansible.cfg /etc/ansible/ansible.cfg
{% endif %}
{% if __execution_environment_definition.build_steps is defined %}
{% for key,value in __execution_environment_definition.build_steps.items() %}
{{ key | indent(2, true) }}:
{{ value | to_nice_yaml | indent(4, true) }}
{%- if key == "prepend_galaxy" and ee_pull_collections_from_hub and 'prepend_galaxy' in __execution_environment_definition.build_steps %}
- ADD _build/configs/ansible.cfg /etc/ansible/ansible.cfg
{% endif %}
{% endfor %}
{% endif %}
{% endif -%}

{% if (__execution_environment_definition.images is defined and __execution_environment_definition.images|length ) or
Expand Down

0 comments on commit 3288417

Please sign in to comment.