Skip to content

About

Build cloud-init.yamls from multiple files

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

cloud-init-builder

Build cloud-init.yamls from multiple files

usage

  1. create a cloud-init.tmpl.yaml containing #include: <relative-base-dir> lines e.g.

    #cloud-config
    fqdn: host.example.com
    
    write_files:
      #include: write_files/ << THIS IS KEY
    apt:
      sources:
        salt.sources:
          source: "deb https://packages.broadcom.com/artifactory/saltproject-deb stable main"
          key: |
            -----BEGIN PGP PUBLIC KEY BLOCK-----
            -----END PGP PUBLIC KEY BLOCK-----
    
    package_update: true
    package_upgrade: true
    package_reboot_if_required: true
    
    packages:
      - salt-minion
    
    runcmd:
      - salt-call --local state.apply
  2. go run main.go <directory where cloud-init.tmpl.yaml lives>

    or

    cloud-init-builder[platform] <directory where cloud-init.tmpl.yaml lives>

    if you built the Go file or downloaded the release

    1. the program goes through all files until the bottom of the specified directory
    2. for each file, it will inlcude the content, keeping the indentation of the comment
    3. send the expanded file to stdout
  3. pipe or send the output to an editor or file

build-release

  1. run .\build-release.ps1 -BinaryName cloud-init-builder -PackagePath ./src/main.go
  2. run (untested) .\build-release.bash -b cloud-init-builder -p ./src/main.go

About

Build cloud-init.yamls from multiple files

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages