Userdata for openstack catalog


Is there a way for us to inject userdata on openstack catalogs? I would like to create a catalog to launch openstack instances and at the same define a User Data to be injected to those instances.


Yes, there is. Create a cloudinit Customization Template (Infrastructure -> PXE -> Customization Templates). Note that you may use information from service dialogs or from some class in the automate model.

The following example uses information from a dialog (dialog_root_pw), which is a protected element, and also some values from the automate model (satellite, satorglabel, etc)

## vim:syntax=yaml
debug: True
ssh_pwauth: True
disable_root: false
  list: |
  expire: False
  - sed -i'.orig' -e's/without-password/yes/' /etc/ssh/sshd_config
  - service sshd restart
  - yum localinstall http://<%=evm[:satellite]%>/pub/katello-ca-consumer-latest.noarch.rpm -y
  - subscription-manager register --org="<%=evm[:satorglabel]%>" --activationkey="<%=evm[:satregkey]%>"

Then, create a service dialog including the required information and after that, create a catalog item, associating it to the service dialog. Also in the catalog item, in the “Request info -> Customize tab”, select the cloudinit customization template created earlier.

hope this helps.


Thank… will give this a try. :slight_smile: