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 4F66E45038 for ; Mon, 28 Jul 2025 00:18:03 +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=1753661887; cv=none; b=UvE209vexqTD4n2xyYWPRp9oJrzxaALXcJIaNQj9SpYvtlKmRvTNQXQNJSbxocoD+gSwwt9U/avsj8fR/tStubQ9V0c2QPzNwcl0DO9GlDKmiJQiZcY5MSL72x95si+JvOWdJcI+ypF97FMD86u/jWkP+9OoeTz53Nl8rQgqbds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753661887; c=relaxed/simple; bh=hUIV519ssR1zWSg8V0Dx8SkS26I5qq28hFRpQ/qeUDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qNlYj7AVFtu8b+tmBBT6CDDJxtuajBZN9zG22pyljMWzmXiSooI/OexyLRoCy++9dg0sGH06eU27oIBieOUg4mVl5X8ViVM7HJOYWiwgAOthagRU1vEeIMEqXQ2nzSatlA7kyeliSbRhSn8w9jJbL+UNWLiFFNafj4HoZtaCtYE= 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=KSUeHfGj; 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="KSUeHfGj" 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=KSUeHfGjvgik9kUPYxsmuOoeOc v06QchtcBGdY6AxnuddQWb4LwnamyHUYOiBbMXblS+mB7jB0JMwcv8CxQ1Il0Br+ZTsbhBpBFxSgD J8MUXWq4UA1kslgc/JsjQb2JOWrvzd3o81Bu3Js80yr5q1Xg7B9FInYEaGCmT7jhSIlRJBDF9ky4y Fc6rQtBhVfmcuU5qhcSGR7OWciX7Tb+kl1RIG/Y0E1ZVDvKnWLv365C+SDA9YnKiYt4HFlEN2s8i9 yz6o6iuIKLP3vKyq7IGg4DAVjdCI5Qp9xgywdW1xLscCoabJr9yuwqz6wR56peJfgNqBYyYHcsu53 HOv3Ycig==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugBZ4-0000000DNWM-1hci; Mon, 28 Jul 2025 00:18:02 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Chuck Lever Subject: [PATCH 15/40] terraform: Remove "delegate_to: localhost" Date: Sun, 27 Jul 2025 17:17:34 -0700 Message-ID: <20250728001800.3188617-16-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250728001800.3188617-1-mcgrof@kernel.org> References: <20250728001800.3188617-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