You can add the user_data during the ec2 creation like this:

user_data: |
          #!/bin/sh
          sudo yum install -y httpd

For Complete Reference, please check this link 
<https://github.com/arbabnazar/ansible-aws-vpc-ha-wordpress/blob/master/aws/tasks/webserver.yml#L47>

On Tuesday, January 5, 2016 at 9:27:10 AM UTC+5, Gustavo Aguiar wrote:
>
> Hi All,
>
> I’m trying to install the httpd package in recently created EC2 instances 
> in my playbook.
>
> I have multiple playbooks in different roles that are being invoked at 
> once.
>
> When I get to add my recently created EC2 instances to the also recently 
> created ELB, my registration fails once my instances doesn’t have httpd 
> running yet and the health_check fails.
>
> What would be the best approach in this case ? 
>
> - Installing httpd packages after the EC2 creation and then adding 
> instances to the ELB ?
>
> Thanks in advance,
> —Gustavo
>
>
> ------------------------------
> This email has been scanned for email related threats and delivered safely 
> by Mimecast.
> For more information please visit http://www.mimecast.com 
> ------------------------------
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9d94a4a8-24f7-491b-8d35-0b1611b4429d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to