mirror of https://github.com/easzlab/kubeasz.git
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
# 系统基础软件环境
|
||
- name: apt更新缓存刷新
|
||
apt: update_cache=yes cache_valid_time=72000
|
||
ignore_errors: true
|
||
when: 'INSTALL_SOURCE != "offline"'
|
||
|
||
# 删除默认安装
|
||
- name: 删除ubuntu默认安装
|
||
package:
|
||
name:
|
||
- ufw
|
||
- lxd
|
||
- lxcfs
|
||
- lxc-common
|
||
state: absent
|
||
ignore_errors: true
|
||
|
||
# 安装基础软件包
|
||
- name: 安装 ubuntu/debian基础软件
|
||
package:
|
||
name:
|
||
- conntrack # network connection cleanup 用到
|
||
- jq # 轻量JSON处理程序,安装docker查询镜像需要
|
||
- libseccomp2 # 安装containerd需要
|
||
- nfs-common # 挂载nfs 共享文件需要 (创建基于 nfs的PV 需要)
|
||
state: present
|
||
when: 'INSTALL_SOURCE != "offline"'
|
||
|
||
# 离线安装基础软件包
|
||
- import_tasks: offline.yml
|
||
when: 'INSTALL_SOURCE == "offline"'
|
||
|
||
# 优化设置 journal 日志相关,避免日志重复搜集,浪费系统资源
|
||
- name: 准备 journal 日志相关目录
|
||
file: name={{ item }} state=directory
|
||
with_items:
|
||
- "/etc/systemd/journald.conf.d"
|
||
- "/var/log/journal"
|
||
|
||
- name: 优化设置 journal 日志
|
||
template: src=95-k8s-journald.conf.j2 dest=/etc/systemd/journald.conf.d/95-k8s-journald.conf
|
||
|
||
- name: 重启 journald 服务
|
||
service: name=systemd-journald state=restarted
|