I am trying to automate the EFS creation and Mount it, using Ansible playbook, but not sure how to pass the mount_point to another playbook.
In my Ansible Tower workflow, the first job creates EFS in AWS and then on successful completion of this job, the Mount_point (of newly cerated EFS) should be passed on to next job in the workflow (which will mount this EFS on a directory)
Playbook#1:
This playbook is creating a EFS in AWS - This works fine for me.
Playbook#2:
Now, to mount a EFS, I need to create a directory (which I will refer to as mount-directory) in EC2, then mount the EFS on this mount-directory.
The standard command to mount a EFS is (but 2 things need to be changed)
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-3f183496.efs.us-west-2.amazonaws.com efs
The 2 things that I want to change in the above mount-command is:
- mount_point (for e.g. fs-3f183496.efs.us-west-2.amazonaws.com)
- This should get updated with the correct mount_point created in Playbook#1
- Mount_directory (for e.g. efs)
- This I am able to create in playbook#2
can you suggest me how to pass the mount_point details from job/playbook#1 to job/playbook#2, within Ansible-Tower workflow?