Created
December 12, 2017 12:02
-
-
Save hodrigohamalho/68fd4e2b4c3d5a9013017d0f9f6a109b to your computer and use it in GitHub Desktop.
lab01 - create nfs volumes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ROOT_NFS=/exports | |
| NFS_CONFIG_FILE=/etc/exports.d/openshift-ansible.exports | |
| // CHANGE IT! | |
| HOST=support1.54d2.internal | |
| create-nfs(){ | |
| DIR=$1 | |
| if [ ! -d $ROOT_NFS/$DIR ]; then | |
| mkdir -p "$ROOT_NFS/$DIR" | |
| fi | |
| chown -R nfsnobody: "$ROOT_NFS/$DIR" | |
| chmod 777 "$ROOT_NFS/$DIR" | |
| cont=$(grep "$ROOT_NFS/$DIR" $NFS_CONFIG_FILE|wc -l) | |
| if [ $cont -eq 0 ]; then | |
| echo "$ROOT_NFS/$DIR *(rw,root_squash)" >> $NFS_CONFIG_FILE | |
| exportfs -a | |
| else | |
| echo "Directory $DIR already exists on $NFS_CONFIG_FILE. Skipping creation..." | |
| fi | |
| } | |
| for i in {1..50};do | |
| create-nfs pv$i | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
execute it inside your support1 machine!!!