ansible/roles/communishift/tasks/create-efs.yml
David Kirwan e9bced043b communishift: Configure AWS EFS to continue on fail
Signed-off-by: David Kirwan <dkirwan@redhat.com>
Signed-off-by: Lenka Segura <lsegura@redhat.com>
Signed-off-by: Patrik Polakovic <ppolakov@redhat.com>
2022-08-16 15:29:22 +01:00

42 lines
1.4 KiB
YAML

---
- name: EFS provisioning
community.aws.efs:
aws_access_key: "{{ communishift_efs_access_key }}"
aws_secret_key: "{{ communishift_efs_secret_key }}"
region: "{{ communishift_region }}"
state: present
name: "{{ communishift_project_name }}"
tags:
Name: "{{ communishift_project_name }}"
communishift: "{{ communishift_project_name }}"
targets:
- subnet_id: "{{ communishift_subnet_id }}"
security_groups: [ "{{ communishift_security_group }}" ]
tags:
- create_efs
register: create_efs_filesystem_response
- name: Print the response from the AWS EFS FileSystem creation
debug:
msg: "{{ create_efs_filesystem_response }}"
- name: Create the EFS AccessPoint
communishift_storage_efs:
project_name: "{{ communishift_project_name }}"
aws_access_key_id: "{{ communishift_efs_access_key }}"
aws_secret_access_key: "{{ communishift_efs_secret_key }}"
aws_region: "{{ communishift_region }}"
aws_efs_filesystem_id: "{{ create_efs_filesystem_response['efs']['file_system_id'] }}"
register: create_efs_accesspoint_response
ignore_errors: true
- name: Print the response from the AWS EFS AccessPoint creation
debug:
msg: "{{ create_efs_accesspoint_response }}"
- name: Store facts
set_fact:
accesspoint_id: "{{ create_efs_accesspoint_response['accesspoint_id'] }}"
filesystem_id: "{{ create_efs_filesystem_response['efs']['file_system_id'] }}"