All,

Trying to use packer to maintain our Linux OpenStack images.  We use 
cloud-init to lay down base configurations at deploy time and would like to 
move this process to a lower level and do it during image creation.  

As you can see below I am referencing an external file that has 
instructions for cloud-init.  This same methodology works perfectly in our 
Heat templates, however, in Heat we also have *user_data_format* set to 
*RAW*, which is NOT the default for OpenStack and not an acceptable 
parameter for packer. 

When using Packer the entire #cloud-config section is being ignored.

Is there a better way to pass cloud-init instructions during the image 
creation process?  


*packer config .json contents*
{
  "builders": [{
    "type": "openstack",
    "ssh_username": "centos",
    "image_name": "cent7-cloudinit",
    "source_image": "a4331a95-6741-4161-85a5-4e322c2a69bf",
    "flavor": "m1.small",
    "identity_endpoint": "http://x.x.x.x:5000/v3";,
    "username": "",
    "password": "",
    "domain_name": "Default",
    "region": "RegionOne",
    "image_visibility": "public", 
    "networks": "78c8405e-e43c-46d1-b646-f513bf85eb9f",
    "floating_ip_network": "external_network",
    "user_data_file": "base.sh"
  }]
}

*base.sh contents:*

#cloud-config
yum_repos:
  salt-repo:
    baseurl: 
https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
    name: SaltStack repo for Red Hat Enterprise Linux $releasever
    enabled: true
    gpgcheck: true
    gpgkey: 
'https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
 
https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7'

packages:
  - python-msgpack 
  - python-psutil 
  - python-zmq 
  - python-futures
  - zeromq 
  - libsodium 
  - systemd-python 
  - libtomcrypt 
  - libtommath
  - pciutils 
  - python-tornado 
  - python2-crypto

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/81c56310-4618-44f4-b3a6-aa2a93cb777e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to