Hi all, 
I'm struggling with a concept in Ansible and hopefully you guys can provide 
some input for me:

I'm trying to create a playbook which performs the following:
1. Provisions 2 Amazon EC2 instances
2. Deploys mysql on one instance
3. Deploys and configures wordpress on the other, configered to use the 
mysql node configured in step 2 for database

I'm going to use this as a framework for some other work down the road. The 
important thing is that each playbook run will deploy its "own" EC2 
instances, which means that I cannot use statically typed names.

Everything works as it should, until the step where I need to inject the 
internal ip address of the mysql server into the wordpress config file on 
the wordpress node. I just can't get my head around how I should do this 
step. I don't know the mysql hostname (and I don't care), but I know that 
it's a member of the "tag_Group_MySQL" group. I have a variable called 
"ec2_mysql" on the "control node" containing the public ip of the mysql 
server, but this variable does not exist on the wordpress server (according 
to the docs, variables only live on the server where they are defined, if I 
understand it correctly). 

The whole playbook is available at 
https://github.com/trondhindenes/AnsibleTest/tree/master/ec2-env. I would 
love another set of eyes on this.

I'm thinking about running the ec2.py script as a local task after 
provisioning, and trying to use some filtering to grab the facts of the 
first member of the ec2_mysql group or something but I still feel very 
limited by the fact that variables only seem to exist on the host where 
they got defined.... Any pointers deeply appreciated!

-Trond

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to