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 CE66247F51 for ; Thu, 29 Feb 2024 17:29:25 +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=1709227765; cv=none; b=UKKqFRSyVY0fl5+6uMhW0bdVUExMa1UbcOplU3jtfoaaFHJaRqv3N5bUooa5yaRLYVY+iU3+aIBT1TVywzer4rmtChH4jPxd62paWXL6XovvXpoE7LsGxfPyRPx7g9qcnuwTd/tUimto5+BNRhPnRrKOrH9VbcDVhXKkiLRMMIE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709227765; c=relaxed/simple; bh=3AJ0iv8s9K1xZJtx8SZLbGZosvPHw4OX211FuxQ93jU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=fEE83HzYzEL+7TJnYtxL5NZMkTKtry8JNldF8eRfjFZPvh3VErrfd0oL8EJtTJ2XGT+IUw6Zj1s+TyD/Xbxggoyn4jFNBFAfj1nhya3OxuOLus146wFxPacUfch59SgGUcthVKBac1tQaKCcrFosEZlILV+A9SVB5o8a5pyCW7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=R8H5WIyH; 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="R8H5WIyH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C197C43390 for ; Thu, 29 Feb 2024 17:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709227765; bh=3AJ0iv8s9K1xZJtx8SZLbGZosvPHw4OX211FuxQ93jU=; h=From:To:Subject:Date:From; b=R8H5WIyHx/thkxKgqEt2zcJ9tROoC/tM8EGySH+3reFj8FVdyu37cD6H5IYYfnCOg y9luc0n1VrRr4MFTBv12GSu7oL+OQCwg8ufQOCn54RNWvWAagC5V4LlBWgItN0O5Eq JEMTTDLwHWYtm3qswWT1/Mz20XLTJSqJQB1VJtnsKmM336c+ys65g63MGZVI86TFqT 0+ngsAM7zsq4ojW1frerI4cFuRIe7quDdZ1u8OhmySu1WmpmN0Ih+L5dfsY9Fet9zU DOhXt4UKqqYiw7i9MP3wQhZ3v+kZH0PR0tiPjZZx/NMIEk7l/xyKxXuFrn8tslbIrz Rafv9Za9qBFcA== From: Jeff Layton To: kdevops@lists.linux.dev Subject: [PATCH] guestfs: add the Include directive to ~/.ssh/config Date: Thu, 29 Feb 2024 12:29:23 -0500 Message-ID: <20240229172923.79056-1-jlayton@kernel.org> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add a new playbook that uses the lineinfile: ansible call to ensure that ~/.ssh/config has the proper "Include" line to pull in any config_kdevops ssh files that live in the same directory. Signed-off-by: Jeff Layton --- playbooks/roles/update_ssh_config_guestfs/tasks/main.yml | 6 ++++++ playbooks/update_ssh_config_guestfs.yml | 4 ++++ scripts/guestfs.Makefile | 4 ++++ 3 files changed, 14 insertions(+) create mode 100644 playbooks/roles/update_ssh_config_guestfs/tasks/main.yml create mode 100644 playbooks/update_ssh_config_guestfs.yml diff --git a/playbooks/roles/update_ssh_config_guestfs/tasks/main.yml b/playbooks/roles/update_ssh_config_guestfs/tasks/main.yml new file mode 100644 index 000000000000..368f99418d40 --- /dev/null +++ b/playbooks/roles/update_ssh_config_guestfs/tasks/main.yml @@ -0,0 +1,6 @@ +- name: Add Include directive to ~/.ssh/config + lineinfile: + path: ~/.ssh/config + line: "Include ~/.ssh/config_kdevops_*" + insertbefore: "BOF" + create: true diff --git a/playbooks/update_ssh_config_guestfs.yml b/playbooks/update_ssh_config_guestfs.yml new file mode 100644 index 000000000000..346b90245637 --- /dev/null +++ b/playbooks/update_ssh_config_guestfs.yml @@ -0,0 +1,4 @@ +--- +- hosts: localhost + roles: + - role: update_ssh_config_guestfs diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile index 9df15ec46e5b..6328cfd58f68 100644 --- a/scripts/guestfs.Makefile +++ b/scripts/guestfs.Makefile @@ -63,6 +63,10 @@ libvirt_pcie_passthrough_permissions: $(KDEVOPS_PROVISIONED_SSH): $(Q)if [[ "$(CONFIG_KDEVOPS_SSH_CONFIG_UPDATE)" == "y" ]]; then \ + ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ + --inventory localhost, \ + playbooks/update_ssh_config_guestfs.yml \ + -e 'ansible_python_interpreter=/usr/bin/python3' ;\ LIBVIRT_DEFAULT_URI=$(CONFIG_LIBVIRT_URI) $(TOPDIR)/scripts/update_ssh_config_guestfs.py; \ fi $(Q)touch $(KDEVOPS_PROVISIONED_SSH) -- 2.43.2