ansible_role_mountmanager

Ansible role mounts

Managing mounts.

Build Status

License

MIT / BSD

Author Information

Requirements

  • Ensure a package manager is available and configured with the correct package sources and repositories.
  • Ensure privileged permissions are set for the user executing this role to:
    • Install packages.
    • Edit and create directories as mount paths.
    • Mount permissions.
    • Edit /etc/fstab.
    • Create and edit automount configuration files.

Dependencies

N/A

Compatibility

Compatible with the following list of operating systems:

  • CentOS 7
  • CentOS 8
  • RHEL 7.x
  • RHEL 8.x

Role Variables

Variable name Description
role_mounts_list Combined list of other lists that start with the name role_mounts_list_.
role_mounts_required_packages A dictionary with lists to install the required packages.

Example Playbook

---
- name: Manage mounts
  become: True
  gather_facts: False
  tasks:
    - import_role:
        name: ansible_role_mountmanager
      vars:
        role_mountmanager_list_default:
          - type: nfs
            state: mounted
            src: 192.168.122.201:/srv/nfsexports
            path: /srv/nfsmounts
            fstype: nfs
            opts: defaults,sync
            path_owner: root
            path_group: radix
            path_mode: '0770'
          - type: cifs
            state: mounted
            src: //192.168.122.201/smbexports
            path: /srv/smbmounts
            fstype: cifs
            opts: defaults,noperm,credentials=/root/creds.txt
            path_owner: root
            path_group: root
            path_mode: '0775'
          - type: autofs
            state: present
            path: /srv/autofs
            path_owner: root
            path_group: root
            path_mode: '0755'
            master_file: /etc/auto.master.d/autofsexports.autofs
            master_file_owner: root
            master_file_group: root
            master_file_mode: '0640'
            master_params:
              - /srv/autofs /etc/auto.autofsexports
            map_file: /etc/auto.autofsexports
            map_file_owner: root
            map_file_group: root
            map_file_mode: '0640'
            map_params:
              - autofsexports -fstype=nfs,rw,soft,intr 192.168.122.201:/srv/autofsexports
              - autofsexports2 -fstype=nfs,rw,soft,intr 192.168.122.201:/srv/autofsexports2
          - type: system
            state: present
            src: /dev/mapper/rhel-tmp
            path: /tmp
            fstype: xfs
            opts: defaults,nodev,noexec,nosuid
            dump: '0'
            passno: '0'
        role_mounts_required_packages:
          nfs:
              - nfs-utils
          cifs:
              - cifs-utils
          autofs:
              - autofs
          system: []

...

Useful shell commands

N/A

Additional documentation resources

Testing with Molecule

This role is locally tested with the use of Molecule, the configuration is located at: molecule/default.
The Molecule tests are run (using the docker driver) on Dockerhub images built for this purpose:

CI/CD with Travis CI

This role uses Travis CI to run online tests with the use of Molecule and pushes notifications to import the role into Ansible Galaxy once the tests are successful. The Travis CI configuration is located at the root of the Ansible role .travis.yml

Install
ansible-galaxy install Caseraw/ansible_role_mountmanager
GitHub repository
License
Unknown
Downloads
29
Owner
DevOps | RHCA | Red Hat Accelerator