thiagoalmeidasa.aws_efs

Ansible Role: AWS EFS

This role helps you connect Amazon EFS file systems to EC2 instances.

Check out the role here: Ansible Galaxy

Requirements

You need an Amazon AWS account, EFS file systems, and EC2 instances running Ubuntu or RedHat.

Ansible Requirements

Ansible Version

You need at least Ansible version 2.0.

Role Dependencies

There are no dependencies for this role.

Installation

Install with Ansible Galaxy

To install the role, use the following command:

ansible-galaxy install thiagoalmeidasa.aws_efs

Here is a simple way to use the role:

- hosts: all
  roles:
  - role: thiagoalmeidasa.aws_efs
    vars:
      aws_efs_paths:
      - path: "/path"
        owner: "root"
        group: "root"
        mode: "0644"
        region: "eu-west-1"
        filesystem_id: "fs-someid"

If you want to set all variables explicitly, you can do it like this:

- hosts: all
  roles:
  - role: thiagoalmeidasa.aws_efs
    vars:
      aws_efs_paths:
      - path: "/path"
        owner: "root"
        group: "root"
        mode: "0644"
        region: "eu-west-1"
        filesystem_id: "fs-someid"
        state: "mounted"
        opts: "nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2"

Install with Git

If you prefer not to install globally, clone the role into your roles_path:

git clone [email protected]:thiagoalmeidasa/ansible-role-aws-efs.git /path/to/roles_path

You can also add it as a submodule in your playbook_dir repository:

git submodule add [email protected]:thiagoalmeidasa/ansible-role-aws-efs.git <playbook_dir>/roles/aws_efs

To use the role, include it like this:

- hosts: all
  roles:
  - role: aws_efs

Since this role isn't managed by Ansible Galaxy, you don’t need to include the GitHub user.

Role Variables

Default Variables

Default values are in defaults/main.yml:

# Mount settings
#
# Notes:
# - The filesystem must be in the same security group as the EC2 instances that use it
# - For information on EFS service availability by region, visit: https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/
#
# Options:
# - path:           Local path where the folder will be mounted in your EC2 instance
# - owner:          Who owns the folder (default is "root")
# - group:          Who belongs to the folder group (default is "root")
# - mode:           Permissions for the folder (default is "0644")
# - region:         The region where the filesystem is located
# - filesystem_id:  The ID of the filesystem
# - state:          Mounting options. (default is "mounted")  More info: http://docs.ansible.com/ansible/latest/mount_module.html#options
# - opts:           Mount options (refer to fstab(5) or vfstab(4) on Solaris). (default as per AWS instructions "nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2")

# Mount paths
aws_efs_paths:
  - path: /opt/efs
    owner: ""
    group: ""
    mode: ""
    region: ""
    filesystem_id: ""
    state: ""
    opts: ""

Mandatory Variables

You must define these variables:

aws_efs_paths:
- path: ""
  owner: ""
  group: ""
  mode: ""
  region: ""
  filesystem_id: ""

Context Variables

There are no context variables.

License

This role is under the BSD or MIT license.

Author Information

Created by thiagoalmeidasa. You can reach out at thiagoalmeidasa@gmail.com.

Informazioni sul progetto

Mount Amazon EFS file systems to EC2 instances.

Installa
ansible-galaxy install thiagoalmeidasa.aws_efs
Licenza
mit
Download
24.2k
Proprietario
Linux, open source, containers, docker. Nerd, with a big interest in the philosophical, biological, social, and cultural aspects of human life.