← Back to team overview

cloud-init team mailing list archive

Re: Cloud-init not installing rpms (CentOS 6.5)

 

On 2014-03-28 21:18, Joshua Harlow wrote:
U should be able to put it in /etc/cloud/cloud.cfg.d/

http://cloudinit.readthedocs.org/en/latest/topics/merging.html [2]
should help u with this I think.

Let us know if all things go fine :)

So far, managed to get it mostly working. :)

Created a file:

  /etc/cloud/cloud.cfg.d/01_rpm_packages.cfg

Including just the missing option wasn't good
enough:

  cloud_config_modules:
   - package-update-upgrade-install

The yum update fires off, but the "runcmd" commands
don't.  Which seem to mean the injected file was
replacing the contents of that section, not merging it.

Pretty straightforward to fix that though.  Adding the
full section contents to the injected file works, with
both the rpm package being installed and the commands
being run:

  cloud_config_modules:
   - mounts
   - locale
   - set-passwords
   - package-update-upgrade-install
   - timezone
   - puppet
   - chef
   - salt-minion
   - mcollective
   - disable-ec2-metadata
   - runcmd

The last piece I need to figure out isn't playing ball
though.  I'm trying to get a kernel update installed,
with the VM rebooted, before the runcmd fires.

This doesn't work:

  #cloud-config
  package_reboot_if_required: true
  packages:
   - git
   - kernel

  runcmd:
   - echo 'complete' >> /tmp/my-cloud-config.log

Nor this:

  #cloud-config
  package_update: true
  package_upgrade: true
  package_reboot_if_required: true
  packages:
   - git
   - kernel

  runcmd:
   - echo 'complete' >> /tmp/my-cloud-config.log

Is there a different module I should be including?

+ Justin


Follow ups

References