Skip to content

Commit

Permalink
Remove all Debian-like repositories after cloud-init
Browse files Browse the repository at this point in the history
  • Loading branch information
srbarrios committed Dec 1, 2022
1 parent 2e417f0 commit 40a9049
Showing 1 changed file with 41 additions and 27 deletions.
68 changes: 41 additions & 27 deletions backend_modules/libvirt/host/user_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ runcmd:
- "sed -i -e's/without-password/yes/' /etc/ssh/sshd_config"
- "service sshd restart"
- "service qemu-ga start"
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
- "rm -f /etc/yum.repos.d/CentOS-Base_backup.repo"
- "rm -f /etc/yum.repos.d/CentOS-Updates_backup.repo"
%{ endif }

%{ if image == "centos7o" }
Expand Down Expand Up @@ -89,7 +92,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "centos8o" }
Expand Down Expand Up @@ -135,7 +139,10 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
- "rm -f /etc/yum.repos.d/CentOS-Base_backup.repo"
- "rm -f /etc/yum.repos.d/CentOS-Appstream_backup.repo"
%{ endif }

%{ if image == "centos9o" }
Expand Down Expand Up @@ -181,7 +188,10 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
- "rm -f /etc/yum.repos.d/CentOS-Base_backup.repo"
- "rm -f /etc/yum.repos.d/CentOS-Appstream_backup.repo"
%{ endif }

%{ if image == "opensuse152o" }
Expand All @@ -190,9 +200,6 @@ packages: ["venv-salt-minion", "qemu-guest-agent"]
%{ else }
packages: ["qemu-guest-agent"]
%{ endif }

runcmd:
- "zypper removerepo --all"
%{ endif }

%{ if image == "opensuse153o" || image == "opensuse153-ci-pr" || image == "opensuse153-ci-pr-client" || image == "opensuse154o" || image == "opensuse154-ci-pr" || image == "opensuse154-ci-pr-client" }
Expand All @@ -201,9 +208,6 @@ packages: ["venv-salt-minion", "avahi", "nss-mdns"]
%{ else }
packages: ["avahi", "nss-mdns"]
%{ endif }

runcmd:
- "zypper removerepo --all"
%{ endif }

%{ if image == "sles12sp4o" }
Expand All @@ -221,7 +225,7 @@ packages: ["venv-salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "zypper removerepo --all"
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles12sp5o" }
Expand All @@ -239,7 +243,7 @@ packages: ["venv-salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "zypper removerepo --all"
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles15o" }
Expand All @@ -266,7 +270,7 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
runcmd:
# WORKAROUND: cloud-init in SLES 15 does not take care of the following
- "systemctl start 'qemu-ga@virtio\\x2dports-org.qemu.guest_agent.0'"
- "zypper removerepo --all"
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles15sp1o" }
Expand All @@ -292,7 +296,7 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
runcmd:
# WORKAROUND: cloud-init in SLES 15 SP1 does not take care of the following
- "systemctl start 'qemu-ga@virtio\\x2dports-org.qemu.guest_agent.0'"
- "zypper removerepo --all"
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles15sp2o" }
Expand All @@ -318,7 +322,7 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
runcmd:
# WORKAROUND: cloud-init in SLES 15 SP2 does not take care of the following
- "systemctl start 'qemu-ga@virtio\\x2dports-org.qemu.guest_agent.0'"
- "zypper removerepo --all"
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles15sp3o" }
Expand All @@ -339,7 +343,7 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
runcmd:
# WORKAROUND: cloud-init in SLES 15 SP3 does not take care of the following
- "systemctl start 'qemu-ga@virtio\\x2dports-org.qemu.guest_agent.0'"
- "zypper removerepo --all"
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles15sp4o" }
Expand All @@ -360,7 +364,7 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
runcmd:
# WORKAROUND: cloud-init in SLES 15 SP4 does not take care of the following
- "systemctl start 'qemu-ga@virtio\\x2dports-org.qemu.guest_agent.0'"
- "zypper removerepo --all"
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "ubuntu1604o" }
Expand Down Expand Up @@ -407,6 +411,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi-daemon", "qemu-guest-agent"
%{ else }
packages: ["salt-minion", "avahi-daemon", "qemu-guest-agent"]
%{ endif }
runcmd:
- "rm -f /etc/apt/sources.list.d/tools_pool_repo.list"
%{ endif }

%{ if image == "ubuntu1804o" }
Expand Down Expand Up @@ -463,6 +469,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi-daemon", "qemu-guest-agent"
%{ else }
packages: ["salt-minion", "avahi-daemon", "qemu-guest-agent"]
%{ endif }
runcmd:
- "rm -f /etc/apt/sources.list.d/tools_pool_repo.list"
%{ endif }

%{ if image == "ubuntu2204o" }
Expand Down Expand Up @@ -505,6 +513,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi-daemon", "qemu-guest-agent"
%{ else }
packages: ["salt-minion", "avahi-daemon", "qemu-guest-agent"]
%{ endif }
runcmd:
- "rm -f /etc/apt/sources.list.d/tools_pool_repo.list"
%{ endif }

%{ if image == "debian11o" }
Expand Down Expand Up @@ -575,7 +585,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "almalinux8o" }
Expand Down Expand Up @@ -604,7 +615,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "almalinux9o" }
Expand Down Expand Up @@ -633,7 +645,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "rocky8o" }
Expand All @@ -660,7 +673,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns"]
packages: ["avahi", "nss-mdns", "salt-minion"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "rocky9o" }
Expand Down Expand Up @@ -692,7 +706,8 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns"]
packages: ["avahi", "nss-mdns", "salt-minion"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "oraclelinux8o" }
Expand Down Expand Up @@ -720,7 +735,8 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion"]
%{ endif }

runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "oraclelinux9o" }
Expand Down Expand Up @@ -748,7 +764,8 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion"]
%{ endif }

runcmd:
- "rm -f /etc/yum.repos.d/*.repo"
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "opensuse154armo" }
Expand All @@ -757,7 +774,4 @@ packages: ["venv-salt-minion", "salt-minion"]
%{ else }
packages: ["salt-minion"]
%{ endif }

runcmd:
- "zypper removerepo --all"
%{ endif }

0 comments on commit 40a9049

Please sign in to comment.