Loading views...
ansible merge mount

ansible merge mount

Date
Date
2020 Jan 2 0:0
Created by
Created by
Seonglae ChoSeonglae Cho
Created time
Created time
2023 Feb 28 12:39
Last edited by
Last edited by
Seonglae ChoSeonglae Cho
Last edited time
Last edited time
2023 Apr 15 16:56
Refs
Refs
 
get_url - Downloads files from HTTP, HTTPS, or FTP to node - Ansible Documentation
The attributes the resulting file or directory should have. To get supported flags look at the man page for chattr on the target system. This string should contain the attributes in the same order as the one displayed by lsattr. The = operator is assumed as default, otherwise + or - operators need to be included in the string.
get_url - Downloads files from HTTP, HTTPS, or FTP to node - Ansible Documentation
 
 
Install rpm package using Ansible
How do I install .rpm package on remote machine using Ansible? The obvious solution is to use command module, but that is a bit silly. Also I would like to avoid setting up a yum repository just for one package. Is there some more pragmatic approach to this problem?
Install rpm package using Ansible
 
--- - name: Whole Process for Merge hosts: delab1 gather_facts: no vars: tasks: - name: make directory for mount file: path: "{{item}}" state: directory with_items: - /media/nas/v101/smms_output - /media/nas/s801/smms_output - /media/nas/s802/smms_output - /media/nas/s803/smms_output - /media/nas/s804/smms_output - name: get rpm mergerfs get_url: url: https://github.com/trapexit/mergerfs/releases/download/2.28.3/mergerfs-2.28.3-1.el7.x86_64.rpm dest: /tmp/mergerfs.rpm - name: install mergerfs by rpm yum: name: /tmp/mergerfs.rpm state: present - name: Unmount drive and merge drive media shell: | umount /media/nas/v101/smms_output -lf || echo umount /media/nas/s801/smms_output -lf || echo umount /media/nas/s802/smms_output -lf || echo umount /media/nas/s803/smms_output -lf || echo umount /media/nas/s804/smms_output -lf || echo - name: Mount drive shell: | mount -t cifs //10.0.50.181/smms_output /media/nas/s801/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 mount -t cifs //10.0.50.182/smms_output /media/nas/s802/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 # mount -t cifs //10.0.50.183/smms_output /media/nas/s803/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 # mount -t cifs //10.0.50.184/smms_output /media/nas/s804/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 - name: merge drive shell: | sudo mergerfs -o defaults,allow_other,use_ino,fsname=mergerFS /media/nas/s801/smms_output:/media/nas/s802/smms_output:/media/nas/s803/smms_output /media/nas/v101/smms_output - name: make mount merge script shell: | echo "#!/bin/sh # chkconfig: 234 90 90 # description: mount nas drive mount -t cifs //10.0.50.181/smms_output /media/nas/s801/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 mount -t cifs //10.0.50.182/smms_output /media/nas/s802/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 # mount -t cifs //10.0.50.183/smms_output /media/nas/s803/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 # mount -t cifs //10.0.50.184/smms_output /media/nas/s804/smms_output -o user=Stryx,pass='emfRoskfk!23',rw,vers=1.0,context=system_u:object_r:httpd_sys_content_t:s0 " > /etc/init.d/merge - name: make it startup shell: | chmod 755 /etc/init.d/merge chown root.root /etc/init.d/merge chkconfig --add merge
 
 
 
팀장님이 주신 스크립트를 바탕으로 마운트는 성공했는데..
검수툴에서 불러오기가 안된다 왜지!!
 
notion image
161 하고 171 하고 코드하고 마운트는 같은데 안불러와짐
 
mergerfs -o defaults,allow_other,use_ino,fsname=mergerFS,context=system_u:object_r:httpd_sys_content_t:s0 /media/nas/s801/smms_output:/media/nas/s802/smms_output:/media/nas/s803/smms_output /media/nas/v101/smms_output
context=system_u:object_r:httpd_sys_content_t:s0
 
이번에도 이녀석 context option 문제였다!!
mergerfs option 에도 mount 할때처럼 넣어줘야한다는 점!
 
 

Recommendations