标签:nfs 一键安装 批量
一键安装nfs服务
#install nfs_server - hosts: 172.16.1.31 服务端 tasks: -name: installnfs-utils rpcbind yum: name=nfs-utils,rpcbind -name: copyconffile copy: src=/etc/ansible/nfs_conf/exports dest=/etc/exports #将nfs配置文件配置好直接发送过去 -name: createuser_www user: name=www createhome=no shell=/sbin/nologinuid=888 -name: create dirdata file: dest=/data state=directory owner=www group=www -name: startrpc_server shell: /etc/init.d/rpcbind start -name: startnfs_server shell: /etc/init.d/nfs start - hosts: 172.16.1.41 客户端 tasks: -name: install nfsrpc rpcbind yum: name=nfs-utils,rpcbind -name: createuser_www user: name=www createhome=no shell=/sbin/nologinuid=888 -name: mountdata_dir mount: name=/mnt src=172.16.1.31:/data fstype=nfs state=mounted
本文出自 “每天一小步” 博客,请务必保留此出处http://fenyuer.blog.51cto.com/11265169/1963177
标签:nfs 一键安装 批量
原文地址:http://fenyuer.blog.51cto.com/11265169/1963177