aboutsummaryrefslogtreecommitdiffstats
path: root/firstboot/userdata_dev_rsync.yaml
blob: d412b93a333850bf998a5ba71bdc9861fd27026a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
heat_template_version: ocata

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}