-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scope parameter to systemd #40179
Conversation
The test
|
Hello and thank you for the pull request! I'm a little concerned that this breaks backwards compatibility and it could have unexpected implications for users. Is there any approach to this that you can think of which would keep backwards compatibility and offer the fix? |
@@ -48,12 +48,13 @@ | |||
type: bool | |||
default: 'no' | |||
aliases: [ daemon-reload ] | |||
user: | |||
scope: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with adding scope, but user should be deprecated, not removed and the interaction between both handled, with scope having precedence when set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see in the documentation, but is there a standard way of makring something as deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add a note about deprecation in the description (and point to scope
) and call module.deprecate()
if it is set, our normal deprecation cycle is 4 versions, so if this goes in now (2.7) it should be removed in (2.11 or equivalent)
@hi117 just ran into this need. Any progress here? |
The test
|
I made the changes you suggested @bcoca, let me know if any other changes are needed. |
SUMMARY
This change changes the user: paramater into a state: paramater with the following choices:
with system being the default. The system scope is the default scope. The user scope matches with the old user: paramater. The global scope applies to all users.
An example use case would be masking a unit. In the system scope it would create the mask via symlink from /etc/systemd/system/. In the user scope it would mask via symlink from ~/.config/systemd/user/. In the global scope it would mask via symlink from /etc/systemd/user/.
Previously a global: paramater was tested but since global is a keyword in python, it caused errors during testing. Since this patch removes the old user: paramater, it is a backwards incompatible change.
Fixes #38828
ISSUE TYPE
COMPONENT NAME
systemd
ANSIBLE VERSION
ADDITIONAL INFORMATION
Output of make tests-nonet, snipped to only the relavent tests.