diff --git a/playbooks/05_install_autofs.yml b/playbooks/05_install_autofs.yml new file mode 100644 index 0000000..928f63b --- /dev/null +++ b/playbooks/05_install_autofs.yml @@ -0,0 +1,37 @@ +- hosts: datacenter + name: Install docker1 + become: true + become_user: root + gather_facts: false + tasks: + - name: Install docker + 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 + nas-downloads -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Download + + - 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 + \ No newline at end of file