Skip to content

Instantly share code, notes, and snippets.

@dshcherb
Last active March 5, 2017 23:30
Show Gist options
  • Save dshcherb/a5f8dd27af74b38d483c1715994caed3 to your computer and use it in GitHub Desktop.
Save dshcherb/a5f8dd27af74b38d483c1715994caed3 to your computer and use it in GitHub Desktop.
# this is an example of how to use aliases to avoid making yaml too large
# just by using language features of yaml and a parser support without
# relying on juju at all
# this was done for charm-helpers, see:
# charmhelpers/fetch/__init__.py
# def configure_sources
# and
# charmhelpers/fetch/ubuntu.py
# def add_source
# specifically, bacause charm-helpers require you to embed a yaml list
# into a bundle string parameter:
# 'Configure multiple sources from charm configuration.
# The lists are encoded as yaml fragments in the configuration.
# The fragment needs to be included as a string. Sources and their
# corresponding keys are of the types supported by add_source().'
variables:
# an alias defined for a multi-line string, followed
# by an actual one-item list with a multi-line item containing
# a colon (":") which would be interpreted by the second yaml
# parser invocation if not for '|'. In this case the colon is a part
# of a public key, therefore, we want to ignore it for parsing.
# Note the indentation: a string has to be on the same level as the pipe
install-keys: &install-keys |-
- |
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFi8bCkBEADUSzoSTnncPPgqPMIR9wRuA4LZtzOj98MeuWj5UE+E2DiqRJ9c
TlPmm2nWJe573ivDuOeTv3MHoe46vazKTYoqC8A6BPuATZ1UhhGCKOp904Uc4A1y
B+tmyactelk5mN1izTpFiL53NJY/dccCN5obddA7tlHTXmkK0sRH1jNxWCJ938D+
TNOiFzmIr0LeOIzjO/S+lBFa8vnzlphzs1OxrKUYEcq5WX7sI8OguefC52a67U/S
vqkB4A3nuSRmTxUddm6ijbitszQ60S2s7wbzwVliG6XLYSO5mutHUKZQwAfjTeDi
2Y35Lw3yZ4qY+wjg0p9iX9ctZtJC94oX8bNOFggWWuXnG8PYXmxJLMlVMnkA/rEi
HDivI6sFSVVQ3gVXQ7tq726e+TyZui76NLsaFsXzALJzhf43MbeSZqr4U4Nms3l1
syv3IGya5+0/xx9c0iDdvYIn+/luU0ku25Ckk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P PUBLIC KEY BLOCK-----
install-sources: &install-sources |
- "deb http://10.5.0.3/contrail/repo /"
# now use these aliases by using '*'
services:
contrail-configuration:
charm: cs:~sdn-charmers/trusty/contrail-configuration
options:
install-sources: *install-sources
install-keys: *install-keys
cassandra-units: 1
openstack-origin: cloud:trusty-mitaka
num_units: 1
contrail-control:
charm: cs:~sdn-charmers/trusty/contrail-control
options:
install-sources: *install-sources
install-keys: *install-keys
num_units: 1
contrail-analytics:
charm: cs:~sdn-charmers/trusty/contrail-analytics
options:
install-sources: *install-sources
install-keys: *install-keys
cassandra-units: 1
kafka-units: 1
num_units: 1
contrail-webui:
charm: cs:~sdn-charmers/trusty/contrail-webui
options:
install-sources: *install-sources
install-keys: *install-keys
num_units: 1
neutron-api-contrail:
charm: cs:~sdn-charmers/trusty/neutron-api-contrail
options:
install-sources: *install-sources
install-keys: *install-keys
num_units: 0
neutron-contrail:
charm: cs:~sdn-charmers/trusty/neutron-contrail
options:
install-sources: *install-sources
install-keys: *install-keys
num_units: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment