Skip to content

Commit

Permalink
Properly namespace vars
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell G <gotmax@e.email>
  • Loading branch information
gotmax23 committed Jun 27, 2022
1 parent b521ce3 commit 70cfc21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions roles/build-release/tasks/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@

- name: Query installed pip packages
community.general.pip_package_info:
clients: "{{ antsibull_pip_bin }}"
clients: "{{ antsibull_venv_pip_bin }}"
register: _pip_pkgs

- name: Validate the version of ansible-core
ansible.builtin.assert:
that:
- _installed_ansible_core is _antsibull_packaging_version(antsibull_expected_ansible_core, '>=')
success_msg: "ansible-core {{ _installed_ansible_core }} matches (or exceeds) {{ _deps_file }}"
fail_msg: "ansible-core {{ _installed_ansible_core }} does not match {{ _deps_file }}"
- antsibull_venv_pip_ansible_core_version is _antsibull_packaging_version(antsibull_expected_ansible_core, '>=')
success_msg: "ansible-core {{ antsibull_venv_pip_ansible_core_version }} matches (or exceeds) {{ _deps_file }}"
fail_msg: "ansible-core {{ antsibull_venv_pip_ansible_core_version }} does not match {{ _deps_file }}"

- block:
- name: Retrieve collections that should be included in the package
Expand All @@ -54,10 +54,10 @@
- name: Validate the version of ansible
ansible.builtin.assert:
that:
- ansible_version_pypi == _deps['_ansible_version']
- ansible_version_pypi == _ansible_version_builtin.stdout
success_msg: "ansible {{ ansible_version_pypi }} matches {{ _deps_file }} as well as 'ansible_collections.ansible_release'"
fail_msg: "ansible {{ ansible_version_pypi }} does not match {{ _deps_file }} or 'ansible_collections.ansible_release'"
- antsibull_venv_pip_ansible_version == _deps['_ansible_version']
- antsibull_venv_pip_ansible_version == _ansible_version_builtin.stdout
success_msg: "ansible {{ antsibull_venv_pip_ansible_version }} matches {{ _deps_file }} as well as 'ansible_collections.ansible_release'"
fail_msg: "ansible {{ antsibull_venv_pip_ansible_version }} does not match {{ _deps_file }} or 'ansible_collections.ansible_release'"

- when: antsibull_ansible_version is _antsibull_packaging_version('6.0.0rc1', '>=')
block:
Expand Down
8 changes: 4 additions & 4 deletions roles/build-release/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# ex: https://github.com/ansible-community/ansible-build-data/blob/main/4/ansible-4.4.0.deps
# Variables that start with `_` are intermediate variables that are `register`ed in the playbook.
antsibull_expected_ansible_core: "{{ _deps['_ansible_core_version'] | default(_deps['_ansible_base_version']) }}"
antsibull_pip_bin: "{{ antsibull_ansible_venv }}/bin/pip"
antsibull_pip_pkgs: "{{ _pip_pkgs['packages'][antsibull_pip_bin] }}"
ansible_version_pypi: "{{ antsibull_pip_pkgs['ansible'][0]['version'] }}"
_installed_ansible_core: "{{ antsibull_pip_pkgs['ansible-core'][0]['version'] }}"
antsibull_venv_pip_bin: "{{ antsibull_ansible_venv }}/bin/pip"
antsibull_venv_pip_pkgs: "{{ _pip_pkgs['packages'][antsibull_venv_pip_bin] }}"
antsibull_venv_pip_ansible_version: "{{ antsibull_venv_pip_pkgs['ansible'][0]['version'] }}"
antsibull_venv_pip_ansible_core_version: "{{ antsibull_venv_pip_pkgs['ansible-core'][0]['version'] }}"

antsibull_collections_path: "{{ antsibull_ansible_venv }}/lib/{{ _python_version }}/site-packages/ansible_collections"
_antsibull_installed_collections: "{{ _installed_collections_json['stdout'] | from_json }}"
Expand Down

0 comments on commit 70cfc21

Please sign in to comment.