summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Janczyk2024-04-18 16:59:46 +0200
committerMichael Janczyk2024-04-18 16:59:46 +0200
commitec0d3a1b2e5cd379d2f6658542c84ae317ac9b99 (patch)
tree49128329cda3ab9e28a2e5a1d0162bc267b913b8
parentMakefile: remove white space in variable. (diff)
downloadpacker-templates-ec0d3a1b2e5cd379d2f6658542c84ae317ac9b99.tar.gz
packer-templates-ec0d3a1b2e5cd379d2f6658542c84ae317ac9b99.tar.xz
packer-templates-ec0d3a1b2e5cd379d2f6658542c84ae317ac9b99.zip
Makefile ansible extra arguments great again.
-rw-r--r--Makefile7
-rw-r--r--flavor.pkr.hcl2
-rw-r--r--variables.pkr.hcl4
3 files changed, 3 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index b06d7d9..ed88a4e 100644
--- a/Makefile
+++ b/Makefile
@@ -55,10 +55,6 @@ CURBOOTTARGETS := $(foreach p, $(REPROVTARGETS), $(p)/boot)
BASERMTARGETS := $(foreach t, $(BASETARGETS), rm/$(t))
PROVRMTARGETS := $(foreach t, $(REPROVTARGETS), rm/$(t))
-ifndef ANSIBLE_PROV_EXTRA_ARGS
- ANSIBLE_PROV_EXTRA_ARGS :=
-endif
-
ifdef DEBUG
VERBOSE := 1
ifeq ($(DEBUG),STEP)
@@ -151,7 +147,6 @@ $(PROVTARGETS) $(REPROVTARGETS):
-var output_directory=$(BUILD_DIR)/image \
-var playbook_file=$(BUILD_DIR)/$(ANSIBLE_DIR_PROV)/setup-$(FLAVOR).yml \
-var vm_name=$(@D)-$(FLAVOR) \
- -var extra_ansible_args=$(ANSIBLE_PROV_EXTRA_ARGS) \
./
$(HASHER) $(BUILD_DIR)/image/$(@D)-$(FLAVOR) \
>$(BUILD_DIR)/image/CHECKSUM
@@ -182,8 +177,6 @@ $(BOOTTARGETS) $(CURBOOTTARGETS):
-var output_directory=$(BUILD_DIR)/tmp \
-var playbook_file=$(ANSIBLE_DIR_BOOT)/slx-builder.yml \
-var vm_name=$(BASE)-$(FLAVOR).tmp \
- -var extra_ansible_args=-t,install,-t,build \
- -var extra_ansible_args=$(ANSIBLE_PROV_EXTRA_ARGS) \
./
@mkdir -p $(BUILD_DIR)/boot
@mv -f $(ANSIBLE_DIR_BOOT)/boot_files/* $(BUILD_DIR)/boot
diff --git a/flavor.pkr.hcl b/flavor.pkr.hcl
index 974bf32..34c0b2b 100644
--- a/flavor.pkr.hcl
+++ b/flavor.pkr.hcl
@@ -20,7 +20,7 @@ build {
sources = ["source.qemu.ansible"]
provisioner "ansible" {
- extra_arguments = ["--ssh-extra-args", "-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa", "--scp-extra-args", "\"-O\""]
+ extra_arguments = ["--ssh-extra-args", "-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa", "--scp-extra-args", "\"-O\"", "${var.ansible_extra_arguments}"]
playbook_file = "${var.playbook_file}"
sftp_command = "/usr/libexec/openssh/sftp-server"
use_sftp = false
diff --git a/variables.pkr.hcl b/variables.pkr.hcl
index 1c49a48..fb563f5 100644
--- a/variables.pkr.hcl
+++ b/variables.pkr.hcl
@@ -38,9 +38,9 @@ variable "disk_size" {
default = "20G"
}
-variable "extra_ansible_args" {
+variable "ansible_extra_arguments" {
type = string
- default = null
+ default = "-v"
}
variable "format" {