ypsman.systemd_mounts
systemd 挂载
将挂载设置为 systemd 服务。
这个 Playbook 为挂载共享创建一个 Systemd 服务。
这样你就可以将挂载作为系统服务使用。
在 Debian Stretch 和 Jessie(如果使用 systemd)上可用。
例如:
systemctl status mount-point.mount
systemctl start mount-point.mount
systemctl stop mount-point.mount
选项:
Appdir: # 服务描述
share: //apps.local/apps$ # 要挂载的共享
mount: /opt/app # 挂载目录
type: nfs # 挂载类型(查看 mount 手册)
options: uid=1000 # 选项,用户名等...
automount: false # 如果为 false:服务将在启动时挂载
# 如果为 true:在访问该文件夹和启动时挂载
示例 Playbook
- hosts: all
roles:
- role: systemd-mounts
mounts:
myLogDir:
share: //logserver.local/logs$
mount: /mnt/logs
type: cifs
options: domain=local,username=user,password=password,uid=1000,gid=1000
automount: true
Appdir:
share: //apps.local/apps$
mount: /opt/app
type: nfs
options: uid=1000
automount: false