Feature request: Custom/user definable cloud-init user-data

Bug #1535891 reported by james beedy
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Wishlist
Heather Lanigan

Bug Description

Capabilty to specify custom user-data would make customizing juju deployed instances a breeze for admins.

I don't know how difficult of a task this would be to incorporate/implement into juju, but it sure would be cool!

james beedy (jamesbeedy)
summary: - Feature request: Custom/user definable cloud-init
+ Feature request: Custom/user definable cloud-init user-data
Changed in juju-core:
status: New → Opinion
importance: Undecided → Wishlist
Changed in juju-core:
status: Opinion → Triaged
affects: juju-core → juju
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Partial fix will be done when https://bugs.launchpad.net/juju/+bug/1615876 is addressed.

tags: added: cpe-onsite
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

Use-case:

* a multi-homed host which needs to set rp_filter to 0 (which is set to 1 on ubuntu by default)
* no way to do this other than by setting sysctls
* for bare-metal hosts & MAAS this can be done via curtin
* for LXD containers this is not possible (one would use this in manual setups https://github.com/lxc/lxd/blob/master/doc/cloud-init.md)

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

Any update on this? I see the following option in model-config:

-----
$ juju model-config| grep user
cloudinit-userdata default ""
-----

But I can't find docs to go along with it. Is this option meant to customize cloud-init for new machines in the model?

Revision history for this message
james beedy (jamesbeedy) wrote :

@kwmonroe that is just super!

description: updated
Revision history for this message
james beedy (jamesbeedy) wrote :

I haven't heard of/seen it until now.

Please report back if/when you find out how to use this.

Possibly a docs bug might help expose it better?

Changed in juju:
assignee: nobody → Heather Lanigan (hmlanigan)
Revision history for this message
Heather Lanigan (hmlanigan) wrote :

This functionality is available in juju 2.3.1+.

Here's a rough cut/paste on using the model config variable for now. I'll look at adding to the docs.

Note: This is a sharp knife feature - be careful with it!

Cloudinit-userdata

Allows the user to provide additional cloudinit data to be included in the cloudinit data created by juju. In general, specifying a key will overwrite what juju puts in the cloudinit file with the following caveats:
 * Users and bootcmd keys will cause an error
 * The packages key will be appended to the packages listed by juju
 * The runcmds key will cause an error. You can specify preruncmd and postruncmd keys to prepend and append the runcmd created by juju
Included in juju 2.3.1.

Using

Create a file, cloudinit-userdata.yaml, which starts with the cloudinit-userdata key and data you wish to include in the cloudinit file. Note: juju reads the value as a string, though formatted as yaml.
  juju model-config cloudinit-userdata.yaml
  juju model-config cloudinit-userdata
sample yaml:
cloudinit-userdata: |
  packages:
    - 'python-keystoneclient'
    - 'python-glanceclient'

Revision history for this message
Heather Lanigan (hmlanigan) wrote :
Changed in juju:
status: Triaged → Fix Released
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

\o/

tags: added: docteam
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.