[PATCH 4/4] terraform: remove redundant ansible inventory and connection overrides

Daniel Gomez <[email protected]>
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

Remove unnecessary --inventory localhost, and connection: local
parameters and embrace the ansible.cfg and playbook hosts fields.

Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 playbooks/gen_tfvars.yml   | 1 -
 playbooks/terraform.yml    | 1 -
 scripts/terraform.Makefile | 7 +------
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/playbooks/gen_tfvars.yml b/playbooks/gen_tfvars.yml
index 11437fa2..9d75c868 100644
--- a/playbooks/gen_tfvars.yml
+++ b/playbooks/gen_tfvars.yml
@@ -1,6 +1,5 @@
 ---
 - name: Generate Terraform variables file (terraform/terraform.tfvars)
-  connection: local
   hosts: localhost
   roles:
     - role: gen_tfvars
diff --git a/playbooks/terraform.yml b/playbooks/terraform.yml
index a740f79f..61a16a2c 100644
--- a/playbooks/terraform.yml
+++ b/playbooks/terraform.yml
@@ -1,6 +1,5 @@
 ---
 - name: Manage infrastructure lifecycle and SSH access with Terraform
-  connection: local
   hosts: localhost
   gather_facts: false
   roles:
diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 4d738c82..ef11e0e3 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -203,23 +203,20 @@ endif
 
 bringup_terraform: lambdalabs-ssh-check
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
-		--inventory localhost, \
 		playbooks/terraform.yml --tags bringup \
 		--extra-vars=@./extra_vars.yaml
 
 $(KDEVOPS_PROVISIONED_SSH):
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
-		--inventory localhost, \
 		playbooks/terraform.yml --tags ssh \
 		--extra-vars=@./extra_vars.yaml
 	$(Q)ansible $(ANSIBLE_VERBOSE) \
-		-i hosts baseline:dev:service \
+		baseline:dev:service \
 		-m wait_for_connection
 	$(Q)touch $(KDEVOPS_PROVISIONED_SSH)
 
 status_terraform:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
-		--inventory localhost, \
 		playbooks/terraform.yml --tags status \
 		--extra-vars=@./extra_vars.yaml
 
@@ -227,13 +224,11 @@ destroy_terraform: destroy_terraform_base lambdalabs-ssh-clean-after
 
 destroy_terraform_base:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
-		--inventory localhost, \
 		playbooks/terraform.yml --tags destroy \
 		--extra-vars=@./extra_vars.yaml
 	$(Q)rm -f $(KDEVOPS_PROVISIONED_SSH) $(KDEVOPS_PROVISIONED_DEVCONFIG)
 
 $(KDEVOPS_TFVARS): $(KDEVOPS_TFVARS_TEMPLATE) .config
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
-		--inventory localhost, \
 		$(KDEVOPS_PLAYBOOKS_DIR)/gen_tfvars.yml \
 		--extra-vars=@./extra_vars.yaml

-- 
2.50.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.