Hello all,
I have a rather complicated playbook which orchestrates the following plays: (a) input validation (extra-vars w/ asserts), (b) launching an EC2 instance, (c) configuring the instance, (d) fact gathering, (e) building and tagging an AMI from the instance, (f) using the AMI and the gathered facts to build Launch Configurations with user-data, (g) updating a couple of ASGs used for continuous integration (CI), and (h) terminating the instance launched at (b).
I am using Jenkins as the Ansible control host. The above playbook seems quite “heavy” and am wondering if there is a cleaner way to group the plays, into separate playbooks & Jenkins jobs. I’m most uncomfortable with (g) step being tied to the whole playbook, but I need to reference rather complicated Launch Configuration names (with Git SHA’s in them) from the previous step (f).
Does Fact Caching works with Registered variables? I.e. if when I build the AMI and register the result in one Jenkins job, can I reference the registered variable in a later job? The facts would be for the Jenkins host (localhost).
Thanks,
Robb