summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-03-07 16:27:47 -0500
committerScott Moser <smoser@ubuntu.com>2013-03-07 16:27:47 -0500
commit3199df6e1489da03d51ac8a2a4574c27fd325189 (patch)
tree921700212c063d1b468a8ea2cac4f7df0f3a68d9 /doc/examples
parent21aec9e44c27b9bf1c96314f0449fd39793d1c73 (diff)
parent8013c284e82349246b2274f5475c138323fd7c55 (diff)
downloadvyos-cloud-init-3199df6e1489da03d51ac8a2a4574c27fd325189.tar.gz
vyos-cloud-init-3199df6e1489da03d51ac8a2a4574c27fd325189.zip
merge from trunk
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/cloud-config-add-apt-repos.txt34
-rw-r--r--doc/examples/cloud-config-boot-cmds.txt15
-rw-r--r--doc/examples/cloud-config-chef.txt9
-rw-r--r--doc/examples/cloud-config-datasources.txt11
-rw-r--r--doc/examples/cloud-config-final-message.txt7
-rw-r--r--doc/examples/cloud-config-growpart.txt24
-rw-r--r--doc/examples/cloud-config-install-packages.txt15
-rw-r--r--doc/examples/cloud-config-mount-points.txt39
-rw-r--r--doc/examples/cloud-config-phone-home.txt14
-rw-r--r--doc/examples/cloud-config-power-state.txt22
-rw-r--r--doc/examples/cloud-config-resolv-conf.txt20
-rw-r--r--doc/examples/cloud-config-run-cmds.txt21
-rw-r--r--doc/examples/cloud-config-ssh-keys.txt46
-rw-r--r--doc/examples/cloud-config-update-apt.txt7
-rw-r--r--doc/examples/cloud-config-update-packages.txt8
-rw-r--r--doc/examples/cloud-config-write-files.txt6
16 files changed, 294 insertions, 4 deletions
diff --git a/doc/examples/cloud-config-add-apt-repos.txt b/doc/examples/cloud-config-add-apt-repos.txt
new file mode 100644
index 00000000..be9d5472
--- /dev/null
+++ b/doc/examples/cloud-config-add-apt-repos.txt
@@ -0,0 +1,34 @@
+#cloud-config
+
+# Add apt repositories
+#
+# Default: auto select based on cloud metadata
+# in ec2, the default is <region>.archive.ubuntu.com
+# apt_mirror:
+# use the provided mirror
+# apt_mirror_search:
+# search the list for the first mirror.
+# this is currently very limited, only verifying that
+# the mirror is dns resolvable or an IP address
+#
+# if neither apt_mirror nor apt_mirror search is set (the default)
+# then use the mirror provided by the DataSource found.
+# In EC2, that means using <region>.ec2.archive.ubuntu.com
+#
+# if no mirror is provided by the DataSource, and 'apt_mirror_search_dns' is
+# true, then search for dns names '<distro>-mirror' in each of
+# - fqdn of this host per cloud metadata
+# - localdomain
+# - no domain (which would search domains listed in /etc/resolv.conf)
+# If there is a dns entry for <distro>-mirror, then it is assumed that there
+# is a distro mirror at http://<distro>-mirror.<domain>/<distro>
+#
+# That gives the cloud provider the opportunity to set mirrors of a distro
+# up and expose them only by creating dns entries.
+#
+# if none of that is found, then the default distro mirror is used
+apt_mirror: http://us.archive.ubuntu.com/ubuntu/
+apt_mirror_search:
+ - http://local-mirror.mydomain
+ - http://archive.ubuntu.com
+apt_mirror_search_dns: False
diff --git a/doc/examples/cloud-config-boot-cmds.txt b/doc/examples/cloud-config-boot-cmds.txt
new file mode 100644
index 00000000..b281d327
--- /dev/null
+++ b/doc/examples/cloud-config-boot-cmds.txt
@@ -0,0 +1,15 @@
+#cloud-config
+
+# boot commands
+# default: none
+# this is very similar to runcmd, but commands run very early
+# in the boot process, only slightly after a 'boothook' would run.
+# bootcmd should really only be used for things that could not be
+# done later in the boot process. bootcmd is very much like
+# boothook, but possibly with more friendly.
+# * bootcmd will run on every boot
+# * the INSTANCE_ID variable will be set to the current instance id.
+# * you can use 'cloud-init-boot-per' command to help only run once
+bootcmd:
+ - echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts
+ - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ]
diff --git a/doc/examples/cloud-config-chef.txt b/doc/examples/cloud-config-chef.txt
index f87472ec..4edad653 100644
--- a/doc/examples/cloud-config-chef.txt
+++ b/doc/examples/cloud-config-chef.txt
@@ -47,9 +47,13 @@ apt_sources:
chef:
- # Valid values are 'gems' and 'packages'
+ # Valid values are 'gems' and 'packages' and 'omnibus'
install_type: "packages"
+ # Boolean: run 'install_type' code even if chef-client
+ # appears already installed.
+ force_install: false
+
# Chef settings
server_url: "https://chef.yourorg.com:4000"
@@ -80,6 +84,9 @@ chef:
maxclients: 100
keepalive: "off"
+ # if install_type is 'omnibus', change the url to download
+ omnibus_url: "https://www.opscode.com/chef/install.sh"
+
# Capture all subprocess output into a logfile
# Useful for troubleshooting cloud-init issues
diff --git a/doc/examples/cloud-config-datasources.txt b/doc/examples/cloud-config-datasources.txt
index d10dde05..fc8c22d4 100644
--- a/doc/examples/cloud-config-datasources.txt
+++ b/doc/examples/cloud-config-datasources.txt
@@ -31,3 +31,14 @@ datasource:
# <url>/user-data and <url>/meta-data
# seedfrom: http://my.example.com/i-abcde
seedfrom: None
+
+ # fs_label: the label on filesystems to be searched for NoCloud source
+ fs_label: cidata
+
+ # these are optional, but allow you to basically provide a datasource
+ # right here
+ user-data: |
+ # This is the user-data verbatum
+ meta-data:
+ instance-id: i-87018aed
+ local-hostname: myhost.internal
diff --git a/doc/examples/cloud-config-final-message.txt b/doc/examples/cloud-config-final-message.txt
new file mode 100644
index 00000000..0ce31467
--- /dev/null
+++ b/doc/examples/cloud-config-final-message.txt
@@ -0,0 +1,7 @@
+#cloud-config
+
+# final_message
+# default: cloud-init boot finished at $TIMESTAMP. Up $UPTIME seconds
+# this message is written by cloud-final when the system is finished
+# its first boot
+final_message: "The system is finally up, after $UPTIME seconds"
diff --git a/doc/examples/cloud-config-growpart.txt b/doc/examples/cloud-config-growpart.txt
new file mode 100644
index 00000000..705f02c2
--- /dev/null
+++ b/doc/examples/cloud-config-growpart.txt
@@ -0,0 +1,24 @@
+#cloud-config
+#
+# growpart entry is a dict, if it is not present at all
+# in config, then the default is used ({'mode': 'auto', 'devices': ['/']})
+#
+# mode:
+# values:
+# * auto: use any option possible (growpart or parted)
+# if none are available, do not warn, but debug.
+# * growpart: use growpart to grow partitions
+# if growpart is not available, this is an error.
+# * parted: use parted (parted resizepart) to resize partitions
+# if parted is not available, this is an error.
+# * off, false
+#
+# devices:
+# a list of things to resize.
+# items can be filesystem paths or devices (in /dev)
+# examples:
+# devices: [/, /dev/vdb1]
+#
+growpart:
+ mode: auto
+ devices: ['/']
diff --git a/doc/examples/cloud-config-install-packages.txt b/doc/examples/cloud-config-install-packages.txt
new file mode 100644
index 00000000..2edc63da
--- /dev/null
+++ b/doc/examples/cloud-config-install-packages.txt
@@ -0,0 +1,15 @@
+#cloud-config
+
+# Install additional packages on first boot
+#
+# Default: none
+#
+# if packages are specified, this apt_update will be set to true
+#
+# packages may be supplied as a single package name or as a list
+# with the format [<package>, <version>] wherein the specifc
+# package version will be installed.
+packages:
+ - pwgen
+ - pastebinit
+ - [libpython2.7, 2.7.3-0ubuntu3.1]
diff --git a/doc/examples/cloud-config-mount-points.txt b/doc/examples/cloud-config-mount-points.txt
new file mode 100644
index 00000000..416006db
--- /dev/null
+++ b/doc/examples/cloud-config-mount-points.txt
@@ -0,0 +1,39 @@
+#cloud-config
+
+# set up mount points
+# 'mounts' contains a list of lists
+# the inner list are entries for an /etc/fstab line
+# ie : [ fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno ]
+#
+# default:
+# mounts:
+# - [ ephemeral0, /mnt ]
+# - [ swap, none, swap, sw, 0, 0 ]
+#
+# in order to remove a previously listed mount (ie, one from defaults)
+# list only the fs_spec. For example, to override the default, of
+# mounting swap:
+# - [ swap ]
+# or
+# - [ swap, null ]
+#
+# - if a device does not exist at the time, an entry will still be
+# 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
+# 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)
+#
+mounts:
+ - [ ephemeral0, /mnt, auto, "defaults,noexec" ]
+ - [ sdc, /opt/data ]
+ - [ 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" ]
+
diff --git a/doc/examples/cloud-config-phone-home.txt b/doc/examples/cloud-config-phone-home.txt
new file mode 100644
index 00000000..7f2b69f7
--- /dev/null
+++ b/doc/examples/cloud-config-phone-home.txt
@@ -0,0 +1,14 @@
+#cloud-config
+
+# phone_home: if this dictionary is present, then the phone_home
+# cloud-config module will post specified data back to the given
+# url
+# default: none
+# phone_home:
+# url: http://my.foo.bar/$INSTANCE/
+# post: all
+# tries: 10
+#
+phone_home:
+ url: http://my.example.com/$INSTANCE_ID/
+ post: [ pub_key_dsa, pub_key_rsa, pub_key_ecdsa, instance_id ]
diff --git a/doc/examples/cloud-config-power-state.txt b/doc/examples/cloud-config-power-state.txt
new file mode 100644
index 00000000..59f062d0
--- /dev/null
+++ b/doc/examples/cloud-config-power-state.txt
@@ -0,0 +1,22 @@
+#cloud-config
+
+## poweroff or reboot system after finished
+# default: none
+#
+# power_state can be used to make the system shutdown, reboot or
+# halt after boot is finished. This same thing can be acheived by
+# user-data scripts or by runcmd by simply invoking 'shutdown'.
+#
+# Doing it this way ensures that cloud-init is entirely finished with
+# modules that would be executed, and avoids any error/log messages
+# that may go to the console as a result of system services like
+# syslog being taken down while cloud-init is running.
+#
+# delay: form accepted by shutdown. default is 'now'. other format
+# accepted is +m (m in minutes)
+# mode: required. must be one of 'poweroff', 'halt', 'reboot'
+# message: provided as the message argument to 'shutdown'. default is none.
+power_state:
+ delay: 30
+ mode: poweroff
+ message: Bye Bye
diff --git a/doc/examples/cloud-config-resolv-conf.txt b/doc/examples/cloud-config-resolv-conf.txt
new file mode 100644
index 00000000..37ffc91a
--- /dev/null
+++ b/doc/examples/cloud-config-resolv-conf.txt
@@ -0,0 +1,20 @@
+#cloud-config
+#
+# This is an example file to automatically configure resolv.conf when the
+# instance boots for the first time.
+#
+# Ensure that your yaml is valid and pass this as user-data when starting
+# the instance. Also be sure that your cloud.cfg file includes this
+# configuration module in the appropirate section.
+#
+manage-resolv-conf: true
+
+resolv_conf:
+ nameservers: ['8.8.4.4', '8.8.8.8']
+ searchdomains:
+ - foo.example.com
+ - bar.example.com
+ domain: example.com
+ options:
+ rotate: true
+ timeout: 1
diff --git a/doc/examples/cloud-config-run-cmds.txt b/doc/examples/cloud-config-run-cmds.txt
new file mode 100644
index 00000000..61b3bd63
--- /dev/null
+++ b/doc/examples/cloud-config-run-cmds.txt
@@ -0,0 +1,21 @@
+#cloud-config
+
+# run commands
+# default: none
+# runcmd contains a list of either lists or a string
+# each item will be executed in order at rc.local like level with
+# output to the console
+# - if the item is a list, the items will be properly executed as if
+# passed to execve(3) (with the first arg as the command).
+# - if the item is a string, it will be simply written to the file and
+# will be interpreted by 'sh'
+#
+# Note, that the list has to be proper yaml, so you have to escape
+# any characters yaml would eat (':' can be problematic)
+runcmd:
+ - [ ls, -l, / ]
+ - [ sh, -xc, "echo $(date) ': hello world!'" ]
+ - [ sh, -c, echo "=========hello world'=========" ]
+ - ls -l /root
+ - [ wget, "http://slashdot.org", -O, /tmp/index.html ]
+
diff --git a/doc/examples/cloud-config-ssh-keys.txt b/doc/examples/cloud-config-ssh-keys.txt
new file mode 100644
index 00000000..235a114f
--- /dev/null
+++ b/doc/examples/cloud-config-ssh-keys.txt
@@ -0,0 +1,46 @@
+#cloud-config
+
+# add each entry to ~/.ssh/authorized_keys for the configured user or the
+# first user defined in the user definition directive.
+ssh_authorized_keys:
+ - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEA3FSyQwBI6Z+nCSjUUk8EEAnnkhXlukKoUPND/RRClWz2s5TCzIkd3Ou5+Cyz71X0XmazM3l5WgeErvtIwQMyT1KjNoMhoJMrJnWqQPOt5Q8zWd9qG7PBl9+eiH5qV7NZ mykey@host
+ - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3I7VUf2l5gSn5uavROsc5HRDpZdQueUq5ozemNSj8T7enqKHOEaFoU2VoPgGEWC9RyzSQVeyD6s7APMcE82EtmW4skVEgEGSbDc1pvxzxtchBj78hJP6Cf5TCMFSXw+Fz5rF1dR23QDbN1mkHs7adr8GW4kSWqU7Q7NDwfIrJJtO7Hi42GyXtvEONHbiRPOe8stqUly7MvUoN+5kfjBM8Qqpfl2+FNhTYWpMfYdPUnE7u536WqzFmsaqJctz3gBxH9Ex7dFtrxR4qiqEr9Qtlu3xGn7Bw07/+i1D+ey3ONkZLN+LQ714cgj8fRS4Hj29SCmXp5Kt5/82cD/VN3NtHw== smoser@brickies
+
+# Send pre-generated ssh private keys to the server
+# If these are present, they will be written to /etc/ssh and
+# new random keys will not be generated
+# in addition to 'rsa' and 'dsa' as shown below, 'ecdsa' is also supported
+ssh_keys:
+ rsa_private: |
+ -----BEGIN RSA PRIVATE KEY-----
+ MIIBxwIBAAJhAKD0YSHy73nUgysO13XsJmd4fHiFyQ+00R7VVu2iV9Qcon2LZS/x
+ 1cydPZ4pQpfjEha6WxZ6o8ci/Ea/w0n+0HGPwaxlEG2Z9inNtj3pgFrYcRztfECb
+ 1j6HCibZbAzYtwIBIwJgO8h72WjcmvcpZ8OvHSvTwAguO2TkR6mPgHsgSaKy6GJo
+ PUJnaZRWuba/HX0KGyhz19nPzLpzG5f0fYahlMJAyc13FV7K6kMBPXTRR6FxgHEg
+ L0MPC7cdqAwOVNcPY6A7AjEA1bNaIjOzFN2sfZX0j7OMhQuc4zP7r80zaGc5oy6W
+ p58hRAncFKEvnEq2CeL3vtuZAjEAwNBHpbNsBYTRPCHM7rZuG/iBtwp8Rxhc9I5w
+ ixvzMgi+HpGLWzUIBS+P/XhekIjPAjA285rVmEP+DR255Ls65QbgYhJmTzIXQ2T9
+ luLvcmFBC6l35Uc4gTgg4ALsmXLn71MCMGMpSWspEvuGInayTCL+vEjmNBT+FAdO
+ W7D4zCpI43jRS9U06JVOeSc9CDk2lwiA3wIwCTB/6uc8Cq85D9YqpM10FuHjKpnP
+ REPPOyrAspdeOAV+6VKRavstea7+2DZmSUgE
+ -----END RSA PRIVATE KEY-----
+
+ rsa_public: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEAoPRhIfLvedSDKw7XdewmZ3h8eIXJD7TRHtVW7aJX1ByifYtlL/HVzJ09nilCl+MSFrpbFnqjxyL8Rr/DSf7QcY/BrGUQbZn2Kc22PemAWthxHO18QJvWPocKJtlsDNi3 smoser@localhost
+
+ dsa_private: |
+ -----BEGIN DSA PRIVATE KEY-----
+ MIIBuwIBAAKBgQDP2HLu7pTExL89USyM0264RCyWX/CMLmukxX0Jdbm29ax8FBJT
+ pLrO8TIXVY5rPAJm1dTHnpuyJhOvU9G7M8tPUABtzSJh4GVSHlwaCfycwcpLv9TX
+ DgWIpSj+6EiHCyaRlB1/CBp9RiaB+10QcFbm+lapuET+/Au6vSDp9IRtlQIVAIMR
+ 8KucvUYbOEI+yv+5LW9u3z/BAoGBAI0q6JP+JvJmwZFaeCMMVxXUbqiSko/P1lsa
+ LNNBHZ5/8MOUIm8rB2FC6ziidfueJpqTMqeQmSAlEBCwnwreUnGfRrKoJpyPNENY
+ d15MG6N5J+z81sEcHFeprryZ+D3Ge9VjPq3Tf3NhKKwCDQ0240aPezbnjPeFm4mH
+ bYxxcZ9GAoGAXmLIFSQgiAPu459rCKxT46tHJtM0QfnNiEnQLbFluefZ/yiI4DI3
+ 8UzTCOXLhUA7ybmZha+D/csj15Y9/BNFuO7unzVhikCQV9DTeXX46pG4s1o23JKC
+ /QaYWNMZ7kTRv+wWow9MhGiVdML4ZN4XnifuO5krqAybngIy66PMEoQCFEIsKKWv
+ 99iziAH0KBMVbxy03Trz
+ -----END DSA PRIVATE KEY-----
+
+ dsa_public: ssh-dss AAAAB3NzaC1kc3MAAACBAM/Ycu7ulMTEvz1RLIzTbrhELJZf8Iwua6TFfQl1ubb1rHwUElOkus7xMhdVjms8AmbV1Meem7ImE69T0bszy09QAG3NImHgZVIeXBoJ/JzByku/1NcOBYilKP7oSIcLJpGUHX8IGn1GJoH7XRBwVub6Vqm4RP78C7q9IOn0hG2VAAAAFQCDEfCrnL1GGzhCPsr/uS1vbt8/wQAAAIEAjSrok/4m8mbBkVp4IwxXFdRuqJKSj8/WWxos00Ednn/ww5QibysHYULrOKJ1+54mmpMyp5CZICUQELCfCt5ScZ9GsqgmnI80Q1h3Xkwbo3kn7PzWwRwcV6muvJn4PcZ71WM+rdN/c2EorAINDTbjRo97NueM94WbiYdtjHFxn0YAAACAXmLIFSQgiAPu459rCKxT46tHJtM0QfnNiEnQLbFluefZ/yiI4DI38UzTCOXLhUA7ybmZha+D/csj15Y9/BNFuO7unzVhikCQV9DTeXX46pG4s1o23JKC/QaYWNMZ7kTRv+wWow9MhGiVdML4ZN4XnifuO5krqAybngIy66PMEoQ= smoser@localhost
+
+
diff --git a/doc/examples/cloud-config-update-apt.txt b/doc/examples/cloud-config-update-apt.txt
new file mode 100644
index 00000000..a83ce3f7
--- /dev/null
+++ b/doc/examples/cloud-config-update-apt.txt
@@ -0,0 +1,7 @@
+#cloud-config
+# Update apt database on first boot
+# (ie run apt-get update)
+#
+# Default: true
+# Aliases: apt_update
+package_update: false
diff --git a/doc/examples/cloud-config-update-packages.txt b/doc/examples/cloud-config-update-packages.txt
new file mode 100644
index 00000000..56b72c63
--- /dev/null
+++ b/doc/examples/cloud-config-update-packages.txt
@@ -0,0 +1,8 @@
+#cloud-config
+
+# Upgrade the instance on first boot
+# (ie run apt-get upgrade)
+#
+# Default: false
+# Aliases: apt_upgrade
+package_upgrade: true
diff --git a/doc/examples/cloud-config-write-files.txt b/doc/examples/cloud-config-write-files.txt
index 9c4e3998..ec98bc93 100644
--- a/doc/examples/cloud-config-write-files.txt
+++ b/doc/examples/cloud-config-write-files.txt
@@ -12,7 +12,7 @@ write_files:
content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV4...
owner: root:root
path: /etc/sysconfig/selinux
- perms: '0644'
+ permissions: '0644'
- content: |
# My new /etc/sysconfig/samba file
@@ -24,10 +24,10 @@ write_files:
AAAAAAAAAwAAAAQAAAAAAgAAAAAAAAACQAAAAAAAAAJAAAAAAAAcAAAAAAAAABwAAAAAAAAAAQAA
....
path: /bin/arch
- perms: '0555'
+ permissions: '0555'
- encoding: gzip
content: !!binary |
H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
path: /usr/bin/hello
- perms: '0755'
+ permissions: '0755'