← Back to team overview

cloud-init team mailing list archive

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


I think u want the power_state_change one.


Then put in something like.

power_state: reboot

Let me know if the above works.

Although your 'package_reboot_if_required' should have worked, maybe a bug?



From: "justin@xxxxxxxxxxxxxx<mailto:justin@xxxxxxxxxxxxxx>" <justin@xxxxxxxxxxxxxx<mailto:justin@xxxxxxxxxxxxxx>>
Date: Friday, March 28, 2014 at 3:09 PM
To: Joshua Harlow <harlowja@xxxxxxxxxxxxx<mailto:harlowja@xxxxxxxxxxxxx>>
Cc: "cloud-init@xxxxxxxxxxxxxxxxxxx<mailto:cloud-init@xxxxxxxxxxxxxxxxxxx>" <cloud-init@xxxxxxxxxxxxxxxxxxx<mailto:cloud-init@xxxxxxxxxxxxxxxxxxx>>
Subject: Re: [Cloud-init] 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:


Including just the missing option wasn't good

    - 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:

    - 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:

   package_reboot_if_required: true
    - git
    - kernel

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

Nor this:

   package_update: true
   package_upgrade: true
   package_reboot_if_required: true
    - git
    - kernel

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

Is there a different module I should be including?

+ Justin

Follow ups