From 971b5878c2699b2b48d7ab7a5e6983d90df4ce84 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 17 Jun 2011 11:13:16 -0400 Subject: 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 --- ChangeLog | 3 +++ cloudinit/CloudConfig/cc_mounts.py | 9 +++++---- doc/examples/cloud-config.txt | 7 ++++++- 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 -- cgit v1.2.3