Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for offline mode for RedHat after testing #579

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
- name: Install Rabitmq packages
- name: Install Rabbitmq packages
yum:
name:
- socat
- logrotate
- erlang
- rabbitmq-server
update_cache: yes
- erlang-21.3.* # order matters, check RabbitMQ/Erlang version compatibility matrix before modification
- rabbitmq-server-3.7.10
state: present
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
ENABLED_REPOS_FILE=/var/tmp/enabled-system-repos.txt

if [ ! -f "$ENABLED_REPOS_FILE" ]; then
yum repolist enabled | awk '/^$/ {next}; /repo id/ {f=1; next}; /^repolist/ {f=0}; f {sub(/\/.*/,""); print $1}' > $ENABLED_REPOS_FILE
# 'yum repoinfo' or 'yum repolist -v' not used since they may require Internet access, even with --cacheonly
yum --cacheonly repolist enabled | awk '/^$/ {next}; /repo id/ {f=1; next}; /^repolist/ {f=0}; f {sub(/\/.*/,""); print $1}' > $ENABLED_REPOS_FILE
fi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# VERSION 1.2.3
# VERSION 1.0.0

set -euo pipefail

Expand Down Expand Up @@ -138,7 +138,7 @@ get_package_dependencies_with_arch() {
# $1 reserved for result
local package="$2"

local query_output=$(repoquery --requires --resolve --queryformat '%{name}.%{arch}' --archlist=x86_64,noarch "$package" 2>&1) ||
local query_output=$(repoquery --requires --resolve --queryformat '%{name}.%{arch}' --archlist=x86_64,noarch "$package") ||
exit_with_error "repoquery failed for dependencies of package: $package with exit code: $?, output was: $query_output"

if [[ -z $query_output ]]; then
Expand All @@ -156,7 +156,7 @@ get_package_with_version_arch() {
# $1 reserved for result
local package="$2"

local query_output=$(repoquery --queryformat '%{ui_nevra}' --archlist=x86_64,noarch "$package" 2>&1) ||
local query_output=$(repoquery --queryformat '%{ui_nevra}' --archlist=x86_64,noarch "$package") ||
exit_with_error "repoquery failed for package: $package with exit code: $?, output was: $query_output"

# yumdownloader doesn't set error code if repoquery returns empty output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ systemd-sysv

[packages]
audit # for docker-ce
audit-libs # for docker-ce
bash-completion
ca-certificates
cifs-utils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# VERSION 1.2.3
# VERSION 1.0.0

set -euo pipefail

Expand Down Expand Up @@ -155,7 +155,7 @@ get_package_dependencies_with_arch() {
# $1 reserved for result
local package="$2"

local query_output=$(repoquery --requires --resolve --queryformat '%{name}.%{arch}' --archlist=x86_64,noarch "$package" 2>&1) ||
local query_output=$(repoquery --requires --resolve --queryformat '%{name}.%{arch}' --archlist=x86_64,noarch "$package") ||
exit_with_error "repoquery failed for dependencies of package: $package with exit code: $?, output was: $query_output"

if [[ -z $query_output ]]; then
Expand All @@ -173,7 +173,7 @@ get_package_with_version_arch() {
# $1 reserved for result
local package="$2"

local query_output=$(repoquery --queryformat '%{ui_nevra}' --archlist=x86_64,noarch "$package" 2>&1) ||
local query_output=$(repoquery --queryformat '%{ui_nevra}' --archlist=x86_64,noarch "$package") ||
exit_with_error "repoquery failed for package: $package with exit code: $?, output was: $query_output"

# yumdownloader doesn't set error code if repoquery returns empty output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ yum-utils

[packages]
audit # for docker-ce
audit-libs # for docker-ce
bash-completion
ca-certificates
cifs-utils
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ EPI_REPO_SERVER_PATH=$1 # /var/www/html/epirepo is the default
IS_OFFLINE_MODE=$2

if $IS_OFFLINE_MODE = true; then
# deprecated 'yum localinstall' is used since 'yum install' returns error code when 'nothing to do'
yum localinstall -y $(ls $EPI_REPO_SERVER_PATH/packages/repo-prereqs/*.rpm)
else
yum install -y httpd createrepo yum-utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

- name: Copy requirements for offline installation to repository host
copy:
src: "{{ offline_requirements }}/" #TODO: handle case with double slash
src: "{{ offline_requirements }}/"
dest: /var/www/html/epirepo
force: no # if target exists it will skip, default is 'yes'
when:
Expand Down