Changing name of rhel resource directory in "resources/pkg" from rhel to rpm due to platfrom independent repository for all distributions supporting RPM packages.
Issue-ID: OOM-2150
Change-Id: Ie5425df8b8550c618440586b495907f86c4cc509
Signed-off-by: Jan Benedikt <j.benedikt@partner.samsung.com>
- "{{ app_data_path }}/certs:/etc/nginx/certs:ro"
- "{{ app_data_path }}/git-repo:/srv/git:rw"
- "{{ app_data_path }}/http:/srv/http:rw"
- - "{{ app_data_path }}/pkg/rhel:/srv/http/repo.infra-server/rhel:rw"
+ - "{{ app_data_path }}/pkg/rpm:/srv/http/repo.infra-server/rpm:rw"
- "{{ app_data_path }}/pkg/ubuntu/xenial:/srv/http/repo.infra-server/ubuntu/xenial:rw"
- /var/log/nginx:/var/log/nginx:rw
# Default rule for tarball naming translation
- name: "{{ app_name }}"
file: "{{ app_name | lower }}"
description: "{{ app_name | upper }} offline repository"
- baseurl: "{{ 'http://repo.infra-server/rhel' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}"
+ baseurl: "{{ 'http://repo.infra-server/rpm' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rpm' }}"
gpgcheck: false
enabled: true
def test_onap_repo(host):
fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string
expected_content = """[moleculetestapp]
-baseurl = file:///opt/moleculetestapp/pkg/rhel
+baseurl = file:///opt/moleculetestapp/pkg/rpm
enabled = 1
gpgcheck = 0
name = MOLECULETESTAPP offline repository"""
def test_onap_repo(host):
fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string
expected_content = """[moleculetestapp]
-baseurl = http://repo.infra-server/rhel
+baseurl = http://repo.infra-server/rpm
enabled = 1
gpgcheck = 0
name = MOLECULETESTAPP offline repository"""
name: createrepo
state: present
-- name: "Ensure {{ rhel_pkg_dir }} exists"
+- name: "Ensure {{ pkg_dir }} exists"
file:
- path: "{{ rhel_pkg_dir }}"
+ path: "{{ pkg_dir }}"
state: directory
- name: Download rpm packages
- command: "yumdownloader --destdir={{ rhel_pkg_dir }} --resolve {{ packages | join(' ') }}"
+ command: "yumdownloader --destdir={{ pkg_dir }} --resolve {{ packages | join(' ') }}"
- name: Index repository
- command: "createrepo {{ rhel_pkg_dir }}"
+ command: "createrepo {{ pkg_dir }}"
args:
- creates: "{{ rhel_pkg_dir }}/repodata"
+ creates: "{{ pkg_dir }}/repodata"
---
-rhel_pkg_dir: "{{ app_data_path }}/pkg/rhel"
+pkg_dir: "{{ app_data_path }}/pkg/rpm"
packages:
- "docker-ce-18.09.5"
- container-selinux
# Docker image name and version
docker_image="centos:centos7.6.1810"
# Expected directory for RPM packages
-expected_dir="resources/pkg/rhel"
+expected_dir="resources/pkg/rpm"
help () {
echo "Script for run docker container with RPM repository"
shift;shift
done
-# Check if path contains expected path "resources/pkg/rhel"
+# Check if path contains expected path "resources/pkg/rpm"
if ! [[ "/$volume_repo_directory/" = *"/$expected_dir/"* ]]; then
# Create repo folder if it not exists
- volume_repo_directory="$volume_repo_directory"/resources/pkg/rhel
+ volume_repo_directory="$volume_repo_directory"/resources/pkg/rpm
[ ! -d "$volume_repo_directory" ] && mkdir -p $volume_repo_directory
fi
echo -e "-l --list: set path where rpm list is stored in container\n"
echo "Both paths have to be set with shared volume between"
echo "container and host computer. Default path in container is: /tmp/"
- echo "Repository will be created at: /<path>/resources/pkg/rhel/"
+ echo "Repository will be created at: /<path>/resources/pkg/rpm/"
echo "RMP list is stored at: ./data_list/"
}
done
# Testing if directory parametter was used
-# If not variable is sets to default value /tmp/repo/resources/pkg/rhel
+# If not variable is sets to default value /tmp/repo/resources/pkg/rpm
if test -z "$OFFLINE_REPO_DIR"
then
OFFLINE_REPO_DIR="/tmp/repo/"