Skip to content

Commit 98a87b5

Browse files
committed
chore: further ami build things
1 parent c7696d3 commit 98a87b5

File tree

11 files changed

+309
-92
lines changed

11 files changed

+309
-92
lines changed

Dockerfile-kubevirt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
FROM scratch
2-
ADD --chown=107:107 focal.img /disk/focal.qcow2
2+
ADD --chown=107:107 focal-raw.img /disk/focal.qcow2

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ disk/focal-raw.img: output-cloudimg/packer-cloudimg
1313
sudo qemu-img convert -O raw output-cloudimg/packer-cloudimg disk/focal-raw.img
1414

1515
container-disk-image: disk/focal-raw.img
16-
sudo nerdctl build . -t supabase-postgres-test:$(GIT_SHA) --namespace k8s.io -f ./Dockerfile-kubevirt
16+
docker build . -t supabase-postgres-test:$(GIT_SHA) -f ./Dockerfile-kubevirt
1717

1818
host-disk: disk/focal-raw.img
1919
sudo chown 107 -R disk

amazon-arm64-nix.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ build {
264264
]
265265
use_env_var_file = true
266266
script = "ebssurrogate/scripts/surrogate-bootstrap-nix.sh"
267-
execute_command = "sudo -S sh -c '. {{.EnvVarFile}} && {{.Path}}'"
267+
execute_command = "sudo -S sh -c '. {{.EnvVarFile}} && cd /tmp/ansible-playbook && {{.Path}}'"
268268
start_retry_timeout = "5m"
269269
skip_clean = true
270270
}

ansible/files/permission_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,4 @@ def main():
223223

224224

225225
if __name__ == "__main__":
226-
main()
226+
main()

ansible/playbook.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- hosts: localhost
1+
- hosts: all
22
become: yes
33

44
pre_tasks:
@@ -142,6 +142,18 @@
142142
import_tasks: tasks/setup-fail2ban.yml
143143
when: debpkg_mode or nixpkg_mode
144144

145+
146+
# Install EC2 instance connect
147+
# Only for AWS images
148+
- name: install EC2 instance connect
149+
become: yes
150+
apt:
151+
pkg:
152+
- ec2-instance-connect
153+
tags:
154+
- aws-only
155+
when: qemu_mode is undefined
156+
145157
# Install this at the end to prevent it from kicking in during the apt process, causing conflicts
146158
- name: Install security tools
147159
become: yes

ansible/tasks/setup-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
shell: |
242242
mkdir -p /run/postgresql
243243
chown -R postgres:postgres /run/postgresql
244-
when: stage2_nix
244+
when: stage2_nix and qemu_mode
245245

246246
- name: Restart Postgres Database without Systemd
247247
become: yes

ebssurrogate/scripts/qemu-bootstrap-nix.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ EOF
7272
locale-gen en_US.UTF-8
7373
}
7474

75+
sed -i 's/- hosts: all/- hosts: localhost/' ansible/playbook.yml
76+
7577
waitfor_boot_finished
7678
install_packages
7779
setup_postgesql_env
@@ -92,7 +94,6 @@ function execute_stage2_playbook {
9294
[defaults]
9395
callbacks_enabled = timer, profile_tasks, profile_roles
9496
EOF
95-
# sed -i 's/- hosts: all/- hosts: localhost/' /tmp/ansible-playbook/ansible/playbook.yml
9697
# Run Ansible playbook
9798
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/tmp
9899
ansible-playbook ./ansible/playbook.yml \

0 commit comments

Comments
 (0)