diff --git a/docs/guide/nfs-server.md b/docs/guide/nfs-server.md index e1fa6d8..1efdc29 100644 --- a/docs/guide/nfs-server.md +++ b/docs/guide/nfs-server.md @@ -59,6 +59,11 @@ Ubuntu 16.04,首先需要安装 `nfs-common` 包 ``` bash apt install nfs-common ``` +CentOS 7, 需要安装 `nfs-utils` 包 + +``` bash +yum install nfs-utils +``` 使用 mount 命令来挂载其他机器共享的 NFS 目录。可以在终端提示符后输入以下类似的命令: diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index fb39192..4c0db51 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -30,21 +30,7 @@ shell: systemctl daemon-reload && systemctl enable docker && systemctl restart docker ## 可选 ------安装docker查询镜像 tag的小工具---- -# 先拉取下节点的ansible setup信息,起到缓存效果,否则后续when 判断可能失败 -- name: 缓存ansilbe setup信息 - setup: gather_subset=min - tags: docker-tag - -- name: apt安装轻量JSON处理程序 - apt: name=jq state=latest - when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16" - tags: docker-tag - -- name: yum安装轻量JSON处理程序 - yum: name=jq state=latest - when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" - tags: docker-tag - +# 先要安装轻量JSON处理程序‘jq’,已在 prepare 节点安装 - name: 下载 docker-tag copy: src=docker-tag dest={{ bin_dir }}/docker-tag mode=0755 tags: docker-tag diff --git a/roles/prepare/tasks/main.yml b/roles/prepare/tasks/main.yml index c94dde5..94f55a7 100644 --- a/roles/prepare/tasks/main.yml +++ b/roles/prepare/tasks/main.yml @@ -44,6 +44,14 @@ - lxcfs - lxc-common +# Ubuntu 安装基础软件包 +- name: 安装 ubuntu基础软件 + when: ansible_distribution == "Ubuntu" + apt: name={{ item }} state=latest + with_items: + - jq # 轻量JSON处理程序,安装docker查询镜像需要 + - nfs-common # 挂载nfs 共享文件需要 (创建基于 nfs的PV 需要) + - block: - name: 删除centos默认安装 yum: name={{ item }} state=absent @@ -52,12 +60,11 @@ - python-firewall - firewalld-filesystem - name: 安装基础软件包 - yum: name={{ item }} state=installed + yum: name={{ item }} state=latest with_items: - - vim - - git - - wget - - psmisc # 安装psmisc 才能使用命令killall,它在keepalive的监测脚本中使用到 + - jq # 轻量JSON处理程序,安装docker查询镜像需要 + - psmisc # 安装psmisc 才能使用命令killall,它在keepalive的监测脚本中使用到 + - nfs-utils # 挂载nfs 共享文件需要 (创建基于 nfs的PV 需要) - net-tools - bash-completion - name: 临时关闭 selinux