Skip to content

Commit

Permalink
Fix systemd unit files
Browse files Browse the repository at this point in the history
  • Loading branch information
bpradipt committed Jul 15, 2022
1 parent 1cfc9eb commit ca7249c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions aws/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ UMOCI_REPO = https://github.com/opencontainers/umoci
build: $(IMAGE_FILE)

$(IMAGE_FILE): $(BINARIES) $(FILES)
mkdir -p toupload
packer build -var vpc_id=${VPC_ID} \
-var subnet_id=${SUBNET_ID} \
-var account_id=${ACCOUNT_ID} \
-var region=${REGION} \
-var instance_type=${INSTANCE_TYPE} \
-var ami_name=peer-pods-ami-${UUID} .
rm -fr toupload

$(AGENT_PROTOCOL_FORWARDER): force
cd "$(AGENT_PROTOCOL_FORWARDER_SRC)" && $(MAKE) agent-protocol-forwarder
Expand Down
13 changes: 12 additions & 1 deletion aws/image/aws-ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,23 @@ build {
sources = [
"source.amazon-ebs.ubuntu"
]

provisioner "shell-local" {
command = "tar cf toupload/files.tar files"
}

provisioner "file" {
source = "./files"
source = "./toupload"
destination = "/tmp/"
}

provisioner "shell" {
inline = [
"cd /tmp && tar xf toupload/files.tar",
"rm toupload/files.tar"
]
}

provisioner "file" {
source = "copy-files.sh"
destination = "~/copy-files.sh"
Expand Down
7 changes: 3 additions & 4 deletions aws/image/copy-files.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
sudo mkdir -p /etc/containers
sudo cp -r /tmp/files/etc/containers/* /etc/containers/
sudo cp -r /tmp/files/etc/systemd/* /etc/systemd/
sudo cp -a /tmp/files/etc/containers/* /etc/containers/
sudo cp -a /tmp/files/etc/systemd/* /etc/systemd/


sudo mkdir -p /usr/local/bin
sudo cp -r /tmp/files/usr/* /usr/

sudo cp -a /tmp/files/usr/* /usr/

0 comments on commit ca7249c

Please sign in to comment.