From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9EA0317B506 for ; Mon, 28 Jul 2025 01:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753665278; cv=none; b=ld2BMGmWSJu0eYU1/GzeUk80nC1WzRYW5vqZRCF+vqTY22yafuV4v74BlzqiO/MPL82as2ARLALoBDCOhF/hOLntdlOzIuqOGOXLtwbCj4WnxKDbJoVpOKsQm+amnwvbaZYGomzFzcvjL4KJ2sZiNi6Do8ekVveDG8rQgp55oUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753665278; c=relaxed/simple; bh=hUIV519ssR1zWSg8V0Dx8SkS26I5qq28hFRpQ/qeUDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WN4Yy7KQK1ho/n0vRo40aXHxus9un72d9xOUWdrBjrpUBp3sNSy/nD+LCzhA1fHa6ryyfNRTopXLzNApCmIuKhL5aXyX/9QTrYhGQf0QhI/CnQp1hg97SVnoTs9gBkDfhOFzF9bfDO145xy+1PCZZzrJxk0IiQGQivZkQeS9qT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=lV2TF6mD; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="lV2TF6mD" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=tBPlB1b+pId+v/g69FiepP+HkjHUfa9Poya/Oek/Euc=; b=lV2TF6mD1cS0nWAYh8S+l8SSRg rUvB34HA+OzC1Wo2jbjemlVROLms+jhd139Bc2eshBfGDyWbltDVkPkXM0Ed52gB7duQIS10wE2zu O+yCiuKBSrOMkC4ahIG6nCBFILy8HuE+gD8Rg+aMo0PtCEYXleiSL/7t25BCERcAhGmqmufXer087 Z9nd3HS4MJYfmCAqTmE1jcfvKAEWNXymR4LU2xscKAiFnv4tb/tOK+6Jb4JbOD8/v7t/7swOf9rTk LGTmnmbbJZQ2tqfVIli2FWVAVdchJSAxDd3e/AL8wCGUhmim3W+W6GtIOkRTQVduOzoyrQXIqe/yT zksZ92+g==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugCRn-0000000DPjb-3ugf; Mon, 28 Jul 2025 01:14:35 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Chuck Lever Subject: [PATCH v2 12/33] terraform: Remove "delegate_to: localhost" Date: Sun, 27 Jul 2025 18:14:12 -0700 Message-ID: <20250728011434.3197091-13-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250728011434.3197091-1-mcgrof@kernel.org> References: <20250728011434.3197091-1-mcgrof@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 Sender: Luis Chamberlain From: Chuck Lever Refactor: All tasks in this playbook execute only on the controller. This enables the role definition and Makefile to be simplified. Signed-off-by: Chuck Lever --- playbooks/roles/terraform/tasks/main.yml | 6 ------ playbooks/terraform.yml | 3 ++- scripts/terraform.Makefile | 6 +++--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/playbooks/roles/terraform/tasks/main.yml b/playbooks/roles/terraform/tasks/main.yml index b50b417d..b7ae0f0a 100644 --- a/playbooks/roles/terraform/tasks/main.yml +++ b/playbooks/roles/terraform/tasks/main.yml @@ -8,8 +8,6 @@ - bringup - name: Retrieve the controller_ip_map from terraform - delegate_to: localhost - run_once: true cloud.terraform.terraform_output: format: json name: controller_ip_map @@ -19,8 +17,6 @@ - ssh - name: Add each target node's ssh Host entry on the control host - delegate_to: localhost - run_once: true ansible.builtin.blockinfile: block: "{{ lookup('template', 'ssh_config.j2') }}" create: true @@ -33,8 +29,6 @@ - ssh - name: Ensure the Include directive is present on the controller - delegate_to: localhost - run_once: true ansible.builtin.blockinfile: path: "{{ sshconfig }}" insertbefore: BOF diff --git a/playbooks/terraform.yml b/playbooks/terraform.yml index 15872a61..61dc76c2 100644 --- a/playbooks/terraform.yml +++ b/playbooks/terraform.yml @@ -1,6 +1,7 @@ --- - name: Provision target nodes with terraform gather_facts: false - hosts: all + connection: local + hosts: localhost roles: - role: terraform diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile index f2f6fe0a..adfd359c 100644 --- a/scripts/terraform.Makefile +++ b/scripts/terraform.Makefile @@ -101,13 +101,13 @@ ANSIBLE_EXTRA_ARGS += $(TERRAFORM_EXTRA_VARS) bringup_terraform: $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ - --connection=local --inventory localhost, \ + --inventory localhost, \ playbooks/terraform.yml --tags bringup \ --extra-vars=@./extra_vars.yaml $(KDEVOPS_PROVISIONED_SSH): $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ - -i $(KDEVOPS_HOSTFILE) \ + --inventory localhost, \ playbooks/terraform.yml --tags ssh \ --extra-vars=@./extra_vars.yaml $(Q)ansible $(ANSIBLE_VERBOSE) -i hosts all -m wait_for_connection @@ -118,7 +118,7 @@ status_terraform: destroy_terraform: $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ - --connection=local --inventory localhost, \ + --inventory localhost, \ playbooks/terraform.yml --tags destroy \ --extra-vars=@./extra_vars.yaml $(Q)rm -f $(KDEVOPS_PROVISIONED_SSH) $(KDEVOPS_PROVISIONED_DEVCONFIG) -- 2.47.2