Deploy

The first additional role, called roles/stack/tasks/deploy.yml, does as you would expect and deploys the software stack and configuration.

It starts by mounting the EFS share; first, we need to gather some information about the EFS share using the efs_facts module:

- name: find some information on the elastic load balancer  local_action:    module: efs_facts    region: "{{ ec2_region }}"    name: "{{ environment_name }}-efs"  become: no

You may have already noticed that we are calling the efs_facts module differently; we are actually using the local_action module, which runs the efs_facts module on our Ansible controller rather than the EC2 instance. This is because we are not actually giving our EC2 instance access to the API, as we are not ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.