From patchwork Wed Feb 5 15:52:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13961412 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 150DE18FDA5 for ; Wed, 5 Feb 2025 15:52:58 +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=1738770779; cv=none; b=Dkm3oVpL9EsL0uFcboYg4yojZdv3H4zxyby3QwmSYtOyKJegHS3lvJlxIqXwu0AydYdqM7t12r8RNJaIeGU/Jv/XD49/qUAeWYjCQeGNjuFhvTFZA49oSsgi5FDo7NeBzLzszUcbLYgaOVaUxI7hB881Sp19UUPIeAY8GIYIR9c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738770779; c=relaxed/simple; bh=vMZUeDBJA3SrcExPIW10L2PT0YmT0lcudh/cNrZ42Pk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t6fy4aTCaGlU2wuboBOvqvZwHo05UvsRBs45fiSx/nRqz6NlZ9CWDJY8lf3AB+NRuIr+Lwq7z6xGWtX3PJ5xH6ioUmjFtBTz95xJmyO8yHTiGce5x8CFvFRO7/Qa694jQ93YjLbCSJ0AQ5RiW1bRCHgjHvupQfb5CS7lTFLVehY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T9lGB+GW; 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="T9lGB+GW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C615C4CED1; Wed, 5 Feb 2025 15:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738770778; bh=vMZUeDBJA3SrcExPIW10L2PT0YmT0lcudh/cNrZ42Pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9lGB+GWTQP6gsrUbjsbDVuOt429bMXsyTadKSNr3krMJjGvFEXdZT2vl3A9qf1gi W5cwR/uurp34cqMpOESYpmlHzsbF9sRhkziYUiRmJqlsFyRF91N0v3f0+XrDJo5fcR msR3pUqYubWj9+IpK+5QfUr7ALIp/Y7WfmXial1z1M5vChQs0GFjQYZ00F2TkQf3ae pHf++FEOxwCnYJEVu+Tx33lbfnMdWe8eEHg5snCkozWHGapgJtuEjNLBVmQj+2xu1b Trhio9712ZGLNR7t9vJwOWmWRS5VC8t55I582SbGOeXpxHgJM81NaN47+dYz+lK1yK Q3wciFbQwXzYA== From: cel@kernel.org To: Cc: Chuck Lever Subject: [PATCH v2 07/12] update_ssh_config: make Include directive follow ssh config directory Date: Wed, 5 Feb 2025 10:52:47 -0500 Message-ID: <20250205155252.1317763-8-cel@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250205155252.1317763-1-cel@kernel.org> References: <20250205155252.1317763-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever The file containing the kdevops target node entries needs to be placed in the same directory as the controller's .ssh/config. Usually that's ~/.ssh/config, but there is a Kconfig setting that can change that. XXX: Actually, to make this work 100% correctly, "make mrproper" should remove the ssh Include directive. That way a user can modify the ssh config via "make menuconfig", then do a "make" to get the updated include path added into her .ssh/config. Signed-off-by: Chuck Lever --- .../roles/update_ssh_config/tasks/main.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/playbooks/roles/update_ssh_config/tasks/main.yml b/playbooks/roles/update_ssh_config/tasks/main.yml index 417781936f7f..72c5f2e365f5 100644 --- a/playbooks/roles/update_ssh_config/tasks/main.yml +++ b/playbooks/roles/update_ssh_config/tasks/main.yml @@ -5,18 +5,7 @@ path: "{{ sshconfig }}" register: ssh_config -- name: Check that the kdevops Include directive is present - tags: deps - ansible.builtin.lineinfile: - path: "{{ sshconfig }}" - regexp: "Include ~/.ssh/config_kdevops_*" - state: absent - check_mode: true - changed_when: false - register: kdevops_ssh_include - when: ssh_config.stat.exists - -- name: Check that the Include directive has a kdevops_version comment +- name: Check for a kdevops_version comment tags: deps ansible.builtin.lineinfile: path: "{{ sshconfig }}" @@ -34,10 +23,9 @@ ansible.builtin.meta: end_play when: - ssh_config.stat.exists - - kdevops_ssh_include.found - fixed_ssh_entry.found -- name: Remove the stale Include directive +- name: Remove any stale Include directives tags: deps ansible.builtin.lineinfile: path: "{{ sshconfig }}" @@ -73,4 +61,4 @@ create: true mode: "u=rw,g=r,o=r" block: | - Include ~/.ssh/config_kdevops_* + Include {{ sshdir }}/config_kdevops_*