From 04b87384354a4d89ab130a61c3c6784f2346bc49 Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 15 Aug 2020 05:47:18 -0500 Subject: [PATCH] Add EFS support to Gitea --- roles/gitea/tasks/main.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/roles/gitea/tasks/main.yml b/roles/gitea/tasks/main.yml index f8d48e4..cc4fd1e 100644 --- a/roles/gitea/tasks/main.yml +++ b/roles/gitea/tasks/main.yml @@ -91,6 +91,29 @@ owner: git group: git path: "{{ gitea_root_directory }}" + - name: Set up EFS mount + block: + - name: Install required packages + apt: + name: + - nfs-client + - name: Create EFS + efs: + name: "{{ gitea.efs.name }}" + encrypt: yes + region: "{{ gitea.efs.region }}" + targets: + - subnet_id: "{{ gitea.efs.subnet_id }}" + security_groups: [ "{{ gitea.efs.security_group }}" ] + register: efs + - name: Mount EFS + path: "{{ gitea_root_directory }}" + src: "{{ efs.efs.filesystem_address }}" + fstype: nfs4 + opts: "nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" + state: mounted + when: gitea.efs.name is defined + tags: [ giteaefs ] - name: Check for config stat: path="/etc/gitea/app.ini" register: p