2
# Update apt database on first boot
3
# (ie run apt-get update)
9
# Upgrade the instance on first boot
10
# (ie run apt-get upgrade)
16
# Add apt repositories
18
# Default: auto select based on cloud metadata
19
# in ec2, the default is <region>.archive.ubuntu.com
20
apt_mirror: http://us.archive.ubuntu.com/ubuntu/
22
# Preserve existing /etc/apt/sources.list
23
# Default: overwrite sources_list with mirror. If this is true
24
# then apt_mirror above will have no effect
25
apt_preserve_sources_list: true
28
- source: "deb http://ppa.launchpad.net/byobu/ppa/ubuntu karmic main"
29
keyid: F430BBA5 # GPG key ID published on a key server
30
filename: byobu-ppa.list
33
# * Setup correct apt sources.list line
34
# * Import the signing key from LP
36
# See https://help.launchpad.net/Packaging/PPA for more information
37
# this requires 'add-apt-repository'
38
- source: "ppa:smoser/ppa" # Quote the string
40
# Custom apt repository:
41
# * all that is required is 'source'
42
# * Creates a file in /etc/apt/sources.list.d/ for the sources list entry
43
# * [optional] Import the apt signing key from the keyserver
45
# + keyserver: keyserver.ubuntu.com
46
# + filename: cloud_config_sources.list
48
# See sources.list man page for more information about the format
49
- source: deb http://archive.ubuntu.com/ubuntu karmic-backports main universe multiverse restricted
51
# sources can use $MIRROR and $RELEASE and they will be replaced
52
# with the local mirror for this cloud, and the running release
53
# the entry below would be possibly turned into:
54
# - source: deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu natty multiverse
55
- source: deb $MIRROR $RELEASE multiverse
57
# this would have the same end effect as 'ppa:byobu/ppa'
58
- source: "deb http://ppa.launchpad.net/byobu/ppa/ubuntu karmic main"
59
keyid: F430BBA5 # GPG key ID published on a key server
60
filename: byobu-ppa.list
62
# Custom apt repository:
63
# * The apt signing key can also be specified
64
# by providing a pgp public key block
65
# * Providing the PBG key here is the most robust method for
66
# specifying a key, as it removes dependency on a remote key server
68
- source: deb http://ppa.launchpad.net/alestic/ppa/ubuntu karmic main
69
key: | # The value needs to start with -----BEGIN PGP PUBLIC KEY BLOCK-----
70
-----BEGIN PGP PUBLIC KEY BLOCK-----
73
mI0ESpA3UQEEALdZKVIMq0j6qWAXAyxSlF63SvPVIgxHPb9Nk0DZUixn+akqytxG4zKCONz6
74
qLjoBBfHnynyVLfT4ihg9an1PqxRnTO+JKQxl8NgKGz6Pon569GtAOdWNKw15XKinJTDLjnj
75
9y96ljJqRcpV9t/WsIcdJPcKFR5voHTEoABE2aEXABEBAAG0GUxhdW5jaHBhZCBQUEEgZm9y
76
IEFsZXN0aWOItgQTAQIAIAUCSpA3UQIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEA7H
77
5Qi+CcVxWZ8D/1MyYvfj3FJPZUm2Yo1zZsQ657vHI9+pPouqflWOayRR9jbiyUFIn0VdQBrP
78
t0FwvnOFArUovUWoKAEdqR8hPy3M3APUZjl5K4cMZR/xaMQeQRZ5CHpS4DBKURKAHC0ltS5o
79
uBJKQOZm5iltJp15cgyIkBkGe8Mx18VFyVglAZey
81
-----END PGP PUBLIC KEY BLOCK-----
83
# Install additional packages on first boot
87
# if packages are specified, this apt_update will be set to true
94
# 'mounts' contains a list of lists
95
# the inner list are entries for an /etc/fstab line
96
# ie : [ fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno ]
100
# - [ ephemeral0, /mnt ]
101
# - [ swap, none, swap, sw, 0, 0 ]
103
# in order to remove a previously listed mount (ie, one from defaults)
104
# list only the fs_spec. For example, to override the default, of
110
# - if a device does not exist at the time, an entry will still be
111
# written to /etc/fstab.
112
# - '/dev' can be ommitted for device names that begin with: xvd, sd, hd, vd
113
# - if an entry does not have all 6 fields, they will be filled in
114
# with values from 'mount_default_fields' below.
116
# Note, that you should set 'nobootwait' (see man fstab) for volumes that may
117
# not be attached at instance boot (or reboot)
120
- [ ephemeral0, /mnt, auto, "defaults,noexec" ]
122
- [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ]
125
# mount_default_fields
126
# These values are used to fill in any entries in 'mounts' that are not
127
# complete. This must be an array, and must have 7 fields.
128
mount_default_fields: [ None, None, "auto", "defaults,nobootwait", "0", "2" ]
130
# add each entry to ~/.ssh/authorized_keys for the configured user
132
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEA3FSyQwBI6Z+nCSjUUk8EEAnnkhXlukKoUPND/RRClWz2s5TCzIkd3Ou5+Cyz71X0XmazM3l5WgeErvtIwQMyT1KjNoMhoJMrJnWqQPOt5Q8zWd9qG7PBl9+eiH5qV7NZ mykey@host
133
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3I7VUf2l5gSn5uavROsc5HRDpZdQueUq5ozemNSj8T7enqKHOEaFoU2VoPgGEWC9RyzSQVeyD6s7APMcE82EtmW4skVEgEGSbDc1pvxzxtchBj78hJP6Cf5TCMFSXw+Fz5rF1dR23QDbN1mkHs7adr8GW4kSWqU7Q7NDwfIrJJtO7Hi42GyXtvEONHbiRPOe8stqUly7MvUoN+5kfjBM8Qqpfl2+FNhTYWpMfYdPUnE7u536WqzFmsaqJctz3gBxH9Ex7dFtrxR4qiqEr9Qtlu3xGn7Bw07/+i1D+ey3ONkZLN+LQ714cgj8fRS4Hj29SCmXp5Kt5/82cD/VN3NtHw== smoser@brickies
135
# Send pre-generated ssh private keys to the server
136
# If these are present, they will be written to /etc/ssh and
137
# new random keys will not be generated
138
# in addition to 'rsa' and 'dsa' as shown below, 'ecdsa' is also supported
141
-----BEGIN RSA PRIVATE KEY-----
142
MIIBxwIBAAJhAKD0YSHy73nUgysO13XsJmd4fHiFyQ+00R7VVu2iV9Qcon2LZS/x
143
1cydPZ4pQpfjEha6WxZ6o8ci/Ea/w0n+0HGPwaxlEG2Z9inNtj3pgFrYcRztfECb
144
1j6HCibZbAzYtwIBIwJgO8h72WjcmvcpZ8OvHSvTwAguO2TkR6mPgHsgSaKy6GJo
145
PUJnaZRWuba/HX0KGyhz19nPzLpzG5f0fYahlMJAyc13FV7K6kMBPXTRR6FxgHEg
146
L0MPC7cdqAwOVNcPY6A7AjEA1bNaIjOzFN2sfZX0j7OMhQuc4zP7r80zaGc5oy6W
147
p58hRAncFKEvnEq2CeL3vtuZAjEAwNBHpbNsBYTRPCHM7rZuG/iBtwp8Rxhc9I5w
148
ixvzMgi+HpGLWzUIBS+P/XhekIjPAjA285rVmEP+DR255Ls65QbgYhJmTzIXQ2T9
149
luLvcmFBC6l35Uc4gTgg4ALsmXLn71MCMGMpSWspEvuGInayTCL+vEjmNBT+FAdO
150
W7D4zCpI43jRS9U06JVOeSc9CDk2lwiA3wIwCTB/6uc8Cq85D9YqpM10FuHjKpnP
151
REPPOyrAspdeOAV+6VKRavstea7+2DZmSUgE
152
-----END RSA PRIVATE KEY-----
154
rsa_public: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEAoPRhIfLvedSDKw7XdewmZ3h8eIXJD7TRHtVW7aJX1ByifYtlL/HVzJ09nilCl+MSFrpbFnqjxyL8Rr/DSf7QcY/BrGUQbZn2Kc22PemAWthxHO18QJvWPocKJtlsDNi3 smoser@localhost
157
-----BEGIN DSA PRIVATE KEY-----
158
MIIBuwIBAAKBgQDP2HLu7pTExL89USyM0264RCyWX/CMLmukxX0Jdbm29ax8FBJT
159
pLrO8TIXVY5rPAJm1dTHnpuyJhOvU9G7M8tPUABtzSJh4GVSHlwaCfycwcpLv9TX
160
DgWIpSj+6EiHCyaRlB1/CBp9RiaB+10QcFbm+lapuET+/Au6vSDp9IRtlQIVAIMR
161
8KucvUYbOEI+yv+5LW9u3z/BAoGBAI0q6JP+JvJmwZFaeCMMVxXUbqiSko/P1lsa
162
LNNBHZ5/8MOUIm8rB2FC6ziidfueJpqTMqeQmSAlEBCwnwreUnGfRrKoJpyPNENY
163
d15MG6N5J+z81sEcHFeprryZ+D3Ge9VjPq3Tf3NhKKwCDQ0240aPezbnjPeFm4mH
164
bYxxcZ9GAoGAXmLIFSQgiAPu459rCKxT46tHJtM0QfnNiEnQLbFluefZ/yiI4DI3
165
8UzTCOXLhUA7ybmZha+D/csj15Y9/BNFuO7unzVhikCQV9DTeXX46pG4s1o23JKC
166
/QaYWNMZ7kTRv+wWow9MhGiVdML4ZN4XnifuO5krqAybngIy66PMEoQCFEIsKKWv
168
-----END DSA PRIVATE KEY-----
170
dsa_public: ssh-dss AAAAB3NzaC1kc3MAAACBAM/Ycu7ulMTEvz1RLIzTbrhELJZf8Iwua6TFfQl1ubb1rHwUElOkus7xMhdVjms8AmbV1Meem7ImE69T0bszy09QAG3NImHgZVIeXBoJ/JzByku/1NcOBYilKP7oSIcLJpGUHX8IGn1GJoH7XRBwVub6Vqm4RP78C7q9IOn0hG2VAAAAFQCDEfCrnL1GGzhCPsr/uS1vbt8/wQAAAIEAjSrok/4m8mbBkVp4IwxXFdRuqJKSj8/WWxos00Ednn/ww5QibysHYULrOKJ1+54mmpMyp5CZICUQELCfCt5ScZ9GsqgmnI80Q1h3Xkwbo3kn7PzWwRwcV6muvJn4PcZ71WM+rdN/c2EorAINDTbjRo97NueM94WbiYdtjHFxn0YAAACAXmLIFSQgiAPu459rCKxT46tHJtM0QfnNiEnQLbFluefZ/yiI4DI38UzTCOXLhUA7ybmZha+D/csj15Y9/BNFuO7unzVhikCQV9DTeXX46pG4s1o23JKC/QaYWNMZ7kTRv+wWow9MhGiVdML4ZN4XnifuO5krqAybngIy66PMEoQ= smoser@localhost
173
# remove access to the ec2 metadata service early in boot via null route
174
# the null route can be removed (by root) with:
175
# route del -host 169.254.169.254 reject
176
# default: false (service available)
177
disable_ec2_metadata: true
181
# runcmd contains a list of either lists or a string
182
# each item will be executed in order at rc.local like level with
183
# output to the console
184
# - if the item is a list, the items will be properly executed as if
185
# passed to execve(3) (with the first arg as the command).
186
# - if the item is a string, it will be simply written to the file and
187
# will be interpreted by 'sh'
189
# Note, that the list has to be proper yaml, so you have to escape
190
# any characters yaml would eat (':' can be problematic)
193
- [ sh, -xc, "echo $(date) ': hello world!'" ]
194
- [ sh, -c, echo "=========hello world'=========" ]
196
- [ wget, "http://slashdot.org", -O, /tmp/index.html ]
201
# this is very similar to runcmd above, but commands run very early
202
# in the boot process, only slightly after a 'boothook' would run.
203
# bootcmd should really only be used for things that could not be
204
# done later in the boot process. bootcmd is very much like
205
# boothook, but possibly with more friendly
207
- echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts
209
# cloud_config_modules:
211
# cloud_config_modules:
214
# - apt-update-upgrade
217
# - disable-ec2-metadata
220
# This is an array of arrays or strings.
221
# if item is a string, then it is read as a module name
222
# if the item is an array it is of the form:
223
# name, frequency, arguments
224
# where 'frequency' is one of:
227
# a python file in the CloudConfig/ module directory named
230
cloud_config_modules:
235
- [ apt-update-upgrade, always ]
238
- disable-ec2-metadata
242
# ssh_import_id: [ user1, user2 ]
243
# ssh_import_id will feed the list in that variable to
244
# ssh-import-id, so that public keys stored in launchpad
245
# can easily be imported into the configured user
246
# This can be a single string ('smoser') or a list ([smoser, kirkland])
247
ssh_import_id: [smoser]
249
# Provide debconf answers
251
# See debconf-set-selections man page.
255
debconf_selections: | # Need to perserve newlines
256
# Force debconf priority to critical.
257
debconf debconf/priority select critical
259
# Override default frontend to readline, but allow user to select.
260
debconf debconf/frontend select readline
261
debconf debconf/frontend seen false
263
# manage byobu defaults
265
# 'user' or 'enable-user': set byobu 'launch-by-default' for the default user
266
# 'system' or 'enable-system' or 'enable':
267
# enable 'launch-by-default' for all users, do not modify default user
268
# 'disable': disable both default user and system
269
# 'disable-system': disable system
270
# 'disable-user': disable for default user
271
# not-set: no changes made
272
byobu_by_default: system
274
# disable ssh access as root.
275
# if you want to be able to ssh in to the system as the root user
276
# rather than as the 'ubuntu' user, then you must set this to false
280
# disable_root_opts: the value of this variable will prefix the
281
# respective key in /root/.ssh/authorized_keys if disable_root is true
282
# see 'man authorized_keys' for more information on what you can do here
284
# The string '$USER' will be replaced with the username of the default user
286
# disable_root_opts: no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"$USER\" rather than the user \"root\".';echo;sleep 10"
289
# set the locale to a given locale
290
# default: en_US.UTF-8
293
# add entries to rsyslog configuration
294
# The first occurance of a given filename will truncate.
295
# subsequent entries will append.
296
# if value is a scalar, its content is assumed to be 'content', and the
297
# default filename is used.
298
# if filename is not provided, it will default to 'rsylog_filename'
299
# if filename does not start with a '/', it will be put in 'rsyslog_dir'
300
# rsyslog_dir default: /etc/rsyslog.d
301
# rsyslog_filename default: 20-cloud-config.conf
303
- ':syslogtag, isequal, "[CLOUDINIT]" /var/log/cloud-foo.log'
304
- content: "*.* @@192.0.2.1:10514"
305
- filename: 01-examplecom.conf
307
*.* @@syslogd.example.com
309
# resize_rootfs should the / filesytem be resized on first boot
310
# this allows you to launch an instance with a larger disk / partition
311
# and have the instance automatically grow / to accomoddate it
312
# set to 'False' to disable
315
## hostname and /etc/hosts management
316
# cloud-init will do its best to set up a sane hostname and corresponding
317
# entries in /etc/hosts.
319
# if you do nothing, you should get the system generally correctly
321
# * /etc/hostname (and thus `hostname` output) set with hostname (not fqdn)
322
# * an entry in /etc/hosts for both hostname and fqdn
323
# that are obtained from the metadata service
324
# * On each boot, the above will again be set
325
# * cloud-init generally "owns" the 127.0.1.1 entry. The
326
# rest of the file will not be modified
328
# You can change the above behavior with the following config variables:
329
# Remember that these can be set in cloud-config via user-data,
330
# /etc/cloud/cloud.cfg or any file in /etc/cloud/cloud.cfg.d/
333
# this option will be used wherever the 'hostname' is needed
334
# simply substitute it in the description above.
335
# ** If you wish to set your hostname, set it here **
336
# default: 'hostname' as returned by the metadata service
337
# on EC2, the hostname portion of 'local-hostname' is used
338
# which is something like 'ip-10-244-170-199'
341
# this option will be used wherever 'fqdn' is needed.
342
# simply substitue it in the description above.
343
# default: fqdn as returned by the metadata service. on EC2 'hostname'
344
# is used, so this is like: ip-10-244-170-199.ec2.internal
348
# Setting this config variable to 'true' will mean that on every
349
# boot, /etc/hosts will be re-written from /etc/cloud/templates/hosts.tmpl
350
# The strings '$hostname' and '$fqdn' are replaced in the template
351
# with the appropriate values.
355
# If this option is set to True, then /etc/hostname will never updated
356
# The default behavior is to update it if it has not been modified by
360
# default: cloud-init boot finished at $TIMESTAMP. Up $UPTIME seconds
361
# this message is written by cloud-final when the system is finished
363
final_message: "The system is finally up, after $UPTIME seconds"
365
# configure where output will go
366
# 'output' entry is a dict with 'init', 'config', 'final' or 'all'
367
# entries. Each one defines where
368
# cloud-init, cloud-config, cloud-config-final or all output will go
369
# each entry in the dict can be a string, list or dict.
370
# if it is a string, it refers to stdout and stderr
371
# if it is a list, entry 0 is stdout, entry 1 is stderr
372
# if it is a dict, it is expected to have 'output' and 'error' fields
373
# default is to write to console only
374
# the special entry "&1" for an error means "same location as stdout"
375
# (Note, that '&1' has meaning in yaml, so it must be quoted)
377
init: "> /var/log/my-cloud-init.log"
378
config: [ ">> /tmp/foo.out", "> /tmp/foo.err" ]
380
output: "| tee /tmp/final.stdout | tee /tmp/bar.stdout"
384
# phone_home: if this dictionary is present, then the phone_home
385
# cloud-config module will post specified data back to the given
389
# url: http://my.foo.bar/$INSTANCE/
394
url: http://my.example.com/$INSTANCE_ID/
395
post: [ pub_key_dsa, pub_key_rsa, pub_key_ecdsa, instance_id ]
397
# timezone: set the timezone for this instance
398
# the value of 'timezone' must exist in /usr/share/zoneinfo
401
# def_log_file and syslog_fix_perms work together
403
# - logging is set to go to a log file 'L' both with and without syslog
404
# - and 'L' does not exist
405
# - and syslog is configured to write to 'L'
406
# then 'L' will be initially created with root:root ownership (during
407
# cloud-init), and then at cloud-config time (when syslog is available)
408
# the syslog daemon will be unable to write to the file.
410
# to remedy this situation, 'def_log_file' can be set to a filename
411
# and syslog_fix_perms to a string containing "<user>:<group>"
413
# the default values are '/var/log/cloud-init.log' and 'syslog:adm'
414
# the value of 'def_log_file' should match what is configured in logging
415
# if either is empty, then no change of ownership will be done
416
def_log_file: /var/log/my-logging-file.log
417
syslog_fix_perms: syslog:root
419
# you can set passwords for a user or multiple users
420
# this is off by default.
421
# to set the default user's password, use the 'password' option.
422
# if set, to 'R' or 'RANDOM', then a random password will be
423
# generated and written to stdout (the console)
426
# also note, that this will expire the password, forcing a change
427
# on first login. If you do not want to expire, see 'chpasswd' below.
429
# By default in the UEC images password authentication is disabled
430
# Thus, simply setting 'password' as above will only allow you to login
433
# in order to enable password login via ssh you must set
435
# If it is set, to 'True' or 'False', then sshd_config will be updated
436
# to ensure the desired function. If not set, or set to '' or 'unchanged'
437
# then sshd_config will not be updated.
440
# there is also an option to set multiple users passwords, using 'chpasswd'
441
# That looks like the following, with 'expire' set to 'True' by default.
442
# to not expire users passwords, set 'expire' to 'False':
448
# ssh_pwauth: [ True, False, "" or "unchanged" ]
450
# So, a simple working example to allow login via ssh, and not expire
451
# for the default user would look like:
453
chpasswd: { expire: False }
456
# manual cache clean.
457
# By default, the link from /var/lib/cloud/instance to
458
# the specific instance in /var/lib/cloud/instances/ is removed on every
459
# boot. The cloud-init code then searches for a DataSource on every boot
460
# if your DataSource will not be present on every boot, then you can set
461
# this option to 'True', and maintain (remove) that link before the image
462
# will be booted as a new instance.
464
manual_cache_clean: False
466
# When cloud-init is finished running including having run
467
# cloud_init_modules, then it will run this command. The default
468
# is to emit an upstart signal as shown below. If the value is a
469
# list, it will be passed to Popen. If it is a string, it will be
470
# invoked through 'sh -c'.
473
# cc_ready_cmd: [ initctl, emit, cloud-config, CLOUD_CFG=/var/lib/instance//cloud-config.txt ]
475
# cc_ready_cmd: [ sh, -c, 'echo HI MOM > /tmp/file' ]