ansible/playbooks/05_install_autofs.yml

36 lines
1.6 KiB
YAML
Raw Normal View History

2024-11-18 10:30:37 +01:00
- hosts: datacenter
2024-11-18 10:53:22 +01:00
name: Install and configure autofs
2024-11-18 10:30:37 +01:00
become: true
become_user: root
tasks:
2024-11-18 10:53:22 +01:00
- name: Install autofs
2024-11-18 10:30:37 +01:00
ansible.builtin.apt:
name:
- autofs
- cifs-utils
state: present
- name: Creating a file with content
copy:
dest: "/etc/auto.nas"
content: |
nas-data -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Data
nas-docker-data -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/docker_data
nas-photo -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Photo
nas-public -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Public
nas-install -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/install
nas-media -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Media
2024-11-21 00:35:52 +01:00
nas-downloads -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/downloads
2024-11-18 10:30:37 +01:00
- name: Reconfigure zabbix agent Server
ansible.builtin.lineinfile:
path: /etc/auto.master
regexp: "^/media/nas.*"
insertafter: '^/media/nas'
line: "/media/nas /etc/auto.nas --timeout 360 --ghost"
- name: Restart docker service
ansible.builtin.service:
name: autofs
state: restarted