summaryrefslogtreecommitdiff
path: root/contrib/cirrus/packer
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cirrus/packer')
-rw-r--r--contrib/cirrus/packer/cloud-init/fedora/cloud-init.service20
-rw-r--r--contrib/cirrus/packer/fedora_base-setup.sh8
-rw-r--r--contrib/cirrus/packer/libpod_base_images.yml6
-rw-r--r--contrib/cirrus/packer/libpod_images.yml4
4 files changed, 32 insertions, 6 deletions
diff --git a/contrib/cirrus/packer/cloud-init/fedora/cloud-init.service b/contrib/cirrus/packer/cloud-init/fedora/cloud-init.service
new file mode 100644
index 000000000..4d2197d87
--- /dev/null
+++ b/contrib/cirrus/packer/cloud-init/fedora/cloud-init.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Initial cloud-init job (metadata service crawler)
+DefaultDependencies=no
+Wants=cloud-init-local.service
+After=cloud-init-local.service
+Wants=google-network-daemon.service
+After=google-network-daemon.service
+Before=systemd-user-sessions.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/cloud-init init
+RemainAfterExit=yes
+TimeoutSec=0
+
+# Output needs to appear in instance console output
+StandardOutput=journal+console
+
+[Install]
+WantedBy=cloud-init.target
diff --git a/contrib/cirrus/packer/fedora_base-setup.sh b/contrib/cirrus/packer/fedora_base-setup.sh
index 2e6d3eceb..a425b2b57 100644
--- a/contrib/cirrus/packer/fedora_base-setup.sh
+++ b/contrib/cirrus/packer/fedora_base-setup.sh
@@ -16,11 +16,17 @@ echo "Updating packages"
ooe.sh dnf -y update
echo "Installing necessary packages and google services"
-ooe.sh dnf -y install rng-tools google-compute-engine-tools google-compute-engine-oslogin
+ooe.sh dnf -y install rng-tools google-compute-engine-tools google-compute-engine-oslogin ethtool
echo "Enabling services"
ooe.sh systemctl enable rngd
+# There is a race that can happen on boot between the GCE services configuring
+# the VM, and cloud-init trying to do similar activities. Use a customized
+# unit file to make sure cloud-init starts after the google-compute-* services.
+echo "Setting cloud-init service to start after google-network-daemon.service"
+cp -v $GOSRC/$PACKER_BASE/cloud-init/fedora/cloud-init.service /etc/systemd/system/
+
rh_finalize
echo "SUCCESS!"
diff --git a/contrib/cirrus/packer/libpod_base_images.yml b/contrib/cirrus/packer/libpod_base_images.yml
index 560cb321c..e519d2fba 100644
--- a/contrib/cirrus/packer/libpod_base_images.yml
+++ b/contrib/cirrus/packer/libpod_base_images.yml
@@ -78,7 +78,7 @@ builders:
ssh_username: 'root'
- <<: *nested_virt
- name: 'prior-fedora'
+ name: 'prior_fedora'
iso_url: '{{user `PRIOR_FEDORA_IMAGE_URL`}}'
iso_checksum_url: '{{user `PRIOR_FEDORA_CSUM_URL`}}'
@@ -121,7 +121,7 @@ provisioners:
post-processors:
- - type: "compress"
- only: ['fedora', 'prior-fedora']
+ only: ['fedora', 'prior_fedora']
output: '/tmp/{{build_name}}/disk.raw.tar.gz'
format: '.tar.gz'
compression_level: 9
@@ -136,7 +136,7 @@ post-processors:
image_description: 'Based on {{user `FEDORA_IMAGE_URL`}}'
image_family: '{{user `FEDORA_BASE_IMAGE_NAME`}}'
- <<: *gcp_import
- only: ['prior-fedora']
+ only: ['prior_fedora']
image_name: "{{user `PRIOR_FEDORA_BASE_IMAGE_NAME`}}-{{user `TIMESTAMP`}}"
image_description: 'Based on {{user `PRIOR_FEDORA_IMAGE_URL`}}'
image_family: '{{user `PRIOR_FEDORA_BASE_IMAGE_NAME`}}'
diff --git a/contrib/cirrus/packer/libpod_images.yml b/contrib/cirrus/packer/libpod_images.yml
index 34d4db7fb..c25da25ac 100644
--- a/contrib/cirrus/packer/libpod_images.yml
+++ b/contrib/cirrus/packer/libpod_images.yml
@@ -55,11 +55,11 @@ builders:
# v----- is a YAML alias, allows partial re-use of the anchor object
- <<: *gce_hosted_image
- name: 'fedora-29'
+ name: 'fedora-30'
source_image: '{{user `FEDORA_BASE_IMAGE`}}'
- <<: *gce_hosted_image
- name: 'fedora-28'
+ name: 'fedora-29'
source_image: '{{user `PRIOR_FEDORA_BASE_IMAGE`}}'
# The brains of the operation, making actual modifications to the base-image.