Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
joohanhong
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JooHan Hong
joohanhong
Commits
4df48f6d
Commit
4df48f6d
authored
Mar 08, 2021
by
JooHan Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ansible, 2021-03-08, update17
parent
2cd02a00
Pipeline
#5126
passed with stages
in 2 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
1 deletion
+85
-1
.gitkeep
ANSIBLE/OS/NFS_CLIENT/.gitkeep
+0
-0
README.md
ANSIBLE/OS/NFS_CLIENT/README.md
+83
-0
README.md
ANSIBLE/OS/README.md
+2
-1
No files found.
ANSIBLE/OS/NFS_CLIENT/.gitkeep
0 → 100644
View file @
4df48f6d
ANSIBLE/OS/NFS_CLIENT/README.md
0 → 100644
View file @
4df48f6d
[
![logo
](
https://www.hongsnet.net/images/logo.gif
)
](https://www.hongsnet.net)
# Ansible의 mount 모듈을 이용한 NFS 마운트
> NFS Client가 NFS Server의 파일시스템을 마운트를 자동화 할 수 있다.
## 주요 기능
-
Mount 시 rsize(read), wsize(write) 사이즈를 변수로 지정한다.
-
hard 옵션의 무한정 대기를 방지하기 위해 timeout 설정을 추가한다.
-
NFS-Client의 필수 패키지인 nfs-common 패키지를 설치한다.
## Inventory 설정
```
bash
# cat hosts
[
ALL_HOSTS]
172.16.0.100
managed_ip
=
172.16.0.100
des
=
"2020-12-03"
[
ALL_HOSTS_OK]
```
대상 호스트는 172.16.0.100이며, 추가는 2020-12-03에 수행한다. 참고적으로
**ALL_HOSTS_OK**
호스트 그룹은 작업이 완료된 호스트의 history를 위한 그룹이다.
## Host Variables 설정
```
bash
# cat host_vars/172.16.0.100
ansible_ssh_host: 172.16.0.100
ansible_ssh_port: SSH_포트번호
ansible_ssh_user: 사용자 아이디
ansible_ssh_pass:
"사용자 패스워드"
ansible_become:
yes
ansible_become_method: su
ansible_become_user: root
ansible_become_pass:
"!root_패스워드"
ansible_python_interpreter: python2.7
```
## Playbook 설정
```python
---
-
name: nfs client install
hosts: ALL_HOSTS
vars:
nfs_version: 4
nfs_mount_opts: rsize=16384,wsize=16384,timeo=300,intr
tasks:
-
name: Install a list of packages
apt:
pkg:
-
nfs-common
update_cache: yes
-
name: set mountpoints
mount:
fstype: nfs
opts: "{{ nfs_mount_opts }}"
src: "{{ item.src }}"
path: "{{ item.path }}"
state: mounted
with_items:
-
{ path: "/BACKUP", src: "172.16.0.12:/NFS/BACKUP" }
-
{ path: "/BACKUP2", src: "172.16.0.12:/NFS/BACKUP2" }
```
`NFS 원격 마운트`에 대한 Playbook 분석
* [ ] NFS 서버의 172.16.0.12:/NFS/BACKUP exports 파티션을 원격서버의 /BACKUP으로 마운트 한다.
* [ ] NFS 서버의 172.16.0.12:/NFS/BACKUP2 exports 파티션을 원격서버의 /BACKUP2으로 마운트 한다.
* [ ] NFS Version은 4로 지정한다.
## playbook 실행
```
bash
# ansible-playbook -i hosts nfs_client_mount.yml
```
ANSIBLE/OS/README.md
View file @
4df48f6d
...
...
@@ -14,4 +14,5 @@
| 4 | OS Package Installing (yum) |
[
GO
](
./YUM/
)
| |
| 5 | OS File Fetch |
[
GO
](
./FILE_FETCH/
)
| |
| 6 | OS File Copy |
[
GO
](
./FILE_COPY/
)
| |
| 7 | Zabbix-Agent Installing |
[
GO
](
./ZABBIX/
)
| |
| 7 | NFS Client Setting |
[
GO
](
./NFS_CLIENT/
)
| |
| 8 | Zabbix-Agent Installing |
[
GO
](
./ZABBIX/
)
| |
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