From 8208a3f04fcd6e4b3649e0ed3ed43bb6113419bd Mon Sep 17 00:00:00 2001 From: Lihai Tu <92532497+tu1h@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:11:39 +0800 Subject: [PATCH] Rename systemd module to systemd_service (#11396) Signed-off-by: tu1h --- contrib/os-services/roles/prepare/tasks/main.yml | 4 ++-- roles/bootstrap-os/tasks/clearlinux.yml | 2 +- roles/bootstrap-os/tasks/flatcar.yml | 2 +- roles/container-engine/containerd/handlers/main.yml | 2 +- roles/container-engine/containerd/tasks/main.yml | 2 +- roles/container-engine/cri-dockerd/handlers/main.yml | 2 +- roles/container-engine/cri-o/handlers/main.yml | 2 +- roles/container-engine/docker/handlers/main.yml | 2 +- roles/container-engine/docker/tasks/reset.yml | 2 +- roles/etcd/handlers/main.yml | 2 +- roles/etcd/tasks/configure.yml | 2 +- roles/kubernetes/control-plane/handlers/main.yml | 2 +- roles/kubernetes/control-plane/tasks/main.yml | 2 +- roles/kubernetes/kubeadm/handlers/main.yml | 2 +- roles/kubernetes/node/handlers/main.yml | 2 +- .../preinstall/tasks/0080-system-configurations.yml | 2 +- .../recover_control_plane/etcd/tasks/recover_lost_quorum.yml | 4 ++-- roles/reset/tasks/main.yml | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/contrib/os-services/roles/prepare/tasks/main.yml b/contrib/os-services/roles/prepare/tasks/main.yml index e95dcef15..177712e42 100644 --- a/contrib/os-services/roles/prepare/tasks/main.yml +++ b/contrib/os-services/roles/prepare/tasks/main.yml @@ -7,7 +7,7 @@ service_facts: - name: Disable service firewalld - systemd: + systemd_service: name: firewalld state: stopped enabled: no @@ -15,7 +15,7 @@ "'firewalld.service' in services and services['firewalld.service'].status != 'not-found'" - name: Disable service ufw - systemd: + systemd_service: name: ufw state: stopped enabled: no diff --git a/roles/bootstrap-os/tasks/clearlinux.yml b/roles/bootstrap-os/tasks/clearlinux.yml index de42e3cf1..2e41eaa01 100644 --- a/roles/bootstrap-os/tasks/clearlinux.yml +++ b/roles/bootstrap-os/tasks/clearlinux.yml @@ -7,7 +7,7 @@ state: present - name: Make sure docker service is enabled - systemd: + systemd_service: name: docker masked: false enabled: true diff --git a/roles/bootstrap-os/tasks/flatcar.yml b/roles/bootstrap-os/tasks/flatcar.yml index d5ecda8fa..be74150a0 100644 --- a/roles/bootstrap-os/tasks/flatcar.yml +++ b/roles/bootstrap-os/tasks/flatcar.yml @@ -26,7 +26,7 @@ ansible_interpreter_python_fallback: "{{ ansible_interpreter_python_fallback + [ '/opt/bin/python' ] }}" - name: Disable auto-upgrade - systemd: + systemd_service: name: locksmithd.service masked: true state: stopped diff --git a/roles/container-engine/containerd/handlers/main.yml b/roles/container-engine/containerd/handlers/main.yml index 1959dc991..4e7722f4f 100644 --- a/roles/container-engine/containerd/handlers/main.yml +++ b/roles/container-engine/containerd/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Containerd | restart containerd - systemd: + systemd_service: name: containerd state: restarted enabled: yes diff --git a/roles/container-engine/containerd/tasks/main.yml b/roles/container-engine/containerd/tasks/main.yml index 657d1ad75..073412cd0 100644 --- a/roles/container-engine/containerd/tasks/main.yml +++ b/roles/container-engine/containerd/tasks/main.yml @@ -136,7 +136,7 @@ meta: flush_handlers - name: Containerd | Ensure containerd is started and enabled - systemd: + systemd_service: name: containerd daemon_reload: yes enabled: yes diff --git a/roles/container-engine/cri-dockerd/handlers/main.yml b/roles/container-engine/cri-dockerd/handlers/main.yml index 3a2497916..00d00e7b2 100644 --- a/roles/container-engine/cri-dockerd/handlers/main.yml +++ b/roles/container-engine/cri-dockerd/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Cri-dockerd | reload systemd - systemd: + systemd_service: name: cri-dockerd daemon_reload: true masked: no diff --git a/roles/container-engine/cri-o/handlers/main.yml b/roles/container-engine/cri-o/handlers/main.yml index b0c5951fd..d173ce41b 100644 --- a/roles/container-engine/cri-o/handlers/main.yml +++ b/roles/container-engine/cri-o/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: CRI-O | reload systemd - systemd: + systemd_service: daemon_reload: true listen: Restart crio diff --git a/roles/container-engine/docker/handlers/main.yml b/roles/container-engine/docker/handlers/main.yml index 4a8a63948..72e95e6bf 100644 --- a/roles/container-engine/docker/handlers/main.yml +++ b/roles/container-engine/docker/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Docker | reload systemd - systemd: + systemd_service: name: docker daemon_reload: true masked: no diff --git a/roles/container-engine/docker/tasks/reset.yml b/roles/container-engine/docker/tasks/reset.yml index 40d19a4ff..725e64861 100644 --- a/roles/container-engine/docker/tasks/reset.yml +++ b/roles/container-engine/docker/tasks/reset.yml @@ -102,5 +102,5 @@ ignore_errors: true # noqa ignore-errors - name: Docker | systemctl daemon-reload # noqa no-handler - systemd: + systemd_service: daemon_reload: true diff --git a/roles/etcd/handlers/main.yml b/roles/etcd/handlers/main.yml index 33890617a..62a899945 100644 --- a/roles/etcd/handlers/main.yml +++ b/roles/etcd/handlers/main.yml @@ -3,7 +3,7 @@ import_tasks: backup.yml - name: Etcd | reload systemd - systemd: + systemd_service: daemon_reload: true listen: - Restart etcd diff --git a/roles/etcd/tasks/configure.yml b/roles/etcd/tasks/configure.yml index 6afc5eba0..4cf5387a0 100644 --- a/roles/etcd/tasks/configure.yml +++ b/roles/etcd/tasks/configure.yml @@ -68,7 +68,7 @@ when: is_etcd_master and etcd_events_cluster_setup - name: Configure | reload systemd - systemd: + systemd_service: daemon_reload: true when: is_etcd_master diff --git a/roles/kubernetes/control-plane/handlers/main.yml b/roles/kubernetes/control-plane/handlers/main.yml index 1ee64f230..be5fdffb1 100644 --- a/roles/kubernetes/control-plane/handlers/main.yml +++ b/roles/kubernetes/control-plane/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Master | reload systemd - systemd: + systemd_service: daemon_reload: true listen: Master | restart kubelet diff --git a/roles/kubernetes/control-plane/tasks/main.yml b/roles/kubernetes/control-plane/tasks/main.yml index b1e2ee2a9..5d58014e8 100644 --- a/roles/kubernetes/control-plane/tasks/main.yml +++ b/roles/kubernetes/control-plane/tasks/main.yml @@ -118,7 +118,7 @@ when: auto_renew_certificates - name: Renew K8S control plane certificates monthly 2/2 - systemd: + systemd_service: name: k8s-certs-renew.timer enabled: yes state: started diff --git a/roles/kubernetes/kubeadm/handlers/main.yml b/roles/kubernetes/kubeadm/handlers/main.yml index 9f6d4318b..261e1f2c1 100644 --- a/roles/kubernetes/kubeadm/handlers/main.yml +++ b/roles/kubernetes/kubeadm/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Kubeadm | reload systemd - systemd: + systemd_service: daemon_reload: true listen: Kubeadm | restart kubelet diff --git a/roles/kubernetes/node/handlers/main.yml b/roles/kubernetes/node/handlers/main.yml index 8195b7d06..fa08dba53 100644 --- a/roles/kubernetes/node/handlers/main.yml +++ b/roles/kubernetes/node/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Kubelet | reload systemd - systemd: + systemd_service: daemon_reload: true listen: Node | restart kubelet diff --git a/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml b/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml index c08a86e45..5b2c7d10a 100644 --- a/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml +++ b/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml @@ -138,7 +138,7 @@ - name: Disable fapolicyd service failed_when: false - systemd: + systemd_service: name: fapolicyd state: stopped enabled: false diff --git a/roles/recover_control_plane/etcd/tasks/recover_lost_quorum.yml b/roles/recover_control_plane/etcd/tasks/recover_lost_quorum.yml index 32db5799e..7c8b0e927 100644 --- a/roles/recover_control_plane/etcd/tasks/recover_lost_quorum.yml +++ b/roles/recover_control_plane/etcd/tasks/recover_lost_quorum.yml @@ -17,7 +17,7 @@ when: etcd_snapshot is defined - name: Stop etcd - systemd: + systemd_service: name: etcd state: stopped @@ -54,6 +54,6 @@ replace: '\1{{ etcd_member_name }}={{ etcd_peer_url }}' - name: Start etcd - systemd: + systemd_service: name: etcd state: started diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index 9869cbc78..6b5379e10 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -43,7 +43,7 @@ - docker - name: Reset | systemctl daemon-reload # noqa no-handler - systemd: + systemd_service: daemon_reload: true when: services_removed.changed