How to run user script while booting an instance using cloud-init software ?

Solution Verified - Updated -

Issue

  • How can we run a script while spawning an instance using cloud-init ?.
  • cloud-init software is installed on image.Need help to find a way to use/run user script on every boot.
  • How to avoid making /etc/cloud/cloud.cfg messy by keeping the scripts at different path ?.

Environment

  • Red Hat Enterpise Linux OpenStack Platform 7.
  • RHEL qcow2 image.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content