GCE Images with Imagefactory/oz

Filipe Brandenburger filbranden at google.com
Wed Jun 25 15:04:59 UTC 2014


Hi,

On Wed, Jun 25, 2014 at 1:29 AM, Renich Bon Ciric
<renich at woralelandia.com> wrote:
> My only problem is the "ssh-fix" command; since lxml caught all the
> redirections; namely "< ". It doesn't like an &lt; with a space next
> to it.
> https://github.com/renich/gce-images-fedora/blob/master/imagefactory/f20.tdl#L141

Just a hunch, try to put the whole block inside <command
name='ssh-fix'> between a <![CDATA[ ... ]]> block.
http://www.w3schools.com/xml/xml_cdata.asp

For the patch contents, I was wondering if "diff -u" output wouldn't
be better, unless you really intended it that way to prevent patch
failures if lines around those are added or removed.

One alternative way would be to use ex (same as vi command mode) or
sed to perform the edits:

ex -s /etc/ssh/sshd_config <<'EOF'
/^#AddressFamily/s/.*/AddressFamily inet/
/^#ListenAddress/s/^#//
/^#PermitRootLogin/s/.*/PermitRootLogin without-password/
wq
EOF

Also, probably no need to use < <( cat <<'EOF' since that's
essentially the same as a simple <<'EOF', no? I don't see how the
below would not work...

patch /etc/ssh/sshd_config <<'EOF'
...
EOF

Cheers!
Filipe


More information about the cloud mailing list