tripleo-heat-templates/firstboot/userdata_dev_rsync.yaml
ramishra c9991c2e31 Use 'wallaby' heat_template_version
With I57047682cfa82ba6ca4affff54fab5216e9ba51c Heat has added
a new template version for wallaby. This would allow us to use
2-argument variant of the ``if`` function that would allow for
 e.g. conditional definition of resource properties and help
cleanup templates. If only two arguments are passed to ``if``
function, the entire enclosing item is removed when the condition
is false.

Change-Id: I25f981b60c6a66b39919adc38c02a051b6c51269
2021-03-31 17:35:12 +05:30

50 lines
1.3 KiB
YAML

heat_template_version: wallaby
description: >
This is first boot configuration for development purposes. It allows
overriding contents of the deployed images via rsync before
configuration (e.g. Puppet) starts, speeding up the feedback loop
between making a change and seeing it applied.
To prepare the host, put something like this to /etc/rsyncd.conf:
[overcloudsync]
path = /root/overcloudsync
comment = overcloud pre-puppet customizations
Then run `rsync --daemon`.
parameters:
dev_rsync_host:
type: string
default: 192.168.122.1
description: Host to sync contents from via rsync
dev_rsync_module:
type: string
default: overcloudsync
description: Name of the module defined in rsyncd.conf on rsync_host
resources:
userdata:
type: OS::Heat::MultipartMime
properties:
parts:
- config: {get_resource: rsync_config}
subtype: 'x-shellscript'
rsync_config:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
template: |
#!/bin/bash
rsync -avr rsync://RSYNC_HOST/RSYNC_MODULE /
params:
RSYNC_HOST: {get_param: dev_rsync_host}
RSYNC_MODULE: {get_param: dev_rsync_module}
outputs:
OS::stack_id:
value: {get_resource: userdata}