I believe you're looking at it from the wrong view point if you're trying to simply use an existing AMI and not for the creation of a new AMI to load.

The cloud-init configuration can be manipulated using the user-data passed to the EC2 instance on initialization just as you can trigger the puppet installation. I suggest you check out the cloud-init documentation for the version installed on your AMI.

On 23.08.2015 22:21, Craig Barr wrote:
I thought this would be super easy but hit a road block (at least in
terms of an elegance solution - yes I know how to use exec type with
sed and grep but that feels a bit to much like a workaround)

My requirements is for a file at /etc/cloud/cloud.cfg that looks like
this:

users:
 - default
 - name: ec2-user
   primary-group: users
   groups: users
   lock-passwd: false
   sudo: [ALL=(ALL) NOPASSWD:ALL]
 
disable_root: 1
ssh_pwauth:   0

to be changed to this (The only change is highlighted below in
yellow... ssh_pwauthfrom 0 to 1):

users:
 - default
 - name: ec2-user
   primary-group: users
   groups: users
   lock-passwd: false
   sudo: [ALL=(ALL) NOPASSWD:ALL]
 
disable_root: 1
ssh_pwauth:   1

The file is pre-existing in the AMI and is not created by Puppet. If
something like this worked, I would be super happy.... but, it doesnt.

  augeas { "enable-ssh-pwauth" :
     changes => ["set /files/etc/ssh/sshd_config/ssh_pwauth 1",]
  } 

Ive tried
Augeas 1.0.0 and 1.4.0 on OracleLinux 6.6... Neither seem to work

Is Yaml-like lens in augeas even supported? And, if not, is there any
other way I can solve this without grep + sed exec type pattern?
Thoughts?

 --
 You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
 To unsubscribe from this group and stop receiving emails from it,
send an email to puppet-users+unsubscr...@googlegroups.com [1].
 To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/b6d54be7-a3fe-41cc-95c1-ad9e034f9a04%40googlegroups.com
[2].
 For more options, visit https://groups.google.com/d/optout [3].


Links:
------
[1] mailto:puppet-users+unsubscr...@googlegroups.com
[2]

https://groups.google.com/d/msgid/puppet-users/b6d54be7-a3fe-41cc-95c1-ad9e034f9a04%40googlegroups.com?utm_medium=email&utm_source=footer
[3] https://groups.google.com/d/optout

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/eb1c6c00a0ea2757efba99c0781a5b20%40undergrid.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to