-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Fix using the default network manager in reset.yml #11678
Fix using the default network manager in reset.yml #11678
Conversation
Hi @KubeKyrie. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
f1c8098
to
0df2560
Compare
Test results:
|
@KubeKyrie Thanks for the PR, but pre-commit has some failed messages. Could you check for this? |
4974282
to
9b523bc
Compare
/ok-to-test |
@tico88612 Ok, Thanks. |
Great Idea, Thanks @KubeKyrie |
roles/reset/tasks/main.yml
Outdated
vars: | ||
network_services: | ||
- NetworkManager | ||
- systemd-networkd | ||
- networking | ||
- network |
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.
drop this var and just specify the list directly in the loop below.
roles/reset/tasks/main.yml
Outdated
block: | ||
- name: Gather active network services | ||
# noqa command-instead-of-module | ||
command: systemctl is-active {{ item }} |
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.
You can use the systemd module with only name to check for status.
systemd:
name: <service>
register: service
service.status.ActivateState == 'active'
roles/reset/tasks/main.yml
Outdated
systemd: | ||
name: "{{ item.item }}" | ||
state: restarted | ||
loop: "{{ service_status.results }}" |
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.
loop: "{{ service_status.results }}" | |
loop: "{{ service_status.results | selectattr('status.ActiveState', '==', 'active') | map(attribute='item' }}" |
+ drop the when
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.
Hello @KubeKyrie
Would you please check it?
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.
Ok, thanks, I will check it.
78bebbc
to
e3eca66
Compare
/cc @tico88612 |
Signed-off-by: KubeKyrie <[email protected]>
e3eca66
to
87f1efd
Compare
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.
Thank you!
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: KubeKyrie, tico88612, yankay The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…1678) * enhance reset network service Signed-off-by: KubeKyrie <[email protected]> * reset network service: use systemd module directly --------- Signed-off-by: KubeKyrie <[email protected]> Co-authored-by: Max Gautier <[email protected]>
What type of PR is this?
/kind bug
What this PR does / why we need it:
Restart network using the active network management service. Not the one that are default for the OS.
Which issue(s) this PR fixes:
Fixes #11579
Special notes for your reviewer:
Does this PR introduce a user-facing change?: