From d17dcea645a3a83d07a9517c2c63c4181ec1c971 Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Tue, 11 Jul 2017 16:40:40 +0200 Subject: [PATCH] DIB: drop custom mirror elements diskimage-builder supports a generic DIB_DISTRIBUTION_MIRROR that can replace all existing mirror elements Change-Id: Ia91dabf10e591f953440459edad35ebfc20c5890 Closes-Bug: #1703624 --- diskimage-create/README.rst | 2 +- diskimage-create/diskimage-create.sh | 12 ------------ diskimage-create/tox.ini | 2 +- elements/apt-mirror/10-deprecate-apt-mirror | 3 --- elements/apt-mirror/README.rst | 16 ---------------- elements/apt-mirror/finalise.d/99-setup | 3 --- elements/apt-mirror/pre-install.d/00-apt | 5 ----- elements/apt-mirror/root.d/0-check | 5 ----- elements/centos-mirror/README.rst | 9 --------- elements/centos-mirror/finalise.d/99-setup | 3 --- elements/centos-mirror/pre-install.d/00-yum | 13 ------------- elements/centos-mirror/root.d/0-check | 5 ----- elements/fedora-mirror/README.rst | 9 --------- elements/fedora-mirror/finalise.d/99-setup | 3 --- elements/fedora-mirror/pre-install.d/00-yum | 13 ------------- elements/fedora-mirror/root.d/0-check | 5 ----- ...dib-distribution-mirror-400d96c1a7df9862.yaml | 14 ++++++++++++++ specs/version0.5/base-image.rst | 2 +- 18 files changed, 17 insertions(+), 107 deletions(-) delete mode 100644 elements/apt-mirror/10-deprecate-apt-mirror delete mode 100644 elements/apt-mirror/README.rst delete mode 100755 elements/apt-mirror/finalise.d/99-setup delete mode 100755 elements/apt-mirror/pre-install.d/00-apt delete mode 100755 elements/apt-mirror/root.d/0-check delete mode 100644 elements/centos-mirror/README.rst delete mode 100755 elements/centos-mirror/finalise.d/99-setup delete mode 100755 elements/centos-mirror/pre-install.d/00-yum delete mode 100755 elements/centos-mirror/root.d/0-check delete mode 100644 elements/fedora-mirror/README.rst delete mode 100755 elements/fedora-mirror/finalise.d/99-setup delete mode 100755 elements/fedora-mirror/pre-install.d/00-yum delete mode 100755 elements/fedora-mirror/root.d/0-check create mode 100644 releasenotes/notes/use-dib-distribution-mirror-400d96c1a7df9862.yaml diff --git a/diskimage-create/README.rst b/diskimage-create/README.rst index 9afa5badf9..2e830447a7 100644 --- a/diskimage-create/README.rst +++ b/diskimage-create/README.rst @@ -101,7 +101,7 @@ CLOUD_INIT_DATASOURCES - Options: NoCloud, ConfigDrive, OVF, MAAS, Ec2, - Reference: https://launchpad.net/cloud-init -BASE_OS_MIRROR +DIB_DISTRIBUTION_MIRROR - URL to a mirror for the base OS selected - Default: None diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 156d807f85..3d7344cd4e 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -281,24 +281,12 @@ pushd $TEMP > /dev/null if [ "$AMP_BASEOS" = "ubuntu" ]; then AMP_element_sequence=${AMP_element_sequence:-"base vm ubuntu"} AMP_element_sequence="$AMP_element_sequence $AMP_BACKEND-ubuntu" - if [ "$BASE_OS_MIRROR" ]; then - AMP_element_sequence="$AMP_element_sequence apt-mirror" - export UBUNTU_MIRROR="$BASE_OS_MIRROR" - fi elif [ "$AMP_BASEOS" = "fedora" ]; then AMP_element_sequence=${AMP_element_sequence:-"base vm fedora selinux-permissive"} AMP_element_sequence="$AMP_element_sequence $AMP_BACKEND" - if [ "$BASE_OS_MIRROR" ]; then - AMP_element_sequence="$AMP_element_sequence fedora-mirror" - export FEDORA_MIRROR="$BASE_OS_MIRROR" - fi elif [ "$AMP_BASEOS" = "centos" ]; then AMP_element_sequence=${AMP_element_sequence:-"base vm centos7 selinux-permissive"} AMP_element_sequence="$AMP_element_sequence $AMP_BACKEND" - if [ "$BASE_OS_MIRROR" ]; then - AMP_element_sequence="$AMP_element_sequence centos-mirror" - export CENTOS_MIRROR="$BASE_OS_MIRROR" - fi elif [ "$AMP_BASEOS" = "rhel" ]; then AMP_element_sequence=${AMP_element_sequence:-"base vm rhel7 selinux-permissive"} AMP_element_sequence="$AMP_element_sequence $AMP_BACKEND" diff --git a/diskimage-create/tox.ini b/diskimage-create/tox.ini index 7dadad713d..ce23c1dcb5 100644 --- a/diskimage-create/tox.ini +++ b/diskimage-create/tox.ini @@ -21,7 +21,7 @@ commands = mkdir -p {toxinidir}/.amp_tox_test rm -rf {toxinidir}/.amp_tox_test [testenv:docs] -commands = doc8 README.rst ../elements/centos-mirror/README.rst ../elements/apt-mirror/README.rst ../elements/fedora-mirror/README.rst ../elements/haproxy-octavia/README.rst ../elements/root-passwd/README.rst +commands = doc8 README.rst ../elements/haproxy-octavia/README.rst ../elements/root-passwd/README.rst [testenv:bashate] commands = bashate diskimage-create.sh diff --git a/elements/apt-mirror/10-deprecate-apt-mirror b/elements/apt-mirror/10-deprecate-apt-mirror deleted file mode 100644 index ce4cc41956..0000000000 --- a/elements/apt-mirror/10-deprecate-apt-mirror +++ /dev/null @@ -1,3 +0,0 @@ -if [ -n "${UBUNTU_MIRROR:-}" ]; then - echo "DEPRECATED WARNING: Use of apt-mirror element is deprecated. See http://docs.openstack.org/developer/diskimage-builder/elements/ubuntu/README.html and http://docs.openstack.org/developer/diskimage-builder/elements/apt-sources/README.html for alternate methods of setting an ubuntu mirror." -fi diff --git a/elements/apt-mirror/README.rst b/elements/apt-mirror/README.rst deleted file mode 100644 index dd2ca99de8..0000000000 --- a/elements/apt-mirror/README.rst +++ /dev/null @@ -1,16 +0,0 @@ -This element enables the use of a mirror for updating Ubuntu cloud images. -Using a local mirror increases the speed of building the image. - -Note: This element is deprectated in favor of the diskimage-builder methods -for setting a mirror. See -http://docs.openstack.org/developer/diskimage-builder/elements/ubuntu/README.html -and -http://docs.openstack.org/developer/diskimage-builder/elements/apt-sources/README.html -for more information. - -The Ubuntu mirror URL is specified by setting the 'UBUNTU_MIRROR' environment -variable. - -.. code:: bash - - $ export UBUNTU_MIRROR=http:/// diff --git a/elements/apt-mirror/finalise.d/99-setup b/elements/apt-mirror/finalise.d/99-setup deleted file mode 100755 index 9e47021eef..0000000000 --- a/elements/apt-mirror/finalise.d/99-setup +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -rm /etc/apt/apt.conf.d/01proxy diff --git a/elements/apt-mirror/pre-install.d/00-apt b/elements/apt-mirror/pre-install.d/00-apt deleted file mode 100755 index 492b59a5c6..0000000000 --- a/elements/apt-mirror/pre-install.d/00-apt +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -mkdir -p /etc/apt/apt.conf.d/ -touch /etc/apt/apt.conf.d/01proxy -echo -e "Acquire::http { Proxy \"$UBUNTU_MIRROR\"; };" > /etc/apt/apt.conf.d/01proxy diff --git a/elements/apt-mirror/root.d/0-check b/elements/apt-mirror/root.d/0-check deleted file mode 100755 index d67fae29e5..0000000000 --- a/elements/apt-mirror/root.d/0-check +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [ -z "$UBUNTU_MIRROR" ]; then - echo "You should specify parameter 'UBUNTU_MIRROR'" - exit 2 -fi diff --git a/elements/centos-mirror/README.rst b/elements/centos-mirror/README.rst deleted file mode 100644 index 3f67789e73..0000000000 --- a/elements/centos-mirror/README.rst +++ /dev/null @@ -1,9 +0,0 @@ -This element enables the use of a mirror for updating CentOS cloud images. -Using a local mirror increases the speed of building the image. - -The CentOS mirror URL is specified by setting the 'CENTOS_MIRROR' environment -variable. - -.. code:: bash - - $ export CENTOS_MIRROR=http:/// diff --git a/elements/centos-mirror/finalise.d/99-setup b/elements/centos-mirror/finalise.d/99-setup deleted file mode 100755 index 331abbf906..0000000000 --- a/elements/centos-mirror/finalise.d/99-setup +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -mv /opt/repos/* /etc/yum.repos.d/ diff --git a/elements/centos-mirror/pre-install.d/00-yum b/elements/centos-mirror/pre-install.d/00-yum deleted file mode 100755 index 7ed033cfab..0000000000 --- a/elements/centos-mirror/pre-install.d/00-yum +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -mkdir -p /opt/repos -mv /etc/yum.repos.d/* /opt/repos/ -cat >> /etc/yum.repos.d/centos.repo </ diff --git a/elements/fedora-mirror/finalise.d/99-setup b/elements/fedora-mirror/finalise.d/99-setup deleted file mode 100755 index 331abbf906..0000000000 --- a/elements/fedora-mirror/finalise.d/99-setup +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -mv /opt/repos/* /etc/yum.repos.d/ diff --git a/elements/fedora-mirror/pre-install.d/00-yum b/elements/fedora-mirror/pre-install.d/00-yum deleted file mode 100755 index bf6138e698..0000000000 --- a/elements/fedora-mirror/pre-install.d/00-yum +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -mkdir -p /opt/repos -mv /etc/yum.repos.d/* /opt/repos -cat >> /etc/yum.repos.d/fedora.repo <