From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFC31284698 for ; Mon, 14 Apr 2025 17:05:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744650350; cv=none; b=mp0fz3jBHaezfGOoW0RYPDsM+n9DYcvIbTdPfF9ODOmO2kWqxpqgHKJuNQK8UshDEZeal6L5/4XMSnAvYJElTDsWf/4OpXAiWhjoISVXw338dp+0p/9evgzu28CatKYuGbv4yoHMc5EOByOCxoT+npa5VCn7KBUP5TZhpHMt9ME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744650350; c=relaxed/simple; bh=78eWZZdFxtWof+96EMUlCnt+vWwhuy+MxSpT0R54/DQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ib5Pwzf/j00L6gNc+u3+/1CWwZels5YK37T1JdAjpneIWDnwdlk7EQN9VQggVGclQ7UP9HZ/Lz8sVGrNiRbbjwY2qSo3shtrXverSq8Hp9FkeQeyd4n8rm/ND4baocsft/38PKf+T+xZ/GP6GDIDgd00+3b49cG+0JfTvnSm+J0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JWwSgisz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JWwSgisz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFB1AC4CEEA; Mon, 14 Apr 2025 17:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744650350; bh=78eWZZdFxtWof+96EMUlCnt+vWwhuy+MxSpT0R54/DQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWwSgisz0aFxbaDHspfzuP3OB7lj4Yf1Fl/g8AH2KyIYSkdXL5QUX25b8qiNDIv1g ThsjWzXo6KrRSDcVLqARBeuNwsxFdq27GWMFyhQGnTjzZLqW+r6xGXq5CVC0nRLokF PstZJIJB8ghs8xGNcFex0QKkWOvsVYF1iuctbcR83NDppuF/E3sDdg4c3JDDZdXz1H RGJ2UJDaU5T7gYTHr66TmkzJAkr9qTjlpas/G1n6g25eIUoX6ReVgoXbO5gNmZrJBQ 21TLFT7v1GXTvr/N35i8ExFoLAIDybWcPTu48dyqXJUnj6XWrgAoWUt+Uz0NJ+ZnU+ Yb9ZVC0FRC+Gw== From: cel@kernel.org To: Cc: Chuck Lever Subject: [PATCH v2 2/4] install_vagrant: Remove this role Date: Mon, 14 Apr 2025 13:05:44 -0400 Message-ID: <20250414170546.1995982-3-cel@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250414170546.1995982-1-cel@kernel.org> References: <20250414170546.1995982-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Now that vagrant can no longer be used, this role is never invoked and cannot be tested. Remove it so that it does not become a source of technical debt. Signed-off-by: Chuck Lever --- Makefile.kdevops | 6 - docs/ansible-roles.md | 1 - docs/kdevops-vagrant.md | 3 - playbooks/install_vagrant.yml | 4 - playbooks/roles/install_vagrant/README.md | 46 ------ playbooks/roles/install_vagrant/Vagrantfile | 3 - .../roles/install_vagrant/defaults/main.yml | 38 ----- .../files/ruby_extensions_devel_key.pub | 20 --- .../roles/install_vagrant/files/vagrant.pub | 21 --- .../tasks/install-deps/debian/main.yml | 86 ---------- .../tasks/install-deps/fedora/main.yml | 14 -- .../tasks/install-deps/main.yml | 27 ---- .../tasks/install-deps/redhat/main.yml | 148 ------------------ .../tasks/install-deps/suse/add_obs_repo.yml | 137 ---------------- .../tasks/install-deps/suse/main.yml | 119 -------------- .../roles/install_vagrant/tasks/main.yml | 43 ----- scripts/bringup.Makefile | 1 - 17 files changed, 717 deletions(-) delete mode 100644 playbooks/install_vagrant.yml delete mode 100644 playbooks/roles/install_vagrant/README.md delete mode 100644 playbooks/roles/install_vagrant/Vagrantfile delete mode 100644 playbooks/roles/install_vagrant/defaults/main.yml delete mode 100644 playbooks/roles/install_vagrant/files/ruby_extensions_devel_key.pub delete mode 100644 playbooks/roles/install_vagrant/files/vagrant.pub delete mode 100644 playbooks/roles/install_vagrant/tasks/install-deps/debian/main.yml delete mode 100644 playbooks/roles/install_vagrant/tasks/install-deps/fedora/main.yml delete mode 100644 playbooks/roles/install_vagrant/tasks/install-deps/main.yml delete mode 100644 playbooks/roles/install_vagrant/tasks/install-deps/redhat/main.yml delete mode 100644 playbooks/roles/install_vagrant/tasks/install-deps/suse/add_obs_repo.yml delete mode 100644 playbooks/roles/install_vagrant/tasks/install-deps/suse/main.yml delete mode 100644 playbooks/roles/install_vagrant/tasks/main.yml diff --git a/Makefile.kdevops b/Makefile.kdevops index 2c36dce47eb1..60d79a5a3e48 100644 --- a/Makefile.kdevops +++ b/Makefile.kdevops @@ -14,11 +14,6 @@ kdevops_terraform_deps: $(KDEVOPS_PLAYBOOKS_DIR)/install_terraform.yml PHONY += kdevops_terraform_deps -kdevops_vagrant_install_vagrant: - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ - --inventory localhost, \ - $(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant.yml - kdevops_install_libvirt: $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ @@ -31,7 +26,6 @@ kdevops_configure_libvirt: -e 'running_user=$(USER)' kdevops_vagrant_deps: \ - kdevops_vagrant_install_vagrant \ kdevops_install_libvirt \ kdevops_configure_libvirt diff --git a/docs/ansible-roles.md b/docs/ansible-roles.md index d900fa458bfd..dfb05b9fd798 100644 --- a/docs/ansible-roles.md +++ b/docs/ansible-roles.md @@ -7,7 +7,6 @@ The following local ansible roles are used: * [create_partition](./playbooks/roles/create_partition/README.md) * create_data_partition: creates the data partition, uses the `create_partition` role * [install_terraform/](./playbooks/roles/install_terraform/README.md) - * [install_vagrant/](./playbooks/roles/install_vagrant/README.md) * [install_vagrant_boxes](./playbooks/roles/install_vagrant_boxes/README.md) * [libvirt_user](./playbooks/roles/libvirt_user/README.md) * [update_ssh_config_vagrant](./playbooks/roles/update_ssh_config_vagrant/README.md) diff --git a/docs/kdevops-vagrant.md b/docs/kdevops-vagrant.md index ae2ad831d21a..1e214d096d86 100644 --- a/docs/kdevops-vagrant.md +++ b/docs/kdevops-vagrant.md @@ -1,8 +1,5 @@ # Vagrant support - localized VMs -Read the [kdevops_vagrant](playbooks/roles/install_vagrant/README.md) -documentation, then come here and read this. - Vagrant is used to easily deploy non-cloud virtual machines. Below are the list of providers supported: diff --git a/playbooks/install_vagrant.yml b/playbooks/install_vagrant.yml deleted file mode 100644 index af6bb5e1c406..000000000000 --- a/playbooks/install_vagrant.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- hosts: localhost - roles: - - role: install_vagrant diff --git a/playbooks/roles/install_vagrant/README.md b/playbooks/roles/install_vagrant/README.md deleted file mode 100644 index 198c25515576..000000000000 --- a/playbooks/roles/install_vagrant/README.md +++ /dev/null @@ -1,46 +0,0 @@ -install-vagrant -=============== - -The Ansible install-vagrant role lets you get install Vagrant, and on Linux -also installs the vagrant-libvirt plugin. - -Requirements ------------- - -Run a supported OS/distribution: - - * SUSE SLE / OpenSUSE - * Red Hat / Fedora - * Debian / Ubuntu - -Role Variables --------------- - - * vagrant_version: the Vagrant version to install. This is only used if - downloading and installing the zip file. - * force_install_zip: if your distro supports a package ignore it, and instead - installt he package from the zip file directly from HashiCorp - * force_install_if_present: set to False by default, set this to True to - force download Vagrant even if you already have it present. - -Dependencies ------------- - -None. - -Example Playbook ----------------- - -Below is an example playbook, say a bootlinux.yml file: - -``` ---- -- hosts: localhost - roles: - - role: mcgrof.install-vagrant -``` - -License -------- - -copyleft-next-0.3.1 diff --git a/playbooks/roles/install_vagrant/Vagrantfile b/playbooks/roles/install_vagrant/Vagrantfile deleted file mode 100644 index ef6b17fc13b1..000000000000 --- a/playbooks/roles/install_vagrant/Vagrantfile +++ /dev/null @@ -1,3 +0,0 @@ -unless Vagrant.has_plugin?("vagrant-libvirt") - raise 'vagrant-libvirt is not installed!' -end diff --git a/playbooks/roles/install_vagrant/defaults/main.yml b/playbooks/roles/install_vagrant/defaults/main.yml deleted file mode 100644 index 0941b97d0ca1..000000000000 --- a/playbooks/roles/install_vagrant/defaults/main.yml +++ /dev/null @@ -1,38 +0,0 @@ -# SPDX-License-Identifier copyleft-next-0.3.1 ---- - -storage_pool_user: "root" -storage_pool_group: "root" - -# kdevops *owns* this so we expect to set this to something -# sensible with kconfig. -kdevops_storage_pool_user: "root" -kdevops_storage_pool_group: "root" - -libvirt_provider: False -virtualbox_provider: False -libvirt_storage_pool_create: False - -storage_pool_path: "/dev/null" -kdevops_storage_pool_path: "/dev/null" - -# You can override these -vagrant_version: "2.2.19" - -# Ignores using distro packages and installs from zip file instead -force_install_zip: False - -# Forces to install even if it is already present -force_install_if_present: False - -# Set this to True and create a map with the sle_distro_end_map variable -# if you are working with unreleased distros, which have no public OBS URLs yet. -sle_custom_repo_distro_end: False - -# Example boxes with URLs. You would override this. -# -# For instance, for SLE 15.2 we'd want to use: -# https://download.opensuse.org/repositories/Virtualization:/vagrant/SLE_15-SP1/ -# for now, as we have no public release on obs for 15.2 yet. -sle_distro_end_map: - - { obs_project_name: 'Virtualization:vagrant', ansible_distribution_version: '15.2', repo_distro_end: '15-SP1' } diff --git a/playbooks/roles/install_vagrant/files/ruby_extensions_devel_key.pub b/playbooks/roles/install_vagrant/files/ruby_extensions_devel_key.pub deleted file mode 100644 index e34b0c1fe170..000000000000 --- a/playbooks/roles/install_vagrant/files/ruby_extensions_devel_key.pub +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.5 (GNU/Linux) - -mQGiBEh7UZcRBACLvGPkYIZVbMpfDmIwQ+Dv1mGuMZ2nRnWZSMfled6W+njVjCXV -ogw1dOeR4guVADsTkkOXPGy9ehfBB0hLxQVVRIuZtsGY+SsqG8QhStmYkbm8hF8w -V0OpVNYSHkkeCRkXba8xNQFtxP+7qqLcCIvsH5kkw5xtS9AgtKVUKARh+wCg90PK -lVsDq3xlQy5Sxm7y1oVTY0UEAIK0Zkh0nVf5oaGeQ5ADXLxqGZHwzrUsX6otKl2M -fAPHLF2d+W2IFCQg3vxok2ON1y0iaaT/lJTx345Eo0PTY7iUJz+lK4u3wvgHk/jN -ZiMzZlRfZ5JKGph2kTw3rgXPc727a2tlGCaR56BtxMhGFs9pQzZt8w5vFVpJ456u -pKNYA/9wyRFS/3gGzMfndM/qst8gJ8pLAa8omAyu4PXyZKcvNmq+YV6t/WXrt/wF -mvEZwZzbPp5dwER6JKLW33N433a/h3ABT2nW1vapa4c78KfOyk3C+eY5mrH9UmhK -nfRAacH6XOnLoDSRjfY2hbHZmeRGvaz237QkXk6ojGZ7x3chGLRKZGV2ZWw6bGFu -Z3VhZ2VzOnJ1YnkgT0JTIFByb2plY3QgPGRldmVsOmxhbmd1YWdlczpydWJ5QGJ1 -aWxkLm9wZW5zdXNlLm9yZz6IZgQTEQIAJgUCW8Q6+AIbAwUJF2eZYQYLCQgHAwIE -FQIIAwQWAgMBAh4BAheAAAoJEJrwyaIOmvEj75AAmwYlB0mYqsYycWJ77bl+oeiL -sHjgAJ43giIbI7qOcxuTE+JmKeg8kfIyx4hGBBMRAgAGBQJIe1GXAAoJEDswEbdr -nWUj2GkAn3w67FAdfBcX8/ax3PkgPeiLucqmAJ4m2LnytD9F1/oeRmOrBS8hgmIp -5w== -=fmVv ------END PGP PUBLIC KEY BLOCK----- diff --git a/playbooks/roles/install_vagrant/files/vagrant.pub b/playbooks/roles/install_vagrant/files/vagrant.pub deleted file mode 100644 index 13d9f438e9aa..000000000000 --- a/playbooks/roles/install_vagrant/files/vagrant.pub +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.5 (GNU/Linux) - -mQENBFImAl0BCACkjaXGvVLHBGTVXVP0khtpUVHqFvCRtaIIMHaX/5oTr3nyehDQ -Ex9VLsSRcNa0QxtnCHFRQzjWWqe+i6pBginnSjucgmjnIKyJsF4l6R+rwAiinHQX -C4s6Lqg/wH9xDPRBrMYFqlc/7MVf0Glhk1+lAxgQjolMt+5AbbrWlBbwc/i+++zl -ES3MaeH8aiwup/ogjhmk0SbCQQ/ib21p3XWBwx2oz/KM6Voq9tKDvMczjzNRY3ZT -6Di3FsUSKI7kgljiNiuN+675YwqEqxWEJgdE5a7Zb67giH1Ik08b5wQiF5jSAICD -DxW7/ibWBvZJnqhqQT2xJpLC5VaJqwkN8o83ABEBAAG0PlZpcnR1YWxpemF0aW9u -IE9CUyBQcm9qZWN0IDxWaXJ0dWFsaXphdGlvbkBidWlsZC5vcGVuc3VzZS5vcmc+ -iQE8BBMBAgAmBQJaPd9XAhsDBQkMNoz6BgsJCAcDAgQVAggDBBYCAwECHgECF4AA -CgkQoZP7tXIXT8JL9AgAmSAr5NOzSZ6HE6P8aEMMdH5gK3PWfBhIVUvnAql4/90Y -0AnUXAFgwf4WS8qqd4s/yCoXKmQ/trEJINVIOcISYRmuZxZnO65AgYSUqcKa7M0X -YJYCaEexML/AUqNjPPd7aoISxgxHPYF5rvKKq29Q5ORas5mDQGUWCcSo+Nx6twh1 -t+HJyhAK+CFRFDns57jXHf7QDlKGM0+9wfgwi7E61+bEbSIISEco/lyH1u1epqvN -1SDXzauGZRi7nu39+DN8CJpw1l40GafB6KGkKQ0wQ1ORZP21LnQ2YCvniIeiZwEu -5eVxIpoKOmIIzAk1DWLfelaFhM2bwpjRKScNbFikZohGBBMRAgAGBQJSJgJdAAoJ -EDswEbdrnWUjucgAoK+hIu0GfjwJoODK+XW/uDN2nqQBAJ4lN90WkygQhpMEIupB -6+FWiCNvxA== -=yQVo ------END PGP PUBLIC KEY BLOCK----- diff --git a/playbooks/roles/install_vagrant/tasks/install-deps/debian/main.yml b/playbooks/roles/install_vagrant/tasks/install-deps/debian/main.yml deleted file mode 100644 index 0638dae6183f..000000000000 --- a/playbooks/roles/install_vagrant/tasks/install-deps/debian/main.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -- name: Verify Vagrant installation - command: "which vagrant" - register: vagrant_present - changed_when: vagrant_present.rc == 1 - failed_when: vagrant_present.rc != 0 and vagrant_present.rc != 1 - tags: [ 'vagrant', 'verify' ] - -- name: Update apt cache - become: yes - become_method: sudo - apt: - update_cache: yes - when: - - not force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 - tags: install - -- name: Install Vagrant and vagrant-libvirt - become: yes - become_method: sudo - apt: - name: - - vagrant - - vagrant-libvirt - state: present - when: - - not force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 - tags: install - -- name: Download Vagrant from the latest release and install locally - become: yes - become_method: sudo - unarchive: - src: https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version }}_linux_amd64.zip - dest: /usr/local/bin - remote_src: yes - when: - - force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 - -# This is a major heck, alas, Vagrant plugin subset commands do not have any -# easy way to confirm if a plugin is installed in a straight forward way. -# Otherwise, we'd install vagrant-libvirt without checking, and even if -# that is installed the latest version, this takes *forever*. -- name: Check if the Vagrant plugin vagrant-libvirt is installed - shell: | - set -o pipefail - vagrant status - args: - executable: /bin/bash - chdir: "{{ role_path }}" - register: plugin_check - changed_when: plugin_check.rc == 0 - failed_when: plugin_check.rc != 0 and plugin_check.rc != 1 - run_once: true - when: - - force_install_zip|bool - -- name: Install vagrant-libvirt build dependencies - become: yes - become_method: sudo - apt: - name: - - vagrant - - ruby-libvirt - state: build-dep - when: - - force_install_zip|bool and plugin_check.rc != 0 - -- name: Installs the libvirt Vagrant plugin - command: "vagrant plugin install vagrant-libvirt" - register: cmd_done - changed_when: "cmd_done.rc == 0" - when: - - force_install_zip|bool - - plugin_check.rc != 0 - -- name: Install the timezone Vagrant plugin - command: "vagrant plugin install vagrant-timezone" - register: cmd_done - changed_when: "cmd_done.rc == 0" - when: - - force_install_zip|bool - - plugin_check.rc != 0 diff --git a/playbooks/roles/install_vagrant/tasks/install-deps/fedora/main.yml b/playbooks/roles/install_vagrant/tasks/install-deps/fedora/main.yml deleted file mode 100644 index 45cce5f7d8d2..000000000000 --- a/playbooks/roles/install_vagrant/tasks/install-deps/fedora/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Install vagrant and vagrant-plugin-libvirt - become: yes - become_method: sudo - dnf: - name: - - vagrant - - vagrant-libvirt - state: present - -- name: Install the timezone vagrant plugin - command: "vagrant plugin install vagrant-timezone" - register: cmd_done - changed_when: "cmd_done.rc == 0" diff --git a/playbooks/roles/install_vagrant/tasks/install-deps/main.yml b/playbooks/roles/install_vagrant/tasks/install-deps/main.yml deleted file mode 100644 index 87b87f3b4ba2..000000000000 --- a/playbooks/roles/install_vagrant/tasks/install-deps/main.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Import optional distribution specific variables - include_vars: "{{ item }}" - ignore_errors: yes - with_first_found: - - files: - - "{{ ansible_facts['os_family']|lower }}.yml" - skip: true - tags: vars - -- name: Debian-specific setup - include_tasks: debian/main.yml - when: ansible_facts['os_family']|lower == 'debian' - -- name: SuSE-specific setup - include_tasks: suse/main.yml - when: ansible_facts['os_family']|lower == 'suse' - -- name: Red Hat Enterprise-specific setup - include_tasks: redhat/main.yml - when: - - ansible_facts['os_family']|lower == 'redhat' - - ansible_facts['distribution']|lower != "fedora" - -- name: Fedora-specific setup - include_tasks: fedora/main.yml - when: ansible_facts['distribution']|lower == "fedora" diff --git a/playbooks/roles/install_vagrant/tasks/install-deps/redhat/main.yml b/playbooks/roles/install_vagrant/tasks/install-deps/redhat/main.yml deleted file mode 100644 index 1424dc13020f..000000000000 --- a/playbooks/roles/install_vagrant/tasks/install-deps/redhat/main.yml +++ /dev/null @@ -1,148 +0,0 @@ ---- -# RH doesn't have any up to date reasonable package for -# vagrant or vagrant-libvirt -- name: Set generic redhat/fedora specific distro facts - set_fact: - force_install_zip: true - -- name: Nuke vagrant binary manually - become: yes - become_method: sudo - file: - path: "/usr/local/bin/vagrant" - state: absent - when: - - force_install_zip|bool - -- name: Install requiredments to run our verifications or to download vagrant - become: yes - become_method: sudo - yum: - name: - - fuse - - unzip - - bsdtar - state: present - tags: install - -- name: Verify vagrant installation - command: "which vagrant" - register: vagrant_present - changed_when: vagrant_present.rc == 1 - failed_when: vagrant_present.rc != 0 and vagrant_present.rc != 1 - tags: [ 'vagrant', 'verify' ] - -- name: Install vagrant and vagrant-libvirt - become: yes - become_method: sudo - yum: - name: - - vagrant - - vagrant-libvirt - state: present - when: - - not force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 - tags: install - -- name: Download Vagrant from the latest release and install locally - become: yes - become_method: sudo - unarchive: - src: https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version }}_linux_amd64.zip - dest: /usr/local/bin - remote_src: yes - when: - - force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 - -# This is a major heck, alas, vagrant plugin subset commands do not have any -# easy way to confirm if a plugin is installed in a straight forward way. -# Otherwise, we'd install vagrant-libvirt without checking, and even if -# that is installed the latest version, this takes *forever*. -- name: Check if the vagrant plugin vagrant-libvirt is installed - shell: | - set -o pipefail - vagrant status - args: - executable: /bin/bash - chdir: "{{ role_path }}" - register: plugin_check - changed_when: plugin_check.rc == 0 - failed_when: plugin_check.rc != 0 and plugin_check.rc != 1 - run_once: true - when: - - force_install_zip|bool - -# This is a major heck, alas, vagrant plugin subset commands do not have any -# easy way to confirm if a plugin is installed in a straight forward way. -# Otherwise, we'd install vagrant-libvirt without checking, and even if -# that is installed the latest version, this takes *forever*. -- name: Check if the vagrant plugin vagrant-libvirt is installed - shell: | - set -o pipefail - vagrant status - args: - executable: /bin/bash - chdir: "{{ role_path }}" - register: plugin_check - changed_when: plugin_check.rc == 0 - failed_when: plugin_check.rc != 0 and plugin_check.rc != 1 - run_once: true - -- name: Enable libvirtd - become: yes - become_method: sudo - systemd: - name: libvirtd - enabled: yes - masked: no - -- name: Start libvirtd - become: yes - become_method: sudo - systemd: - name: libvirtd - state: restarted - -- name: Install vagrant-libvirt build dependencies - become: yes - become_method: sudo - yum: - name: - - libvirt-devel - - openssl-devel - - ruby-devel - - gcc - - rubygem-ruby-libvirt - - rubygem-rake - - autoconf - - automake - - byacc - - binutils - - libguestfs-tools - - wget - - zlib-devel - state: present - when: - - force_install_zip|bool and plugin_check.rc != 0 - -- name: Installs the libvirt vagrant plugin - command: "vagrant plugin install vagrant-libvirt" - environment: - CONFIGURE_ARGS: 'with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64' - register: cmd_done - changed_when: "cmd_done.rc == 0" - when: - - force_install_zip|bool - - plugin_check.rc != 0 - -- name: Install the timezone vagrant plugin - command: "vagrant plugin install vagrant-timezone" - environment: - CONFIGURE_ARGS: 'with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64' - register: cmd_done - changed_when: "cmd_done.rc == 0" - when: - - force_install_zip|bool - - plugin_check.rc != 0 diff --git a/playbooks/roles/install_vagrant/tasks/install-deps/suse/add_obs_repo.yml b/playbooks/roles/install_vagrant/tasks/install-deps/suse/add_obs_repo.yml deleted file mode 100644 index ad82270b9967..000000000000 --- a/playbooks/roles/install_vagrant/tasks/install-deps/suse/add_obs_repo.yml +++ /dev/null @@ -1,137 +0,0 @@ ---- -- name: Verify obs_project_name is defined - fail: - msg: Fail when the OBS project name is not set - when: obs_project_name is not defined - -- name: Set SUSE repo specific distro facts - set_fact: - obs_url: "https://build.opensuse.org/" - obs_project_no_collon: "{{ obs_project_name | lower | replace(':', '_') }}" - -- name: Set OBS pubkey file location - set_fact: - obs_project_signkey: "/usr/local/share/{{ obs_project_no_collon }}.pub" - -- name: Ensure that /usr/local/share/ is a directory - file: - path: /usr/local/share/ - state: directory - -- block: - - name: Set pubkey URL - set_fact: - pubkey_url: "{{ obs_url }}projects/{{ obs_project_name }}/public_key" - - - name: Fetch the repository's public key - become: yes - become_method: sudo - get_url: - url: "{{ pubkey_url }}" - validate_certs: yes - dest: "{{ obs_project_signkey }}" - - when: obs_project_gpg_key is not defined - -- name: Copy the repository's public key to the remote machine - become: yes - become_method: sudo - copy: - src: "{{ obs_project_gpg_key }}" - dest: "{{ obs_project_signkey }}" - when: obs_project_gpg_key is defined - -- name: Import the signkey into the rpm key database - become: yes - become_method: sudo - rpm_key: - state: present - key: "{{ obs_project_signkey }}" - -- block: - - name: Set Leap repository names - set_fact: - repo_distro_end: "openSUSE_Leap_{{ ansible_distribution_version }}" - when: 'is_leap | bool' - - - name: Set Tumbleweed repository names - set_fact: - repo_distro_end: "openSUSE_Tumbleweed" - when: 'is_tumbleweed | bool' - - - name: Set SLE repository names - set_fact: - repo_distro_end: "SLE_{{ ansible_distribution_version | replace('.', '_SP') }}" - when: 'is_sle | bool' - - when: obs_project_repository_name is not defined - -- name: Set obs project repo URL - set_fact: - obs_project_repo_base: "{{ obs_url | replace('build', 'download') }}repositories/{{ obs_project_name | replace(':', ':/') }}/" - -- name: Forced SLE custom distro end name to a temporary name from config file - set_fact: - repo_distro_end: "{{ repo.repo_distro_end }}" - with_items: - - "{{ sle_distro_end_map }}" - loop_control: - loop_var: repo - when: - - 'sle_custom_repo_distro_end | bool' - - 'is_sle | bool' - - ansible_distribution_version == repo.ansible_distribution_version - - obs_project_name == repo.obs_project_name - -- name: Try to fetch the obs project .repo file - become: yes - become_method: sudo - get_url: - url: "{{ obs_project_repo_base }}/{{ repo_distro_end }}/{{ obs_project_name }}.repo" - dest: /dev/null - force: yes - register: default_end_fetch - ignore_errors: true - changed_when: false - -- block: - - name: Set distro end name for tumbleweed - set_fact: - repo_distro_end: openSUSE_Factory - when: 'is_tumbleweed | bool' - - - name: Set distro end name for SLE - set_fact: - repo_distro_end: "SLE_{{ ansible_distribution_version | replace('.', '-SP') }}" - when: 'is_sle | bool' - - - name: Try to fetch the project .repo file again - become: yes - become_method: sudo - get_url: - url: "{{ obs_project_repo_base }}/{{ repo_distro_end }}/{{ obs_project_name }}.repo" - dest: /dev/null - force: yes - register: second_end_fetch - changed_when: false - ignore_errors: true - - - name: Set repo end name for SLE when second end fetch fails - set_fact: - repo_distro_end: "SLE-{{ ansible_distribution_version | replace('.', '-SP') }}" - when: '(is_sle | bool) and (second_end_fetch.failed | bool)' - - when: 'default_end_fetch.failed | bool' - -- name: Set obs project repo URL - set_fact: - obs_project_repo_url: "{{ obs_project_repo_base }}/{{ repo_distro_end }}" - -- name: Add the repository - become: yes - become_method: sudo - zypper_repository: - repo: "{{ obs_project_repo_url }}" - name: "{{ obs_project_no_collon }}" - state: present - runrefresh: yes diff --git a/playbooks/roles/install_vagrant/tasks/install-deps/suse/main.yml b/playbooks/roles/install_vagrant/tasks/install-deps/suse/main.yml deleted file mode 100644 index 87e228d485c3..000000000000 --- a/playbooks/roles/install_vagrant/tasks/install-deps/suse/main.yml +++ /dev/null @@ -1,119 +0,0 @@ ---- -- name: Set generic SUSE specific distro facts - set_fact: - is_sle: '{{ (ansible_distribution == "SLES") or (ansible_distribution == "SLED") }}' - is_leap: '{{ "Leap" in ansible_distribution }}' - is_tumbleweed: '{{ "openSUSE Tumbleweed" == ansible_distribution }}' - -- name: Verify vagrant installation - command: "which vagrant" - register: vagrant_present - changed_when: vagrant_present.rc == 1 - failed_when: vagrant_present.rc != 0 and vagrant_present.rc != 1 - tags: [ 'vagrant', 'verify' ] - -- name: "Add the following development opensuse projects" - include_tasks: ./add_obs_repo.yml - vars: - obs_project_name: "{{ item.name }}" - obs_project_gpg_key: "{{ item.key }}" - loop: - - name: "devel:languages:ruby:extensions" - key: files/ruby_extensions_devel_key.pub - - name: "Virtualization:vagrant" - key: files/vagrant.pub - when: - - not force_install_if_present|bool - - not force_install_zip|bool - - vagrant_present.rc != 0 - - is_sle or is_leap - -- name: Install vagrant and vagrant-libvirt from opensuse repository - become: yes - become_method: sudo - zypper: - name: - - vagrant - - vagrant-libvirt - extra_args: '--allow-vendor-change' - state: latest - disable_recommends: no - when: - - not force_install_zip|bool - - not force_install_if_present|bool - - vagrant_present.rc != 0 - - is_sle or is_leap - -- name: Install vagrant and vagrant-libvirt from your tumbleweed repository - become: yes - become_method: sudo - zypper: - name: - - vagrant - - vagrant-libvirt - when: - - not force_install_zip|bool - - not force_install_if_present|bool - - vagrant_present.rc != 0 - - is_tumbleweed - -- name: Download Vagrant from the latest release and install locally - become: yes - become_method: sudo - unarchive: - src: https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version }}_linux_amd64.zip - dest: /usr/local/bin - remote_src: yes - when: - - force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 - -# This is a major heck, alas, vagrant plugin subset commands do not have any -# easy way to confirm if a plugin is installed in a straight forward way. -# Otherwise, we'd install vagrant-libvirt without checking, and even if -# that is installed the latest version, this takes *forever*. -- name: Check if the vagrant plugin vagrant-libvirt is installed - shell: | - set -o pipefail - vagrant status - args: - executable: /bin/bash - chdir: "{{ role_path }}" - register: plugin_check - changed_when: plugin_check.rc == 0 - failed_when: plugin_check.rc != 0 and plugin_check.rc != 1 - run_once: true - when: - - force_install_zip|bool - -- name: Install vagrant-libvirt build dependencies - become: yes - become_method: sudo - zypper: - name: - - qemu - - libvirt - - libvirt-devel - - ruby-devel - - gcc - - qemu-kvm - state: present - when: - - force_install_zip|bool - - plugin_check.rc != 0 - -- name: Installs the libvirt vagrant plugin - command: "vagrant plugin install vagrant-libvirt" - register: cmd_done - changed_when: "cmd_done.rc == 0" - when: - - force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 - -- name: Install the timezone vagrant plugin - command: "vagrant plugin install vagrant-timezone" - register: cmd_done - changed_when: "cmd_done.rc == 0" - when: - - force_install_zip|bool - - force_install_if_present|bool or vagrant_present.rc != 0 diff --git a/playbooks/roles/install_vagrant/tasks/main.yml b/playbooks/roles/install_vagrant/tasks/main.yml deleted file mode 100644 index 66aebc48cc50..000000000000 --- a/playbooks/roles/install_vagrant/tasks/main.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- name: Import optional extra_args file - include_vars: "{{ item }}" - ignore_errors: yes - with_first_found: - - files: - - "../extra_vars.yml" - - "../extra_vars.yaml" - - "../extra_vars.json" - skip: true - tags: vars - -# Distro specific -- name: Install Vagrant and other dependencies - include_tasks: install-deps/main.yml - -- name: Create a base storage pool if it does not exist - become: yes - become_method: sudo - file: - path: "{{ storage_pool_path }}" - state: directory - mode: 'g+rw,o+rx' - owner: "{{ storage_pool_user }}" - group: "{{ storage_pool_group }}" - delegate_to: localhost - run_once: true - when: - - libvirt_storage_pool_create|bool - -- name: Create a kdevops specific storage pool for Vagrant if it does not exist - become: yes - become_method: sudo - file: - path: "{{ kdevops_storage_pool_path }}" - state: directory - mode: 'o+rwxs,g+rxws' - owner: "{{ kdevops_storage_pool_user }}" - group: "{{ kdevops_storage_pool_group }}" - delegate_to: localhost - run_once: true - when: - - libvirt_storage_pool_create|bool diff --git a/scripts/bringup.Makefile b/scripts/bringup.Makefile index ad8e8d0aa750..5a04448e6970 100644 --- a/scripts/bringup.Makefile +++ b/scripts/bringup.Makefile @@ -6,7 +6,6 @@ else stage-2-$(CONFIG_TERRAFORM) += kdevops_terraform_deps stage-2-$(CONFIG_LIBVIRT_INSTALL) += kdevops_install_libvirt stage-2-$(CONFIG_LIBVIRT_CONFIGURE) += kdevops_configure_libvirt -stage-2-$(CONFIG_VAGRANT) += kdevops_vagrant_install_vagrant stage-2-$(CONFIG_VAGRANT_INSTALL_PRIVATE_BOXES) += kdevops_vagrant_boxes stage-2-$(CONFIG_LIBVIRT_VERIFY) += kdevops_verify_libvirt_user stage-2-$(CONFIG_LIBVIRT_STORAGE_POOL_CREATE) += kdevops_libvirt_storage_pool_create -- 2.49.0