Details
- Reviewers
olasd - Group Reviewers
System administrators - Maniphest Tasks
- T4415: Improve indexer workers performance
- Commits
- rSPSITE580c7688b33b: Add waagent profile to azure worker role
bin/octo on indexer-workers adapts the swap configuration:
$ $SWH_PUPPET_ENVIRONMENT_HOME/bin/octocatalog-diff vault-worker01.euwest.azure.internal.softwareheritage.org ... ******************************************* + File[/etc/waagent.conf] => parameters => "ensure": "present", "group": "root", "mode": "0644", "owner": "root" ******************************************* + File_line[ResourceDisk.EnableSwap] => parameters => "ensure": "present", "line": "ResourceDisk.EnableSwap=y", "match": "^ResourceDisk.EnableSwap=n", "path": "/etc/waagent.conf" ******************************************* + File_line[ResourceDisk.SwapSizeMB] => parameters => "ensure": "present", "line": "ResourceDisk.SwapSizeMB=14336", "match": "^ResourceDisk.SwapSizeMB=0", "path": "/etc/waagent.conf" ******************************************* *** End octocatalog-diff on indexer-worker01.euwest.azure.internal.softwareheritage.org
bin/octo on azure worker without configuration manages the waagent.conf without activating swap:
$ $SWH_PUPPET_ENVIRONMENT_HOME/bin/octocatalog-diff vault-worker01.euwest.azure.internal.softwareheritage.org ... ******************************************* + File[/etc/waagent.conf] => parameters => "ensure": "present", "group": "root", "mode": "0644", "owner": "root" ******************************************* + File_line[/etc/waagent.conf-ResourceDisk.EnableSwap] => parameters => "ensure": "present", "line": "ResourceDisk.EnableSwap=n", "match": "^ResourceDisk\\.EnableSwap=", "path": "/etc/waagent.conf" ******************************************* + File_line[/etc/waagent.conf-ResourceDisk.SwapSizeMB] => parameters => "ensure": "present", "line": "ResourceDisk.SwapSizeMB=0", "match": "^ResourceDisk\\.SwapSizeMB=", "path": "/etc/waagent.conf" ******************************************* *** End octocatalog-diff on vault-worker01.euwest.azure.internal.softwareheritage.org
Diff Detail
- Repository
- rSPSITE puppet-swh-site
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Let's use file_line resources instead of using a template which will be out of date 28 seconds after the change is pushed.
Let's use file_line resources instead of using a template which will be out of date 28 seconds after the change is pushed.
lol, ok.
i'm assuming then that the last line will have the expected values (when there is redundant configuration line).
i'm assuming then that the last line will have the expected values (when there is redundant configuration line).
It's not an append-only mode. It's more of a sed-i like behavior so even better.
I would suggest only matching on line beginnings, so that we can update the values and possibly disable swap if we find it problematic.
I've added escaping of the regexps.
site-modules/profile/manifests/swh/deploy/waagent.pp | ||
---|---|---|
1 ↗ | (On Diff #29507) | This should be a top-level profile (e.g. profile::waagent), as it has nothing to do with swh stuff |
5–33 ↗ | (On Diff #29507) | Escape the regexps, and ensure that we disable swap if the setting disappears |
Adapt according to review to:
- also allow swap deactivation if needed
- escape regexp pattern matching