Original: nfs software services use ansible for one-click deployment, nfsansible

Source: Internet
Author: User

Original: nfs software services use ansible for one-click deployment, nfsansible

[Root @ m01 tools] # cat nfspeizhi. sh
Cat>/etc/exports <EOF
/Data 172.16.1.0/24 (rw, sync)
EOF

 

-Hosts: 172.16.1.131 # Server
Tasks:
-Name: yum
Shell: yum install-y nfs-utils rpcbind # install nfs
-Name: yunm
Shell: yum-y install sshpass # software for installing the key
-Name: chuangjianmulu
Shell: mkdir-p/server/tools/# create the configuration file
-Name: peizhi
Copy: src =/server/tools/nfspeizhi. sh dest =/server/tools/nfspeizhi. sh
-Name: yunxingjiaoben
Script:/server/tools/nfspeizhi. sh # Run the script
-Name: guanlimulu
Shell: mkdir-p/data & chown-R nfsnobody. nfsnobody/data
-Name: qidong
Shell:/etc/init. d/rpcbind start # start
-Name: kaijiqidong
Shell: chkconfig rpcbind on & chkconfig nfs on
# Set the password file
-Hosts: 172.16.1.108
Tasks:
-Name: yum
Shell: yum install-y nfs-utils rpcbind # Client
#-Name: gui
# Shell: umount-f/mnt
-Name: guazai
Shell: mount-t nfs 172.16.1.131:/data/mnt
-Hosts: 172.16.1.141
Tasks:
-Name: yumh
Shell: yum install-y nfs-utils rpcbind # Client
#-Name: guih
# Shell: umount-f/mnt
-Name: guazaih
Shell: mount-t nfs 172.16.1.131:/data/mnt

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.