1 heat_template_version: pike
3 # NOTE: You don't need to pass the parameter explicitly from the
4 # parent template, it can be specified via the parameter_defaults
5 # in the resource_registry instead, if you want to override the default
6 # and/or share values with other templates in the tree.
13 This is an example showing how you can do firstboot configuration
14 of the nodes via cloud-init. To enable this, replace the default
15 mapping of OS::TripleO::NodeUserData in ../overcloud_resource_registry*
19 type: OS::Heat::MultipartMime
22 - config: {get_resource: user_config}
23 - config: {get_resource: ssh_config}
25 # Get cloud-init to create an extra user, in addition to the default for the
26 # distro. Note there are various options, including configuring ssh keys,
27 # but atm I can only see how to specify the keys explicitly, not via metadata
29 type: OS::Heat::CloudConfig
34 - name: {get_param: extra_username}
36 # Setup ssh key for the extra user to match the key installed for the default
37 # user, e.g that provided via the nova keypair on instance boot
39 type: OS::Heat::SoftwareConfig
45 mkdir -p /home/$user/.ssh
46 chmod 700 /home/$user/.ssh
47 os-apply-config --key public-keys.0.openssh-key --type raw > /home/$user/.ssh/authorized_keys
48 chmod 600 /home/$user/.ssh/authorized_keys
49 chown -R $user:$user /home/$user/.ssh
51 $user: {get_param: extra_username}
54 # This means get_resource from the parent template will get the userdata, see:
55 # http://docs.openstack.org/developer/heat/template_guide/composition.html#making-your-template-resource-more-transparent
56 # Note this is new-for-kilo, an alternative is returning a value then using
57 # get_attr in the parent template instead.
59 value: {get_resource: userdata}