Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Commit

Permalink
Fail with a better message if we cannot modify prereq_pip_packages
Browse files Browse the repository at this point in the history
So that if users do put the pulp-rpm-prerequisites role in a role list
in a sequential include_roles task instead, they'll get a clearer error.

re: #5518
Problem: Running include_roles with pulp_rpm_prerequisites causes it to fail
https://pulp.plan.io/issues/5518
  • Loading branch information
mikedep333 committed Oct 1, 2019
1 parent 81cf67e commit 3a715fb
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tasks/main.yml
Expand Up @@ -13,7 +13,22 @@
with_items: '{{ packages }}'
become: true

- name: Fail if we do not have prereq_pip_packages
fail:
msg:
- 'Error: The variable prereq_pip_packages is not defined from the pulp role.'
- 'You are probably running this role individually, or dynamically w/ include_role.'
- 'See README.md on how to set pulp_install_plugins to run it within the "pulp" role.'
- 'This role has completed everything else successfully. If you wish to continue,'
- 'you will need to pip install these packages manually:'
- '{{ rpm_prereq_pip_packages }}'
when:
- rpm_prereq_pip_packages is defined
- prereq_pip_packages is not defined

- name: Merge rpm_prereq_pip_packages into prereq_pip_packages
set_fact:
prereq_pip_packages: "{{ prereq_pip_packages + rpm_prereq_pip_packages }}"
when: rpm_prereq_pip_packages is defined
when:
- rpm_prereq_pip_packages is defined
- prereq_pip_packages is defined

0 comments on commit 3a715fb

Please sign in to comment.