Skip to content

schema: add JSON defs for modules resize-salt (SC-654)#1341

Merged
blackboxsw merged 3 commits into
canonical:mainfrom
TheRealFalcon:schema-resize-salt
Mar 23, 2022
Merged

schema: add JSON defs for modules resize-salt (SC-654)#1341
blackboxsw merged 3 commits into
canonical:mainfrom
TheRealFalcon:schema-resize-salt

Conversation

@TheRealFalcon
Copy link
Copy Markdown
Contributor

Proposed Commit Message

schema: add JSON defs for modules resize-salt

Includes:
 - cc_resizefs
 - cc_resolv_conf
 - cc_rh_subscription
 - cc_rightscale_userdata
 - cc_rsyslog
 - cc_runcmd
 - cc_salt_minion

Additional Context

There's a legacy syntax for rsyslog that became legacy 6 years ago. It will still work but I removed all references to it, don't include it in the schema, and log a warning if it's used as it was already considered legacy 6 years ago.

Additionally, I'm not exactly sure what's needed for rightscale userdata. The context around it makes it sound like it's a value embedded within other yaml, rather being standard yaml itself, but I'm hoping somebody else has some additional context there.

Also, Rightscale and Salt don't even exist as independent entities anymore, but I'm assuming their modules can still be used by those who bought the technology.

Includes:
 - cc_resizefs
 - cc_resolv_conf
 - cc_rh_subscription
 - cc_rightscale_userdata
 - cc_rsyslog
 - cc_runcmd
 - cc_salt_minion
@TheRealFalcon TheRealFalcon changed the title schema: add JSON defs for modules resize-salt schema: add JSON defs for modules resize-salt (SC-654) Mar 18, 2022
@TheRealFalcon
Copy link
Copy Markdown
Contributor Author

I've seen the flake8 errors, but I figure there'll be other comments to address, so I'll wait on those.

Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but I really don't like that rsyslog_config silently sets default values if invalid values are provided in config. It's probably worth us taking a separate bug about this for future cleanup.

All else looks pretty good for this PR so take or leave comments as you want with the exception of my question on manage_resolv_conf default value. Maybe I'm reading the code wrong there but it doesn't look like we default to True. I'll review your responses tomorrow on the rest of the items and we can close out on this branch. Thanks again

Comment thread cloudinit/config/cc_resolv_conf.py Outdated
are configured correctly.

When using a config drive and a RHEL-like system, resolv.conf will also be
managed automatically due to the available information provided for dns
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
managed automatically due to the available information provided for dns
managed automatically due to the available information provided for DNS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably want to replace dns/DNS throughout text.

Comment thread cloudinit/config/cc_resolv_conf.py Outdated
will use sysconfig, this module is likely to be of little use unless those
are configured correctly.

When using a config drive and a RHEL-like system, resolv.conf will also be
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When using a config drive and a RHEL-like system, resolv.conf will also be
When using a :ref:`datasource_config_drive` and a RHEL-like system, resolv.conf will also be

Comment thread cloudinit/config/cc_resolv_conf.py Outdated

When using a config drive and a RHEL-like system, resolv.conf will also be
managed automatically due to the available information provided for dns
servers in the config drive network format. For those that with to have
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
servers in the config drive network format. For those that with to have
servers in the :ref:`network_config_v2` format. For those that with to have

Comment on lines 34 to 36
**Config keys**::

CLOUD_INIT_REMOTE_HOOK=<url>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to

Suggested change
**Config keys**::
CLOUD_INIT_REMOTE_HOOK=<url>
**Raw user data schema**::
CLOUD_INIT_REMOTE_HOOK=<url>

Comment thread cloudinit/config/cc_rsyslog.py Outdated
Comment on lines +40 to +41
maas: "192.168.1.1"
juju: "10.0.4.1"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ditch unnecessary quotes where we can to aid in readability, simplicity of config values

Suggested change
maas: "192.168.1.1"
juju: "10.0.4.1"
maas: 192.168.1.1
juju: 10.0.4.1

Comment thread cloudinit/config/cloud-init-schema.json Outdated
"properties": {
"username": {
"type": "string",
"description": "The username to use. Must be used with password. Should not be used with activation-key or org"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown sugar for key names

Suggested change
"description": "The username to use. Must be used with password. Should not be used with activation-key or org"
"description": "The username to use. Must be used with password. Should not be used with ``activation-key`` or ``org``"

Comment thread cloudinit/config/cloud-init-schema.json Outdated
},
"password": {
"type": "string",
"description": "The password to use. Must be used with username. Should not be used with activation-key or org"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "The password to use. Must be used with username. Should not be used with activation-key or org"
"description": "The password to use. Must be used with username. Should not be used with ``activation-key`` or ``org``"

Comment thread cloudinit/config/cloud-init-schema.json Outdated
},
"activation-key": {
"type": "string",
"description": "The activation key to use. Must be used with org. Should not be used with username or password"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "The activation key to use. Must be used with org. Should not be used with username or password"
"description": "The activation key to use. Must be used with org. Should not be used with ``username`` or ``password``"

Comment thread cloudinit/config/cloud-init-schema.json Outdated
},
"org": {
"type": "integer",
"description": "The organization number to use. Must be used with activation-key. Should not be used with username or password"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "The organization number to use. Must be used with activation-key. Should not be used with username or password"
"description": "The organization number to use. Must be used with ``activation-key``. Should not be used with ``username`` or ``password``"

Comment thread cloudinit/config/cloud-init-schema.json Outdated
},
"service-level": {
"type": "string",
"description": "The service level to use when subscribing to RH repositories. auto-attach must be true for this to be used"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "The service level to use when subscribing to RH repositories. auto-attach must be true for this to be used"
"description": "The service level to use when subscribing to RH repositories. ``auto-attach`` must be true for this to be used"

Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fixes. +1

@blackboxsw blackboxsw merged commit 58fd35b into canonical:main Mar 23, 2022
@TheRealFalcon TheRealFalcon deleted the schema-resize-salt branch March 21, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants