From fffa2796504d347e3497c48b752b7b96fb39e512 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 09:45:24 +0200 Subject: [PATCH] refs #8025 autofs task restored --- roles/debian-qemu/handlers/main.yml | 8 ++++++ roles/debian-qemu/tasks/autofs.yml | 42 ++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 roles/debian-qemu/handlers/main.yml diff --git a/roles/debian-qemu/handlers/main.yml b/roles/debian-qemu/handlers/main.yml new file mode 100644 index 0000000..0079561 --- /dev/null +++ b/roles/debian-qemu/handlers/main.yml @@ -0,0 +1,8 @@ +- name: restart-nslcd + service: + name: nslcd + state: restarted +- name: restart-autofs + service: + name: autofs + state: restarted \ No newline at end of file diff --git a/roles/debian-qemu/tasks/autofs.yml b/roles/debian-qemu/tasks/autofs.yml index b368265..049e21d 100644 --- a/roles/debian-qemu/tasks/autofs.yml +++ b/roles/debian-qemu/tasks/autofs.yml @@ -1,8 +1,38 @@ -- name: Restart nslcd - service: - name: nslcd - state: restarted -- name: Restart autofs +- name: Install autofs packages + apt: + name: "{{ item }}" + state: present + with_items: + - nfs-common + - autofs + - libnfs-utils + - autofs-ldap +- name: Create homes directory + ansible.builtin.file: + path: "{{ homes_path }}" + state: directory + mode: '0755' +- name: Configure nsswitch for autofs + lineinfile: + path: /etc/nsswitch.conf + line: "automount: files" + notify: restart-nslcd +- name: Add file homes.autofs configured to autofs + copy: + src: homes.autofs + dest: /etc/auto.master.d/homes.autofs + owner: root + group: root + mode: '0644' +- name: Add file /etc/auto.homes configured to the systemd + copy: + src: auto.homes + dest: /etc/auto.homes + owner: root + group: root + mode: '0644' + notify: restart-autofs +- name: Service autofs service service: name: autofs - state: restarted \ No newline at end of file + enabled: yes \ No newline at end of file