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 homes_path: /mnt/homes
autofs_packages:
- nfs-common
- autofs
- libnfs-utils
- autofs-ldap

View File

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

View File

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