Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
devops-intern-labs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Nam
devops-intern-labs
Commits
08624ea2
Commit
08624ea2
authored
Jan 15, 2024
by
Vũ Hoàng Nam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Ansbible playbooks for config NFS-server in Ubuntu.
parent
f090b339
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
0 deletions
+83
-0
~$Chuong-trinh-dao-tao-thuc-tap-sinh-smarthome-platform-devops.xlsx
...rinh-dao-tao-thuc-tap-sinh-smarthome-platform-devops.xlsx
+0
-0
pod.yml
Week6/pod.yml
+7
-0
README.md
Week7/README.md
+1
-0
ansible.cfg
Week7/ansible-playbook/ansible.cfg
+3
-0
inventory.ini
Week7/ansible-playbook/inventory.ini
+5
-0
nfs-config.j2
Week7/ansible-playbook/nfs-config.j2
+6
-0
nfs-setup.yml
Week7/ansible-playbook/nfs-setup.yml
+43
-0
nfs-pv.yml
Week7/nfs-pv.yml
+18
-0
No files found.
Documents/~$Chuong-trinh-dao-tao-thuc-tap-sinh-smarthome-platform-devops.xlsx
0 → 100644
View file @
08624ea2
File added
Week6/pod.yml
View file @
08624ea2
...
...
@@ -11,3 +11,10 @@ spec:
image
:
nigelpoulton/k8sbook:1.0
ports
:
-
containerPort
:
8080
resources
:
requests
:
memory
:
"
128Mi"
cpu
:
"
500m"
limits
:
memory
:
"
512Mi"
cpu
:
"
1000m"
\ No newline at end of file
Week7/README.md
0 → 100644
View file @
08624ea2
### Connect Minikube to NFS server
Week7/ansible-playbook/ansible.cfg
0 → 100644
View file @
08624ea2
[defaults]
inventory=inventory.ini
private_key_file=~/.ssh/ansible
Week7/ansible-playbook/inventory.ini
0 → 100644
View file @
08624ea2
[nfs]
192.168.67.9
[nfs:vars]
ansible_user
=
jay
\ No newline at end of file
Week7/ansible-playbook/nfs-config.j2
0 → 100644
View file @
08624ea2
# To connect NFS server from MacOS
# Set the 'insecure', 'all-squash', 'anonuid' and 'anongid' options in the /etc/exports file
# Use the full 'nfs://[server-IP]/path/nfs_share_dir' path in Finder's Connect to Server
{{ nfs_share_dir }} {{ subnet_ip }}(rw,all_squash,sync,no_subtree_check,anonuid=65534,anongid=65534,insecure)
\ No newline at end of file
Week7/ansible-playbook/nfs-setup.yml
0 → 100644
View file @
08624ea2
---
-
name
:
Set up a NFS server in ubuntu
hosts
:
all
become
:
true
vars
:
subnet_ip
:
192.168.67.0/24
nfs_share_dir
:
/var/nfs/k8s
tasks
:
-
name
:
Install nfs-kernel-server
ansible.builtin.apt
:
name
:
nfs-kernel-server
state
:
present
-
name
:
Create share dicrectory
ansible.builtin.file
:
path
:
/var/nfs/k8s
state
:
directory
mode
:
'
0777'
-
name
:
Change ownership of a directory
ansible.builtin.file
:
path
:
/var/nfs/k8s
state
:
directory
recurse
:
true
owner
:
nobody
group
:
nogroup
-
name
:
Config the NFS
ansible.builtin.template
:
src
:
nfs-config.j2
dest
:
/etc/exports
owner
:
root
group
:
root
mode
:
'
0644'
notify
:
Restart nfs-kernel-server service
handlers
:
-
name
:
Restart nfs-kernel-server service
ansible.builtin.service
:
name
:
nfs-kernel-server
state
:
restarted
Week7/nfs-pv.yml
0 → 100644
View file @
08624ea2
apiVersion
:
v1
kind
:
PersistentVolume
metadata
:
name
:
nfs-pv
spec
:
capacity
:
storage
:
1Gi
volumeMode
:
Filesystem
accessModes
:
-
ReadWriteOnce
persistentVolumeReclaimPolicy
:
Recycle
storageClassName
:
slow
mountOptions
:
-
hard
-
nfsvers=4.1
nfs
:
path
:
/tmp
server
:
172.17.0.2
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment