Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/packer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
- name: prepare ansible config
run: docker compose exec -T bambictf sh -c 'cp ansible/config_bambi.yml.sample ansible/config_bambi.yml'
- name: build packer image
run: docker compose exec -T bambictf sh -c 'cd packer; packer build ${{ matrix.image }}.json'
run: docker compose exec -T bambictf sh -c 'cd packer; packer init ${{ matrix.image }}.pkr.hcl; packer build ${{ matrix.image }}.pkr.hcl'

terraform-apply:
runs-on: ubuntu-latest
Expand Down
43 changes: 43 additions & 0 deletions packer/bambichecker.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
packer {
required_plugins {
hcloud = {
version = ">= 1.0.0"
source = "github.com/hetznercloud/hcloud"
}
}
}

locals {
snapshot_timestamp = timestamp()
}

source "hcloud" "bambichecker" {
image = "ubuntu-24.04"
location = "fsn1"
server_type = "cx22"
ssh_username = "root"
snapshot_name = "bambichecker-${local.snapshot_timestamp}"
snapshot_labels = {
type = "bambichecker"
}
temporary_key_pair_type = "ecdsa"
}

build {
name = "bambichecker"

sources = [
"source.hcloud.bambichecker"
]

provisioner "ansible" {
playbook_file = "../ansible/bambichecker.yml"
host_alias = "packer-checker"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True"
]
extra_arguments = [
"--scp-extra-args", "'-O'"
]
}
}
43 changes: 43 additions & 0 deletions packer/bambielk.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
packer {
required_plugins {
hcloud = {
version = ">= 1.0.0"
source = "github.com/hetznercloud/hcloud"
}
}
}

locals {
snapshot_timestamp = timestamp()
}

source "hcloud" "bambielk" {
image = "ubuntu-24.04"
location = "fsn1"
server_type = "cx22"
ssh_username = "root"
snapshot_name = "bambielk-${local.snapshot_timestamp}"
snapshot_labels = {
type = "bambielk"
}
temporary_key_pair_type = "ecdsa"
}

build {
name = "bambielk"

sources = [
"source.hcloud.bambielk"
]

provisioner "ansible" {
playbook_file = "../ansible/bambielk.yml"
host_alias = "packer-elk"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True"
]
extra_arguments = [
"--scp-extra-args", "'-O'"
]
}
}
43 changes: 43 additions & 0 deletions packer/bambiengine.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
packer {
required_plugins {
hcloud = {
version = ">= 1.0.0"
source = "github.com/hetznercloud/hcloud"
}
}
}

locals {
snapshot_timestamp = timestamp()
}

source "hcloud" "bambiengine" {
image = "ubuntu-24.04"
location = "fsn1"
server_type = "cx22"
ssh_username = "root"
snapshot_name = "bambiengine-${local.snapshot_timestamp}"
snapshot_labels = {
type = "bambiengine"
}
temporary_key_pair_type = "ecdsa"
}

build {
name = "bambiengine"

sources = [
"source.hcloud.bambiengine"
]

provisioner "ansible" {
playbook_file = "../ansible/bambiengine.yml"
host_alias = "packer-engine"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True"
]
extra_arguments = [
"--scp-extra-args", "'-O'"
]
}
}
43 changes: 43 additions & 0 deletions packer/bambirouter.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
packer {
required_plugins {
hcloud = {
version = ">= 1.0.0"
source = "github.com/hetznercloud/hcloud"
}
}
}

locals {
snapshot_timestamp = timestamp()
}

source "hcloud" "bambirouter" {
image = "ubuntu-24.04"
location = "fsn1"
server_type = "cx22"
ssh_username = "root"
snapshot_name = "bambirouter-${local.snapshot_timestamp}"
snapshot_labels = {
type = "bambirouter"
}
temporary_key_pair_type = "ecdsa"
}

build {
name = "bambirouter"

sources = [
"source.hcloud.bambirouter"
]

provisioner "ansible" {
playbook_file = "../ansible/bambirouter.yml"
host_alias = "packer-router"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True"
]
extra_arguments = [
"--scp-extra-args", "'-O'"
]
}
}
43 changes: 43 additions & 0 deletions packer/bambivulnbox.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
packer {
required_plugins {
hcloud = {
version = ">= 1.0.0"
source = "github.com/hetznercloud/hcloud"
}
}
}

locals {
snapshot_timestamp = timestamp()
}

source "hcloud" "bambivulnbox" {
image = "ubuntu-24.04"
location = "fsn1"
server_type = "cx32"
ssh_username = "root"
snapshot_name = "bambivulnbox-${local.snapshot_timestamp}"
snapshot_labels = {
type = "bambivulnbox"
}
temporary_key_pair_type = "ecdsa"
}

build {
name = "bambivulnbox"

sources = [
"source.hcloud.bambivulnbox"
]

provisioner "ansible" {
playbook_file = "../ansible/bambivulnbox.yml"
host_alias = "packer-vulnbox"
extra_arguments = [
"--scp-extra-args", "'-O'"
]
ansible_env_vars = [
"ANSIBLE_PIPELINING=True"
]
}
}