feat: restructure repository as ansible collection

BREAKING CHANGE: Repository restructure from Ansible Role to Ansible Collection

!37
This commit is contained in:
2024-03-13 19:14:08 +09:30
parent 27eaff7547
commit b063db8dc1
37 changed files with 138 additions and 42 deletions

View File

@ -0,0 +1,53 @@
---
- name: "restart ContainerD"
service:
name: containerd
state: restarted
when: >
containerd_config.changed | default(false) | bool
and
containerd_installed.rc | default(1) | int == 0
and
kubernetes_type == 'k8s'
tags:
- configure
- install
- name: Restart Kubernetes
ansible.builtin.service:
name: |-
{%- if kubernetes_type == 'k3s' -%}
{%- if Kubernetes_Master | default(false) | bool -%}
k3s
{%- else -%}
k3s-agent
{%- endif -%}
{%- else -%}
kubelet
{%- endif %}
state: restarted
listen: kubernetes_restart
when: |-
not (
nfc_kubernetes_no_restart
or
(
inventory_hostname in groups['kubernetes_master']
and
nfc_kubernetes_no_restart_master
)
or
(
inventory_hostname == kubernetes_config.cluster.prime.name
and
nfc_kubernetes_no_restart_prime
)
or
(
inventory_hostname in groups['kubernetes_worker']
and
nfc_kubernetes_no_restart_slave
)
)