Skip to content

Commit

Permalink
Update pulp role to define defaults for repo_priorty and evalute run-…
Browse files Browse the repository at this point in the history
…time

As an addendum to PR #644 , the repo_priorty variable in the pulp role
must be defined within the scope of the role (not the pulp_server
playbook) as other playbooks use that role.

Making changes to:
- Declare a default of '99', which is the same as no priority
- Declare a fips priority of '55' for fips pulp installs
- Evaluate the proper priority within the pulp role for the pulp.repos from fips
- Remove the pre_task declaration from the pulp_server playbook

Retested on fips and non-fips with the pulp_server playbook as well
as other playbooks dependent on the pulp role.

refs #4359
  • Loading branch information
bherrin3 authored and Kersom committed Mar 1, 2019
1 parent 9be07f4 commit ff598dd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ci/ansible/pulp_server.yaml
@@ -1,13 +1,6 @@
---

- hosts: all
pre_tasks:
- name: Check fips state
shell: cat /proc/sys/crypto/fips_enabled
register: fips_state
vars:
repo_priority: "{{ '50' if fips_state.stdout == '1' else '99' }}"

roles:
- role: subscription-manager
when: ansible_distribution == 'RedHat'
Expand Down
4 changes: 4 additions & 0 deletions ci/ansible/roles/pulp/defaults/main.yaml
Expand Up @@ -5,3 +5,7 @@ pulp_version: 2.17

# Pulp build to install, the choices are: beta, nightly and stable
pulp_build: nightly

# Default highest repo priority.
default_priority: 99
fips_priority: 55
9 changes: 9 additions & 0 deletions ci/ansible/roles/pulp/tasks/main.yaml
@@ -1,4 +1,13 @@
---
# Must check fips state here as pulp-fips could have
- name: Check fips state
shell: cat /proc/sys/crypto/fips_enabled
register: fips_state

- name: Set the repo_priority based on fips_state
set_fact:
repo_priority: "{{ fips_priority if fips_state.stdout == '1' else default_priority }}"

# Pulp 2 requires Python 2.
- name: Install Python 2 (Fedora)
package:
Expand Down

0 comments on commit ff598dd

Please sign in to comment.