← 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.

http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/config/cc_power_state_change.py

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?

http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/config/cc_package_update_upgrade_install.py#L36

-Josh

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:

   /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