You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.8 KiB

  1. #!/bin/bash
  2. # install_vagrant() {
  3. # sudo apt install vagrant-libvirt vagrant -y
  4. # sudo vagrant plugin install vagrant-libvirt
  5. # }
  6. # prep(){
  7. # sudo apt-get update -y
  8. # sudo apt-get install ca-certificates curl libvirt-daemon-system\
  9. # libvirt-clients qemu-utils qemu-kvm htop atop -y
  10. # sudo install -m 0755 -d /etc/apt/keyrings
  11. # }
  12. # install_docker() {
  13. # VERSION_STRING=5:26.1.0-1~ubuntu.24.04~noble
  14. # sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
  15. # sudo chmod a+r /etc/apt/keyrings/docker.asc
  16. # # Add the repository to Apt sources:
  17. # echo \
  18. # "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  19. # $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  20. # sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  21. # sudo apt-get update -y
  22. # sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
  23. # }
  24. # install_docker_auto () {
  25. # curl -fsSL https://get.docker.com -o get-docker.sh
  26. # sudo sh ./get-docker.sh --dry-run
  27. # }
  28. VAGRANT_VERSION=2.4.1
  29. VAGRANT_DEFAULT_PROVIDER=libvirt
  30. VAGRANT_ANSIBLE_TAGS=facts
  31. LANG=C.UTF-8
  32. DEBIAN_FRONTEND=noninteractive
  33. PYTHONDONTWRITEBYTECODE=1
  34. KUBE_VERSION=1.29.5
  35. pipeline_install() {
  36. cp /etc/apt/sources.list /etc/apt/sources.list."$(date +"%F")"
  37. sed -i -e '/^# deb-src.*universe$/s/# //g' /etc/apt/sources.list
  38. sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
  39. apt update
  40. # libssl-dev \
  41. # python3-dev \
  42. # # jq \
  43. # moreutils \
  44. # libvirt-dev \
  45. # # rsync \
  46. # git \
  47. # # htop \
  48. # gpg \
  49. # atop
  50. # gnupg2 \
  51. # software-properties-common
  52. #
  53. apt install --no-install-recommends -y \
  54. git \
  55. make \
  56. python3-pip \
  57. sshpass \
  58. apt-transport-https \
  59. openssh-client \
  60. ca-certificates \
  61. curl \
  62. libfuse2 \
  63. unzip \
  64. qemu-utils \
  65. libvirt-daemon-system \
  66. libvirt-clients \
  67. qemu-kvm \
  68. ebtables libguestfs-tools \
  69. ruby-fog-libvirt \
  70. libvirt-dev \
  71. gcc \
  72. build-essential \
  73. ruby-libvirt \
  74. libxslt-dev libxml2-dev zlib1g-dev \
  75. python3-venv python3-full \
  76. dnsmasq
  77. apt-get build-dep -y ruby-libvirt ruby-dev
  78. ### VAGRANT ###
  79. # apt-get install -y unzip
  80. curl -LO https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_linux_amd64.zip
  81. unzip vagrant_${VAGRANT_VERSION}_linux_amd64.zip
  82. mv vagrant /usr/local/bin/vagrant
  83. chmod a+x /usr/local/bin/vagrant
  84. # ls -la /usr/local/bin/vagrant
  85. /usr/local/bin/vagrant plugin install vagrant-libvirt
  86. usermod -aG kvm kubespray
  87. usermod -aG libvirt kubespray
  88. ### DOCKER ###
  89. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  90. add-apt-repository -y "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  91. apt update
  92. apt install --no-install-recommends -y docker-ce
  93. apt autoremove -y --purge && apt clean && rm -rf /var/lib/apt/lists/* /var/log/*
  94. ### KUBECTL ###
  95. curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
  96. mv kubectl /usr/local/bin/kubectl
  97. chmod a+x /usr/local/bin/kubectl
  98. systemctl restart libvirtd
  99. # Install Vagrant
  100. # apt update -y
  101. # echo apt-get install -y unzip libfuse2 vagrant vagrant-libvirt
  102. # apt --fix-broken install -y
  103. # dpkg --configure -a -y
  104. }
  105. # wrapped up in a function so that we have some protection against only getting
  106. # half the file during "curl | sh"
  107. pipeline_install