2021-01-24 23:00:57 +00:00
|
|
|
---
|
|
|
|
# Sets up the EFS mount for /mnt/koji {{ koji_efs_mount_path }}
|
|
|
|
# Requires amazon-efs-utils; included
|
|
|
|
#
|
|
|
|
- name: Installing amazon-efs-utils
|
|
|
|
yum:
|
|
|
|
name: amazon-efs-utils
|
|
|
|
state: present
|
|
|
|
tags:
|
|
|
|
- amazon_efs_utils
|
|
|
|
- packages
|
|
|
|
|
2021-01-28 19:43:37 +00:00
|
|
|
- name: "Gathering ec2 facts"
|
|
|
|
amazon.aws.ec2_metadata_facts:
|
|
|
|
tags:
|
|
|
|
- mounts
|
|
|
|
|
|
|
|
# "you can use /etc/hosts" https://github.com/aws/efs-utils/issues/1
|
|
|
|
- name: "Install custom hosts file because ~~fml~~ amazon said so."
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: /etc/hosts
|
|
|
|
line: "{{ koji_efs_fs_ip_map[ansible_ec2_placement_availability_zone] }} {{ koji_efs_fsid }}"
|
2021-08-30 05:02:24 +00:00
|
|
|
create: true
|
2021-01-28 19:43:37 +00:00
|
|
|
tags:
|
|
|
|
- mounts
|
|
|
|
|
2021-01-24 23:00:57 +00:00
|
|
|
- name: "Creating and mounting {{ koji_efs_fsid }} at {{ koji_efs_mount_path }}"
|
|
|
|
ansible.posix.mount:
|
|
|
|
path: "{{ koji_efs_mount_path }}"
|
|
|
|
src: "{{ koji_efs_fsid }}:/"
|
|
|
|
fstype: "{{ koji_efs_fs_type }}"
|
|
|
|
opts: "{{ koji_efs_fs_opts | join(',') }}"
|
|
|
|
state: "{{ koji_efs_fs_state | default('mounted') }}"
|
|
|
|
tags:
|
|
|
|
- mounts
|
2021-08-30 05:02:24 +00:00
|
|
|
...
|