Unclear how to set model-defaults from a file

Bug #1972001 reported by dann frazier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Heather Lanigan

Bug Description

Version: 2.9.29-ubuntu-amd64

I would like to be able to replace by model-defaults using a file as input. The model-defaults help text makes it sound like this is possible:

"""
Model defaults yaml configuration can be piped from stdin from the output of
the command stdout. Some model-defaults configuration are read-only, to prevent
the command exiting on read-only fields, setting "ignore-read-only-fields" will
cause it to skip over the fields when they're encountered.
"""

My reading of that is that I should be able to do something like:

juju model-defaults > model.defaults
$EDITOR model-defaults
juju model-dfeaults < model.defaults

However, this doesn't seem to work in practice. Here's my trying to change my default-series using that method:

$ juju model-defaults > model.defaults
$ grep focal model.defaults
default-series focal -
$ sed -i 's/focal/bionic/' model.defaults
$ grep default-series model.defaults
default-series bionic -
$ juju model-defaults < model.defaults
Attribute Default Controller
agent-metadata-url "" -
agent-stream released -
apt-ftp-proxy "" -
[...]
$ juju model-defaults | grep default-seri
default-series focal -
$

Of course, I know I can change individual model-default values, but I'm looking for a way to load them from a file all at once w/o caring which ones actually have different values.

Revision history for this message
Heather Lanigan (hmlanigan) wrote :

The `juju help model-defaults` has two examples of using a file:

juju model-defaults us-east-1 path/to/file.yaml
juju model-defaults us-east-1 ftp-proxy=10.0.0.1:8000 path/to/file.yaml

Granted, they are hidden in a list of many examples without explanation of what they are, we can definitely improve that. It is better described in `juju help model-config`.

tags: added: bitesize usability
Changed in juju:
status: New → Triaged
Revision history for this message
Heather Lanigan (hmlanigan) wrote :

While we're at it, `juju help controller-config` could use the same updates.

Revision history for this message
Heather Lanigan (hmlanigan) wrote :
Changed in juju:
status: Triaged → In Progress
importance: Undecided → Medium
assignee: nobody → Heather Lanigan (hmlanigan)
milestone: none → 2.9.31
Caner Derici (cderici)
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
milestone: 2.9.31 → 2.9.30
milestone: 2.9.30 → 2.9.31
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.