summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-06-17 11:13:16 -0400
committerScott Moser <smoser@ubuntu.com>2011-06-17 11:13:16 -0400
commit971b5878c2699b2b48d7ab7a5e6983d90df4ce84 (patch)
treea1562fa8e9083e0a2d1ca2e3b502ce5bac06c6e0
parent03804622f0fa6963ddfe9fa9292b28653665365a (diff)
downloadvyos-cloud-init-971b5878c2699b2b48d7ab7a5e6983d90df4ce84.tar.gz
vyos-cloud-init-971b5878c2699b2b48d7ab7a5e6983d90df4ce84.zip
make the default "fill in" mount entries configurable. (LP: #785542)
The primary motivation for this is so that 'nobootwait' is not hard coded to appear in the fs_opts field. LP: #785542
-rw-r--r--ChangeLog3
-rw-r--r--cloudinit/CloudConfig/cc_mounts.py9
-rw-r--r--doc/examples/cloud-config.txt7
3 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e0739531..08277222 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,9 @@
and add 'no-port-forwarding,no-agent-forwarding,no-X11-forwarding'
to the default (LP: #798505)
- make 'cloud-config ready' command configurable (LP: #785551)
+ - make fstab fields used to 'fill in' shorthand entries configurable
+ This means you do not have to have 'nobootwait' in the values
+ (LP: #785542)
0.6.1:
- fix bug in fixing permission on /var/log/cloud-init.log (LP: #704509)
- improve comment strings in rsyslog file tools/21-cloudinit.conf
diff --git a/cloudinit/CloudConfig/cc_mounts.py b/cloudinit/CloudConfig/cc_mounts.py
index 8ee4f718..592a030a 100644
--- a/cloudinit/CloudConfig/cc_mounts.py
+++ b/cloudinit/CloudConfig/cc_mounts.py
@@ -32,12 +32,13 @@ def is_mdname(name):
return False
def handle(name,cfg,cloud,log,args):
- # these are our default set of mounts
- defmnts = [ [ "ephemeral0", "/mnt", "auto", "defaults,nobootwait", "0", "2" ],
- [ "swap", "none", "swap", "sw", "0", "0" ] ]
-
# fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno
defvals = [ None, None, "auto", "defaults,nobootwait", "0", "2" ]
+ defvals = cfg.get("mount_default_fields", defvals)
+
+ # these are our default set of mounts
+ defmnts = [ [ "ephemeral0", "/mnt", "auto", defvals[3], "0", "2" ],
+ [ "swap", "none", "swap", "sw", "0", "0" ] ]
cfgmnt = [ ]
if cfg.has_key("mounts"):
diff --git a/doc/examples/cloud-config.txt b/doc/examples/cloud-config.txt
index eaedabeb..edf58067 100644
--- a/doc/examples/cloud-config.txt
+++ b/doc/examples/cloud-config.txt
@@ -111,7 +111,7 @@ packages:
# written to /etc/fstab.
# - '/dev' can be ommitted for device names that begin with: xvd, sd, hd, vd
# - if an entry does not have all 6 fields, they will be filled in
-# from the following: [ None, None, "auto", "defaults,nobootwait", "0", "2" ]
+# with values from 'mount_default_fields' below.
#
# Note, that you should set 'nobootwait' (see man fstab) for volumes that may
# not be attached at instance boot (or reboot)
@@ -122,6 +122,11 @@ mounts:
- [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ]
- [ dd, /dev/zero ]
+# mount_default_fields
+# These values are used to fill in any entries in 'mounts' that are not
+# complete. This must be an array, and must have 7 fields.
+mount_default_fields: [ None, None, "auto", "defaults,nobootwait", "0", "2" ]
+
# add each entry to ~/.ssh/authorized_keys for the configured user
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEA3FSyQwBI6Z+nCSjUUk8EEAnnkhXlukKoUPND/RRClWz2s5TCzIkd3Ou5+Cyz71X0XmazM3l5WgeErvtIwQMyT1KjNoMhoJMrJnWqQPOt5Q8zWd9qG7PBl9+eiH5qV7NZ mykey@host