Ansible Script 추가
This commit is contained in:
45
ansible/01_old/roles/kubernetes_install/tasks/os-runtime.yml
Normal file
45
ansible/01_old/roles/kubernetes_install/tasks/os-runtime.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
- name: Add docker apt key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg
|
||||
|
||||
|
||||
- name: Add docker apt repository
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
|
||||
filename: docker
|
||||
register: containerd_apt_repo_task
|
||||
|
||||
- name: apt update
|
||||
apt:
|
||||
update_cache: yes
|
||||
when: containerd_apt_repo_task.changed
|
||||
|
||||
- name: Create containerd configuration directory
|
||||
file:
|
||||
path: /etc/containerd
|
||||
state: directory
|
||||
|
||||
- name: Configure containerd
|
||||
template:
|
||||
src: config.toml.j2
|
||||
dest: /etc/containerd/config.toml
|
||||
notify:
|
||||
- Restart containerd service
|
||||
|
||||
- name: Install required packages
|
||||
apt:
|
||||
name:
|
||||
- containerd.io
|
||||
notify:
|
||||
- Reload systemd configuration
|
||||
- Restart containerd service
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: Enable containerd service
|
||||
service:
|
||||
name: containerd
|
||||
enabled: True
|
||||
state: started
|
||||
|
||||
Reference in New Issue
Block a user