ypsman.systemd_cifs_mount
ansible systemd-cifs-mounts
将挂载设置为 Systemd 服务。
此 Playbook 创建一个 Systemd 服务,用于挂载 CIFS 共享。
这样你就可以将挂载作为系统服务使用。
适用于 Debian Stretch 和 Jessie(如果使用 systemd)。
它可以从一台服务器挂载多个文件夹。
例如:
systemctl status mount-point.mount
systemctl start mount-point.mount
systemctl stop mount-point.mount
systemctl status mount-point.automount
systemctl start mount-point.automount
systemctl stop mount-point.automount
选项:
cifs_mount_share: //apps.local/apps$ # 要挂载的服务器
cifs_mount_path: /opt/app # 要挂载的文件夹
cifs_mount_options: uid=1000 # 选项,用户名等...
示例 Playbook
- hosts: all
roles:
- role: systemd-cifs-mounts
cifs_mounts:
- folder1
- folder2