File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
elements/cloud-init-growpart-lvm Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ =============
2
+ cloud-init-growpart-lvm
3
+ =============
4
+
5
+ This element enables growpart for OS images with LVM.
6
+ To enable this element simply include it in the elements list.
7
+
8
+ * ``DIB_CLOUD_INIT_GROWPART_DEVICES `` list of partition names that needs to be
9
+ populated in order for cloud-init to grow it. Populating it is mandatory.
10
+
11
+ Dependencies:
12
+ * ``/usr/bin/growpart `` is needed on the system in order to grow the partition.
13
+ However it is part of different packages depending on linux family. That
14
+ is already taken care of by package-installs.
Original file line number Diff line number Diff line change
1
+ pkg-map
2
+ package-installs
Original file line number Diff line number Diff line change
1
+ growpart_package :
Original file line number Diff line number Diff line change
1
+ {
2
+ "family": {
3
+ "redhat": {
4
+ "growpart_package": "cloud-utils-growpart"
5
+ },
6
+ "debian": {
7
+ "growpart_package": "cloud-guest-utils"
8
+ }
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ ${DIB_DEBUG_TRACE:- 1} -gt 0 ]; then
4
+ set -x
5
+ fi
6
+ set -euo pipefail
7
+
8
+ if [[ -n ${DIB_CLOUD_INIT_GROWPART_DEVICES} ]]; then
9
+ if [ -d /etc/cloud/cloud.cfg.d ]; then
10
+ cat > /etc/cloud/cloud.cfg.d/55-growpart-lvm.cfg << EOF
11
+ #cloud-config
12
+ growpart:
13
+ mode: auto
14
+ devices: $DIB_CLOUD_INIT_GROWPART_DEVICES
15
+ ignore_growroot_disabled: false
16
+ EOF
17
+ fi
18
+ else
19
+ echo " You must set the device list: \" $DIB_CLOUD_INIT_GROWPART_DEVICES \" ."
20
+ exit 1
21
+ fi
You can’t perform that action at this time.
0 commit comments