From 6d40031c6086f2d63f663f8a1e889e3e974609c9 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 23 Jun 2021 15:40:25 +0200 Subject: [PATCH] autofs: autofs.conf configuration. --- defaults/main.yml | 8 ++++++++ tasks/autofs.yml | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5c8c4e7..d21f968 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -19,6 +19,14 @@ disks_and_mountpoints_list: [] # autofs mount points autofs_client_mountpoint: False +autofs_conf_options: + - { section: 'autofs', option: 'master_map_name', value: '/etc/auto.master', state: 'present' } + - { section: 'autofs', option: 'timeout', value: '300', state: 'present' } + - { section: 'autofs', option: 'negative_timeout', value: '60', state: 'present' } + - { section: 'autofs', option: 'mount_nfs_default_protocol', value: '4', state: 'present' } + - { section: 'autofs', option: 'logging', value: 'none', state: 'present' } + - { section: 'amd', option: 'dismount_interval', value: '300', state: 'present' } + autofs_packages_deb: - autofs diff --git a/tasks/autofs.yml b/tasks/autofs.yml index c74a6a8..193dbb5 100644 --- a/tasks/autofs.yml +++ b/tasks/autofs.yml @@ -9,7 +9,7 @@ - name: Install and configure autofs on EL block: - - name: Install the autofs packages onn EL + - name: Install the autofs packages on EL yum: pkg={{ autofs_packages_el }} state=present when: ansible_distribution_file_variety == "RedHat" @@ -21,6 +21,19 @@ file: dest={{ item.mountpoint_prefix }} state=directory owner=root group=root mode=0755 with_items: '{{ autofs_maps }}' + - name: setup autofs.conf + ini_file: + path: /etc/autofs.conf + section: '{{ item.section }}' + option: '{{ item.option }}' + value: '{{ item.value }}' + state: '{{ item.state }}' + owner: '{{ gitea_user }}' + group: '{{ gitea_group }}' + mode: '0640' + create: no + loop: '{{ autofs_conf_options }}' + - name: Install the autofs master configuration template: src=auto.master.j2 dest=/etc/auto.master owner=root group=root mode=0644 register: reg_autofs_master_conf