Skip to content

Commit

Permalink
Removing all repositories in RH-Like and SUSE systems after cloud-ini…
Browse files Browse the repository at this point in the history
…t phase
  • Loading branch information
srbarrios committed Jan 4, 2023
1 parent 750e48c commit 935ed61
Showing 1 changed file with 58 additions and 5 deletions.
63 changes: 58 additions & 5 deletions backend_modules/libvirt/host/user_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +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/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 @@ -87,6 +91,9 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
%{ else }
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "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 @@ -131,6 +138,11 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
%{ else }
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "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 @@ -175,6 +187,11 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
%{ else }
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "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 Down Expand Up @@ -213,6 +230,8 @@ packages: ["venv-salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ else }
packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles12sp5o" }
Expand All @@ -229,6 +248,8 @@ packages: ["venv-salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ else }
packages: ["avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }
runcmd:
- "zypper removerepo os_pool_repo"
%{ endif }

%{ if image == "sles15o" }
Expand All @@ -255,6 +276,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 os_pool_repo"
%{ endif }

%{ if image == "sles15sp1o" }
Expand All @@ -280,6 +302,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 os_pool_repo"
%{ endif }

%{ if image == "sles15sp2o" }
Expand All @@ -305,6 +328,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 os_pool_repo"
%{ endif }

%{ if image == "sles15sp3o" }
Expand All @@ -325,6 +349,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 os_pool_repo"
%{ endif }

%{ if image == "sles15sp4o" }
Expand All @@ -345,6 +370,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 os_pool_repo"
%{ endif }

%{ if image == "ubuntu1604o" }
Expand Down Expand Up @@ -391,6 +417,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 @@ -447,7 +475,10 @@ 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" }

apt:
Expand Down Expand Up @@ -488,7 +519,10 @@ 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" }
runcmd:
# HACK: cloud-init in Debian 11 does not take care of the following
Expand All @@ -502,6 +536,7 @@ packages: ["venv-salt-minion", "salt-minion", "avahi-daemon", "qemu-guest-agent"
packages: ["salt-minion", "avahi-daemon", "qemu-guest-agent", "gnupg", "python3-apt"]
%{ endif }
%{ endif }

%{ if image == "debian10o" }
runcmd:
# HACK: cloud-init in Debian 10 does not take care of the following
Expand All @@ -515,6 +550,7 @@ packages: ["venv-salt-minion", "salt-minion", "avahi-daemon", "qemu-guest-agent"
packages: ["salt-minion", "avahi-daemon", "qemu-guest-agent", "apt-transport-https", "python-apt", "python3-apt"]
%{ endif }
%{ endif }

%{ if image == "debian9o" }
runcmd:
# HACK: cloud-init in Debian 9 does not take care of the following
Expand Down Expand Up @@ -554,7 +590,9 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
%{ else }
packages: ["salt-minion", "avahi", "nss-mdns", "qemu-guest-agent"]
%{ endif }

runcmd:
- "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 @@ -582,7 +620,9 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
%{ else }
packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion"]
%{ endif }

runcmd:
- "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 @@ -610,7 +650,9 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
%{ else }
packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion"]
%{ endif }

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

%{ if image == "rocky8o" }
Expand All @@ -636,7 +678,9 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns"]
%{ else }
packages: ["avahi", "nss-mdns", "salt-minion"]
%{ endif }

runcmd:
- "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 @@ -667,6 +711,9 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns"]
%{ else }
packages: ["avahi", "nss-mdns", "salt-minion"]
%{ endif }
runcmd:
- "rm -f /etc/yum.repos.d/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "oraclelinux8o" }
Expand All @@ -693,6 +740,9 @@ 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/tools_pool_repo.repo"
- "rm -f /etc/yum.repos.d/epel.repo"
%{ endif }

%{ if image == "oraclelinux9o" }
Expand All @@ -718,7 +768,10 @@ packages: ["venv-salt-minion", "salt-minion", "avahi", "nss-mdns", "qemu-guest-a
%{ else }
packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion"]
%{ endif }


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

%{ if image == "opensuse154armo" }
Expand Down

0 comments on commit 935ed61

Please sign in to comment.