Search code examples
linuxcentosrpmcloud-init

cloud-init: Can I install from RPM using cloud-config?


I'm new to cloud-init and I'm trying to install a certain package from an RPM file. Is there a way to do it from the packages or yum_repos modules? For the time being I'm installing it from bash using the runcmd module:

#cloud-config    
runcmd:
  - [yum, install, -y, https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm]

But I'd really like to avoid this since all the other dependencies are being installed from the packages module.


Solution

  • It's possible that you can just list the URL along with other packages in the package module. Assuming that the module ultimately just calls out to yum install (or the equivalent via the api), you can use package names and urls interchangeably. And if it doesn't work, you already have a workaround :).

    #cloud-config
    packages:
      - https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm