Refs #8025: Role debian-qemu. Added autofs and hotplug tasks. Grouped packages to avoid using with_items in autofs installation. Added condition to ensure idempotent changes in GRUB

This commit is contained in:
Xavi Lleó 2024-10-17 14:19:53 +02:00
parent 83110e0dca
commit df4a8570c6
3 changed files with 9 additions and 7 deletions

View File

@ -1 +1,6 @@
homes_path: /mnt/homes
autofs_packages:
- nfs-common
- autofs
- libnfs-utils
- autofs-ldap

View File

@ -1,12 +1,7 @@
- name: Install autofs packages
apt:
name: "{{ item }}"
name: "{{ autofs_packages }}"
state: present
with_items:
- nfs-common
- autofs
- libnfs-utils
- autofs-ldap
- name: Create homes directory
file:
path: "{{ homes_path }}"
@ -33,6 +28,6 @@
mode: '0644'
notify: restart-autofs
- name: Service autofs service
service:
systemd:
name: autofs
enabled: yes

View File

@ -12,5 +12,7 @@
mode: u=rw,g=r,o=r
owner: root
group: root
register: grub
- name: Generate GRUB configuration
command: update-grub
when: grub.changed