From eb939e7765f490529aade46e38ee0f85d8a911dd Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 11 Jul 2012 11:20:24 -0700 Subject: Adjust the decoding of the files that are given so that a canonicalize happens first, which will examine the incoming encoding, and decide the neccasary decoding types needed to get the final resultant string and then use these normalized decoding types to actually do the final decode. Also change the name of the config key that is looked up to 'write_files' since 'files' is pretty generic and could have clashes with other modules. Add an example that shows how to use this in the different encoding formats that are supported. --- doc/examples/cloud-config-write-files.txt | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/examples/cloud-config-write-files.txt (limited to 'doc/examples/cloud-config-write-files.txt') diff --git a/doc/examples/cloud-config-write-files.txt b/doc/examples/cloud-config-write-files.txt new file mode 100644 index 00000000..fb0c1541 --- /dev/null +++ b/doc/examples/cloud-config-write-files.txt @@ -0,0 +1,32 @@ +#cloud-config +# vim: syntax=yaml +# +# This is the configuration syntax that the write_files module +# will know how to understand, it can be given b64, b32, b16, or +# gz (or gz+b64) encoded strings which will be decoded accordingly +# and then written to the path that is provided. +# +# Note: Content strings here are truncated for example purposes. +# +write_files: +- content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV4IG9u..... + encoding: b64 + path: /etc/sysconfig/selinux +- content: ' + + # My new /etc/sysconfig/samba file + + SMBDOPTIONS="-D" + + ' + path: /etc/sysconfig/samba +- content: H4sIADXC/U8C/+1Yf2wbVx1/d7YT122TQEMpadS6kgOZqL30J+..... + encoding: gz+b64 + path: /usr/bin/uptime +- content: BIRSAU3FOR2GS3THOMQGM33SEB2GQZJAINJE6TRAMRQWK3LPNYXAU=== + encoding: b32 + path: /etc/sysconfig/crond +- content: 0A232053657474696E677320666F7220746865204E4653206461656D6F6E2E0A + encoding: b16 + path: /etc/sysconfig/nfs + -- cgit v1.2.3