aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDermot Bradley <dermot_bradley@yahoo.com>2021-09-02 03:42:18 +0100
committerAriadne Conill <ariadne@dereferenced.org>2021-09-02 15:45:03 +0000
commit9d2f65930162d4f60251cdd245a6276caaea2a0f (patch)
treeb7ada037f7e7ab3017ab4ada682d824e0bcf691d
parent3e1d7ea54b2fe4673b9d632766244593278d5b1e (diff)
downloadaports-9d2f65930162d4f60251cdd245a6276caaea2a0f.tar.gz
aports-9d2f65930162d4f60251cdd245a6276caaea2a0f.tar.bz2
aports-9d2f65930162d4f60251cdd245a6276caaea2a0f.tar.xz
community/cloud-init: upgrade to 21.3
Upgrade to 21.3 release. Add tzdata dependancy, remove e2fsprogs-extra dependancy. Add logrotate configuration file. Add cloud-init-hotplugd init.d script and simple daemon for new network hotplug functionality in this release. Remove some more unnecessary (doc) files from package. Update README.Alpine to add known issue (and solution) for SSH access with locked user accounts, and to detail how to use hotplug functionality.
-rw-r--r--community/cloud-init/03-disable-irrelevant-modules.patch10
-rw-r--r--community/cloud-init/04-hook-hotplug-sh.patch44
-rw-r--r--community/cloud-init/05-apk-upgrade.patch21
-rw-r--r--community/cloud-init/APKBUILD62
-rw-r--r--community/cloud-init/README.Alpine67
-rw-r--r--community/cloud-init/cloud-init-hotplugd14
-rw-r--r--community/cloud-init/cloud-init-hotplugd.initd11
-rw-r--r--community/cloud-init/cloud-init.logrotate6
8 files changed, 214 insertions, 21 deletions
diff --git a/community/cloud-init/03-disable-irrelevant-modules.patch b/community/cloud-init/03-disable-irrelevant-modules.patch
index ba327e49f6..87a4544fe4 100644
--- a/community/cloud-init/03-disable-irrelevant-modules.patch
+++ b/community/cloud-init/03-disable-irrelevant-modules.patch
@@ -10,17 +10,19 @@ to Alpine and which have been removed from the Alpine package.
diff -aur a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl
--- a/config/cloud.cfg.tmpl
+++ b/config/cloud.cfg.tmpl
-@@ -89,7 +89,9 @@
+@@ -105,8 +105,10 @@
- emit_upstart
- snap
{% endif %}
-+{% if variant not in ["alpine"] %}
+-{% if variant not in ["photon"] %}
++{% if variant not in ["alpine","photon"] %}
- ssh-import-id
+{% endif %}
++{% if variant not in ["photon"] %}
- locale
+ {% endif %}
- set-passwords
- {% if variant in ["rhel", "fedora"] %}
-@@ -135,8 +137,10 @@
+@@ -155,8 +157,10 @@
- chef
- mcollective
- salt-minion
diff --git a/community/cloud-init/04-hook-hotplug-sh.patch b/community/cloud-init/04-hook-hotplug-sh.patch
new file mode 100644
index 0000000000..1b3ea814fe
--- /dev/null
+++ b/community/cloud-init/04-hook-hotplug-sh.patch
@@ -0,0 +1,44 @@
+From: Dermot Bradley <dermot_bradley@yahoo.com>
+Date: Thu, 22 July 2021 00:49 +0100
+Subject: [PATCH] cloud-init: Rewrite hook-hotplug to not be Bash-specific
+
+Rewrite shellscript to not be Bash-specific
+
+---
+
+diff -aur a/tools/hook-hotplug b/tools/hook-hotplug
+--- a/tools/hook-hotplug
++++ b/tools/hook-hotplug
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # This file is part of cloud-init. See LICENSE file for license information.
+
+ # This script checks if cloud-init has hotplug hooked and if
+@@ -9,18 +9,18 @@
+ }
+
+ hotplug_enabled() {
+- [ "$(cloud-init devel hotplug-hook -s "${SUBSYSTEM}" query)" == "enabled" ]
++ [ "$(cloud-init devel hotplug-hook -s "${SUBSYSTEM}" query)" = "enabled" ]
+ }
+
+ if is_finished && hotplug_enabled; then
+ # open cloud-init's hotplug-hook fifo rw
+ exec 3<>/run/cloud-init/hook-hotplug-cmd
+- env_params=(
+- --subsystem="${SUBSYSTEM}"
+- handle
+- --devpath="${DEVPATH}"
+- --udevaction="${ACTION}"
+- )
++ env_params=" \
++ --subsystem=\"${SUBSYSTEM}\" \
++ handle \
++ --devpath=\"${DEVPATH}\" \
++ --udevaction=\"${ACTION}\" \
++ "
+ # write params to cloud-init's hotplug-hook fifo
+- echo "${env_params[@]}" >&3
++ echo "${env_params}" >&3
+ fi
diff --git a/community/cloud-init/05-apk-upgrade.patch b/community/cloud-init/05-apk-upgrade.patch
new file mode 100644
index 0000000000..e065b225df
--- /dev/null
+++ b/community/cloud-init/05-apk-upgrade.patch
@@ -0,0 +1,21 @@
+From: Dermot Bradley <dermot_bradley@yahoo.com>
+Date: Thu, 26 Aug 2021 00:58 +0100
+Subject: [PATCH] cloud-init: Adjust Alpine apk upgrade call
+
+Add "--available" to Alpine "apk upgrade" call.
+
+----
+
+diff -aur a/cloudinit/distros/alpine.py b/cloudinit/distros/alpine.py
+--- a/cloudinit/distros/alpine.py
++++ b/cloudinit/distros/alpine.py
+@@ -120,6 +120,9 @@
+ # Redirect output
+ cmd.append("--quiet")
+
++ if command == 'upgrade':
++ cmd.append("--available")
++
+ if args and isinstance(args, str):
+ cmd.append(args)
+ elif args and isinstance(args, list):
diff --git a/community/cloud-init/APKBUILD b/community/cloud-init/APKBUILD
index 359904df65..e470ad64a1 100644
--- a/community/cloud-init/APKBUILD
+++ b/community/cloud-init/APKBUILD
@@ -2,8 +2,8 @@
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
# Maintainer: Dermot Bradley <dermot_bradley@yahoo.com>
pkgname=cloud-init
-pkgver=21.2
-pkgrel=1
+pkgver=21.3
+pkgrel=0
pkgdesc="Cloud instance init scripts"
url="https://cloud-init.io"
# Dependant package "cloud-utils-growpart" is not available for mips,
@@ -13,7 +13,6 @@ license="Apache-2.0 OR GPL-3.0-only"
depends="
blkid
cloud-utils-growpart
- e2fsprogs-extra
eudev
ifupdown-ng
iproute2-minimal
@@ -31,6 +30,7 @@ depends="
sgdisk
shadow
sudo
+ tzdata
"
makedepends="py3-setuptools"
subpackages="$pkgname-doc $pkgname-bash-completion $pkgname-openrc"
@@ -38,6 +38,11 @@ source="cloud-init-$pkgver.tar.gz::https://github.com/canonical/cloud-init/archi
01-oauthlib-remove.patch
02-hosts-template-fix.patch
03-disable-irrelevant-modules.patch
+ 04-hook-hotplug-sh.patch
+ 05-apk-upgrade.patch
+ cloud-init-hotplugd
+ cloud-init-hotplugd.initd
+ cloud-init.logrotate
interfaces
setup-cloud-init
README.Alpine
@@ -73,19 +78,35 @@ package() {
"$srcdir"/interfaces \
"$pkgdir"/etc/network/
+ install -m755 \
+ -D \
+ "$srcdir"/cloud-init-hotplugd.initd \
+ "$pkgdir"/etc/init.d/cloud-init-hotplugd
+
+ install -m644 \
+ -D \
+ "$srcdir"/cloud-init.logrotate \
+ "$pkgdir"/etc/logrotate.d/cloud-init
+
mkdir -p \
"$pkgdir"/sbin
install -m755 \
"$srcdir"/setup-cloud-init \
"$pkgdir"/sbin/
+ mkdir -p \
+ "$pkgdir"/usr/sbin
+ install -m755 \
+ "$srcdir"/cloud-init-hotplugd \
+ "$pkgdir"/usr/sbin/
+
install -m644 \
"$srcdir"/README.Alpine \
"$pkgdir"/usr/share/doc/"$pkgname"/
# Delete non-Alpine distribution template files
for distro in \
- debian fedora freebsd opensuse redhat rhel sles suse ubuntu
+ debian fedora freebsd opensuse photon redhat rhel sles suse ubuntu
do
for file in \
"$pkgdir"/etc/cloud/templates/*."$distro".tmpl
@@ -94,6 +115,11 @@ package() {
done
done
+ # Delete systemd template files
+ rm \
+ "$pkgdir"/etc/cloud/templates/timesyncd.conf.tmpl \
+ "$pkgdir"/etc/cloud/templates/systemd.resolved.conf.tmpl
+
# Delete cloud-init modules not relevant to Alpine
for module in \
cc_apt_*.py \
@@ -116,14 +142,32 @@ package() {
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/config/$module
done
- # Delete systemd template file
- rm "$pkgdir"/etc/cloud/templates/timesyncd.conf.tmpl
+ # Delete cloud-init docs not relevant to Alpine
+ for doc in \
+ cloud-config-add-apt-repos.txt \
+ cloud-config-apt.txt \
+ cloud-config-landscape.txt \
+ cloud-config-rh_subscription.txt \
+ cloud-config-update-apt.txt \
+ cloud-config-yum-repo.txt \
+ upstart-cloud-config.txt \
+ upstart-rclocal.txt
+ do
+ rm "$pkgdir"/usr/share/doc/cloud-init/examples/$doc
+ done
}
-sha512sums="0c67fd66b60a904d2dfddab563657c7028cc0bab9d2a195ce55e092f1c8e7cc8b0da2d2436146f1a1e545483f21f5658eeea2f6b224c1a253fdf467bd2b63145 cloud-init-21.2.tar.gz
+sha512sums="
+875d163028e16a61fcc1cf5276c43784193f6054a4a90996e6c25d2af7fcd036ccda1d1b8e1fee51f96d953604d11aefaa9923a917b919bb9c9c149593547efd cloud-init-21.3.tar.gz
c14ce3b27c55d1c381e27b2898bb73da8a74c53480d496bdfc87318b69fb612678205ab5a686c1ce703ef5c2c7a8529f629c8f908aeff39524d36870a83c1929 01-oauthlib-remove.patch
444b15f0d81138f7f3767bc10b0bee29ff10fa8b74dfc3542e1abe20d745f09bb2e36cb30ef8035a677ba81af80743207fbd9973d7cb4f33ca37891ae7493916 02-hosts-template-fix.patch
-bf6da0948f655ced970f97036db9df4d4027deb0fe2a6575b7d68ddefc3b474948b31edd0f3fb2aa6c8eba07466634bc5b7c948d12eb687fe852761c15485f35 03-disable-irrelevant-modules.patch
+0efbd2b6f0ec4087938e8574d0b78f1b33605e61294159ea74118d1a583380e38c06ee5fd5fb54e8d64259b6b799d95677ec846eff1296a0ab71d76c7ca06d77 03-disable-irrelevant-modules.patch
+3e3f3710d45e6525fd3537afef66c0006892d740bd84ce6052da298f5179170d2f35e43071499cf84fd9646ef8e7a21e2bd0829ce390691eb5db04fb32cc584d 04-hook-hotplug-sh.patch
+fd3819625f10157e6a88d3c68402864ff29a659bc63535d182086c3b36294f3362770fa8ee9deb77621f92d39b9640d14d0ce910c3bb5924c104931a2fd23540 05-apk-upgrade.patch
+2d41ec3c43f3a426b3c59526dbd34e4a6dd73c894dfe4b699a0f302c12cef3eab6c9300eb126010d00310a12843f56e49d0b1a088f320890d51fb905c3375bb7 cloud-init.logrotate
+2d7b80fc248ec18f20c4ed2fbe0f8d6ea85ae57a0ece8ecf8a095cf910c576807c19ab0453c00160b85253df5725cba90abec731cb54f441a509611115519b46 cloud-init-hotplugd
+ab44fc51979a5da8569b08ed2f290a6610de6c36cf147af20f30e9224847623d3594c056a1f64c614598ac130e9bec92d566fb901024f806b768a89190c45f59 cloud-init-hotplugd.initd
48b25ec4457c2b3772a7d210033551d041749a0d1869818d888030e6df7fd9bbc13a38b95cf465de3d46d96881a722f94a337584ce48f280c4a52b819586563a interfaces
f32b90f26d1df0d88fbea7a1a9ab6704a20babdb750b933484bb7c4e91cc19a587d4bfbc95489a354003ecd00795d1592e71b4b93eccd41e392bb7170bfebb0e setup-cloud-init
-bb31b78e8f563d8b9d2bb896e28a51862e6479a399ac57cb69fa86f8c0704d05ec79023bd090706359259569ac1d2cc7939950be0d0490fb36c9ec396254b7de README.Alpine"
+aa3ecfb53c115996327fb04a21aa569d93e02a18918b27ad7d12738937c6ee999ea6ac2aa92e0abd0e0ea547e00fd89a600b83b5b209adcbced83c41776e7fc8 README.Alpine
+"
diff --git a/community/cloud-init/README.Alpine b/community/cloud-init/README.Alpine
index e83435796d..0799485930 100644
--- a/community/cloud-init/README.Alpine
+++ b/community/cloud-init/README.Alpine
@@ -73,11 +73,58 @@ To use Busybox as the NTP client:
as a template to create the configuration file /etc/ntp.conf.
+Network interface hotplugging
+-----------------------------
+
+Version 21.3 of cloud-init has added some support for network interface
+hotplugging, that is the addition or removal of additional network
+interfaces on an already running machine.
+
+A simple daemon (cloud-init-hotplugd) runs at boot time that listens for udev
+hotplug events and triggers cloud-init to look at them.
+
+This daemon, via its init.d script, is *not* at present enabled by the
+setup-cloud-init script as hotplug is currently *only* supported by the
+ConfigDrive, EC2, and OpenStack DataSources.
+
+In order to make use of network hotplug you will need to do the following
+*two* things:
+
+- firstly, add the /etc/init.d/cloud-init-hotplugd script to the "default"
+run-level, i.e.
+
+ rc-update add cloud-init-hotplugd default
+
+- secondly, enable hotplug for the relevant DataSource by adding the following
+to either the /etc/cloud.cfg file or else to the supplied user-data:
+
+ updates:
+ network:
+ when: ['boot','hotplug']
+
+
Known Issues
============
+Unable to SSH in as user(s) as the account(s) is/are locked
+-----------------------------------------------------------
+
+Issue: By default cloud-init will ensure that any user accounts have their
+password locked. The OpenSSH sshd daemon has logic that, when PAM is not
+enabled, for accounts with locked passwords it *also* decides to refuse
+key-based SSH logins.
+
+Solution: install the openssh-server-pam package (rather than
+openssh-server) and edit /etc/ssh/sshd_config to ensure that it defines
+"EnablePAM yes".
+
+In the future this package may add "openssh-server-pam" as a dependency but
+as it is possible some individuals may wish to use cloud-init without any
+SSH daemon installed that decision is unclear.
+
+
Missing dependencies
--------------------
@@ -124,15 +171,19 @@ The following modules should work, in general, with the defined dependencies:
cc_users_groups
cc_write_files
-If you want to create/resize filesystems other than ext2/3/4 using
-cc_disk_setup and/or cc_resizefs then you will need to install the relevant
-package(s) containing the appropriate tools:
+If you want to delete existing partitions using cc_disk_setup then you will
+need to install the Alpine "wipefs" package.
+
+If you want to create/resize filesystems using cc_disk_setup and/or
+cc_resizefs then you will need to install the relevant package(s) containing
+the appropriate tools:
- BTRFS: btrfs-progs
- F2FS: f2fs-tools
- LVM: lvm2
- XFS: xfsprogs and xfsprogs-extra
- ZFS: zfs
+ BTRFS: btrfs-progs
+ EXT2/3/4: e2fsprogs-extra
+ F2FS: f2fs-tools
+ LVM: lvm2
+ XFS: xfsprogs and xfsprogs-extra
+ ZFS: zfs
cc_ca_certs module
diff --git a/community/cloud-init/cloud-init-hotplugd b/community/cloud-init/cloud-init-hotplugd
new file mode 100644
index 0000000000..444712e78f
--- /dev/null
+++ b/community/cloud-init/cloud-init-hotplugd
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+PIPE="/run/cloud-init/hook-hotplug-cmd"
+
+mkfifo -m700 $PIPE
+
+while true; do
+ # shellcheck disable=SC2162
+ read args < $PIPE
+ # shellcheck disable=SC2086
+ exec /usr/bin/cloud-init devel hotplug-hook $args
+done
+
+exit
diff --git a/community/cloud-init/cloud-init-hotplugd.initd b/community/cloud-init/cloud-init-hotplugd.initd
new file mode 100644
index 0000000000..bdc211087c
--- /dev/null
+++ b/community/cloud-init/cloud-init-hotplugd.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+
+description="cloud-init hotplugd"
+
+pidfile="/run/$RC_SVCNAME.pid"
+command="/usr/sbin/cloud-init-hotplugd"
+command_background=yes
+
+depend() {
+ before cloud-init
+}
diff --git a/community/cloud-init/cloud-init.logrotate b/community/cloud-init/cloud-init.logrotate
new file mode 100644
index 0000000000..5418554ce4
--- /dev/null
+++ b/community/cloud-init/cloud-init.logrotate
@@ -0,0 +1,6 @@
+/var/log/cloud-init.log /var/log/cloud-init-output.log {
+ compress
+ delaycompress
+ missingok
+ notifempty
+}