| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- ---
- - name: Add cloud rpm repository
- shell: |
- cat > /etc/yum.repos.d/yunion.repo <<-'EOF'
- [yunion-repo-uos-kongzi]
- name=Packages for Yunion Multi-Cloud Platform -
- baseurl=https://iso.yunion.cn/centos/7/3.10/{{ansible_architecture}}
- sslverify=0
- enabled=1
- gpgcheck=0
- EOF
- become: yes
- when:
- - is_uos_kongzi is defined
- - name: Check containerd status
- command: systemctl is-active containerd
- register: containerd_status
- failed_when: false
- - name: Take action if containerd stopped
- block:
- - name: get containerd
- get_url:
- url: "https://iso.yunion.cn/uos/kongzi/3.10/{{ ansible_architecture}}/containerd-1.7.2-linux.tar.gz"
- dest: /tmp/containerd-1.7.2-linux.tar.gz
- force: yes
- validate_certs: no
- - name: install containerd
- shell: |
- mkdir -p /usr/local/containerd
- tar xzvf /tmp/containerd-1.7.2-linux.tar.gz -C /usr/local/containerd
- for i in /usr/local/containerd/bin/*
- do
- ln -sf $i /usr/bin/
- done
- cat > /usr/lib/systemd/system/containerd.service <<-EOF
- [Unit]
- Description=containerd container runtime
- Documentation=https://containerd.io
- After=network.target local-fs.target
- [Service]
- ExecStartPre=-/sbin/modprobe overlay
- ExecStart=/usr/bin/containerd
- Type=notify
- Delegate=yes
- KillMode=process
- Restart=always
- RestartSec=5
- # Having non-zero Limit*s causes performance problems due to accounting overhead
- # in the kernel. We recommend using cgroups to do container-local accounting.
- LimitNPROC=infinity
- LimitCORE=infinity
- LimitNOFILE=infinity
- # Comment TasksMax if your systemd version does not supports it.
- # Only systemd 226 and above support this version.
- TasksMax=infinity
- OOMScoreAdjust=-999
- [Install]
- WantedBy=multi-user.target
- EOF
- systemctl daemon-reload
- systemctl enable --now containerd
- systemctl is-active containerd
- args:
- executable: /bin/bash
- become: yes
- when:
- - containerd_status.stdout != "active"
- - name: Include RedHat Family Common Tasks
- include_tasks: redhat.yml
|