robertdebock.autofs

Ansible Role Autofs

This guide explains how to install and set up autofs on your system using Ansible.

GitHub GitLab Downloads Version
GitHub GitLab Downloads Version

Example Playbook

Here’s a sample playbook based on the file molecule/default/converge.yml, which is tested with every update.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.autofs
      autofs_maps:
        - mountpoint: /bind/mnt
          options:
            - "--timeout 60"
          directories:
            - path: mount
              server: ":/mnt"
              options:
                - "fstype=bind"
        - name: direct-mounts
          mountpoint: /-
          options:
            - "--timeout 60"
            - "--ghost"
          directories:
            - path: /bind/direct/mount
              server: ":/mnt"
              options:
                - "fstype=bind"
        - mountpoint: /do_not_exist
          state: absent
      nis_master_map: auto.master

Before running this playbook, set up the machine with the file molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap

For a complete guide on using these roles, check this detailed explanation.

Role Variables

Default values for variables are defined in defaults/main.yml:

---
# defaults file for autofs

# The first slash in a path is removed; remaining slashes are replaced with this character.
autofs_slash_replace_char: "-"

# To configure autofs without starting it, set this to "stopped".
autofs_service_state: "started"

# Configure automount mountpoints.
# autofs_maps:
#   ...

Requirements

Ensure you have the pip packages listed in requirements.txt.

State of Used Roles

These roles are used to set up a system. You can also use a different method.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab

Context

This role is part of many compatible roles. For more information, visit the documentation.

dependencies

Compatibility

This role has been tested on these container images:

Container Tags
Debian bullseye
EL 9
Fedora all
Ubuntu all

You need at least Ansible version 2.12. Testing has been done on previous, current, and development versions.

For issues, please report them on GitHub.

License

This project is licensed under the Apache-2.0.

Author Information

Created by robertdebock.

You can consider sponsoring me.

Informazioni sul progetto

Install and configure autofs on your system.

Installa
ansible-galaxy install robertdebock.autofs
Licenza
apache-2.0
Download
89.1k
Proprietario
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.