你好,我想部署一个捆绑包,它bundle.yaml
看起来像这样:
series: trusty
services:
testcharm:
charm: "./trusty/testcharm"
num_units: 1
to:
- "0"
neo4j:
charm: "./trusty/test_neo4j"
num_units: 1
to:
- "1"
relations:
- - "neo4j:db"
- "testcharm:db"
machines:
"0":
series: trusty
constraints: "arch=amd64 cpu-cores=1 cpu-power=100 mem=1740 root-disk=8192"
"1":
series: trusty
constraints: "arch=amd64 cpu-cores=1 cpu-power=100 mem=1740 root-disk=8192"
现在我需要更改我config.yaml
的 testcharm,因为我添加的选项在每个模型中都不同。有没有办法在包中添加特定服务的配置选项,以便使用该选项进行部署?
答案1
您可以使用它options:
来bundle.yaml
为特定的魅力添加特定的配置值。
series: trusty
services:
testcharm:
charm: "./trusty/testcharm"
num_units: 1
to:
- "0"
options:
config-option: "config value"
neo4j:
charm: "./trusty/test_neo4j"
num_units: 1
to:
- "1"
options:
port: "7474"
relations:
- - "neo4j:db"
- "testcharm:db"
machines:
"0":
series: trusty
constraints: "arch=amd64 cpu-cores=1 cpu-power=100 mem=1740 root-disk=8192"
"1":
series: trusty
constraints: "arch=amd64 cpu-cores=1 cpu-power=100 mem=1740 root-disk=8192"
我编辑了。如果您的 neo4j 中bundle.yaml
有选项,您可以使用上面包中的选项覆盖该值。port
config.yaml