Can we use ansible to provision an ec2 instance?

Can we use ansible playbook to provision ec instance and run some additional playbooks to make some configuration inside an ec instance at os level?

An Ansible playbook is capable of creating EC2 instances in AWS. You can also use Ansible to configure an OS once launched. I’m not sure you’d want to use Morpheus to run ad-hoc Ansible playbooks to launch unmanaged EC2 instances, though.

HI , Thanks for your response , We want to provision an ec2 instance + additional some configuration along with this ec2 task , While running ec2 playbook , it also has to run additional playbooks which does some additional configuration on storage side ,

But i stuck here to setp this workflow , Do you have any doc for ansible to provision ec on morphoues data , our playbooks are ready

There is no documentation on this because Morpheus uses it’s own internal process to provision EC2 instances. There is no supported workflow where Ansible is creating the instance.

Ok , Pls correct me ,

  1. we cannot use ansible playbook to provision an ec2 instance , we need to use different
    process to provision ec2 instance , is my understanding right ?

  2. But i want some different ansible playbooks to run along with ec2 instance provision task , is that can be done ?

Hi @Paul_B

The playbooks can be run before the start of provisioing the EC2 and more can be run after the instance is in the running state.

Can you elaborate more on the type of tasks you would execute in parallel to ec2 instance provisioning.