Update cloudinit.sh file to cloudinit 20.X

Bring configuration in line with the latest Cloud init verison. Tested under 20.1.

Mainly done due to `debconf_selections` not working with the old syntac.
See the `debconf_selections` item under https://cloudinit.readthedocs.io/en/latest/topics/modules.html#apt-configure

Changes include:
- reboot when apt deems it necessary,
- define update and upgrade with the package syntax,
- bring apt sources and keys inline with apt syntax and
- dynamically get the right release by using the var '$RELEASE'.

[ci skip]
This commit is contained in:
Roland van Laar authored and GitHub committed 2020-06-14 00:38:08 +02:00
1 parent a8008b8d33
commit 12e2b22ea8
1 file changed
+14 -14
+14 -14
View File
@@ -43,10 +43,11 @@ server:
```yaml ```yaml
#cloud-config #cloud-config
apt_upgrade: true
apt_sources: apt:
- source: "deb https://packagecloud.io/dokku/dokku/ubuntu/ focal main" sources:
source_dokku:
source: 'deb https://packagecloud.io/dokku/dokku/ubuntu/ $RELEASE main'
key: | key: |
-----BEGIN PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux) Version: GnuPG v1.4.11 (GNU/Linux)
@@ -112,8 +113,8 @@ apt_sources:
9mVAREENSiAuc4P93l8TtrN1bAqXaTX5oz+lepqWmHWvY+RiNiw= 9mVAREENSiAuc4P93l8TtrN1bAqXaTX5oz+lepqWmHWvY+RiNiw=
=laU4 =laU4
-----END PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----
filename: dokku.list source_docker:
- source: "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" source: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu $RELEASE stable'
key: | key: |
-----BEGIN PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK-----
@@ -177,21 +178,20 @@ apt_sources:
YT90qFF93M3v01BbxP+EIY2/9tiIPbrd YT90qFF93M3v01BbxP+EIY2/9tiIPbrd
=0YYh =0YYh
-----END PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----
filename: docker.list
package_upgrade: true debconf_selections:
web: dokku dokku/web_config boolean false
debconf_selections: | vhost: dokku dokku/vhost_enable boolean true
dokku dokku/web_config boolean false
dokku dokku/vhost_enable boolean true
# set the domain name of the new Dokku server # set the domain name of the new Dokku server
dokku dokku/hostname string $YOUR_FULL_QUALIFIED_DOMAIN hostname: dokku dokku/hostname string $YOUR_FULL_QUALIFIED_DOMAIN
# this copies over the public SSH key assigned to the server # this copies over the public SSH key assigned to the server
dokku dokku/key_file string /home/ubuntu/.ssh/authorized_keys key: dokku dokku/key_file string /home/ubuntu/.ssh/authorized_keys
packages: packages:
- dokku - dokku
package_update: true
package_upgrade: true
package_reboot_if_required: true
``` ```
Shortly after running the create command you will get a confirmation that the Shortly after running the create command you will get a confirmation that the