On Sun, 01 Feb 2015 10:42 -0800, Victor Volle <[email protected]>
wrote:
> Hi!
> 
> I tried to read up on everything I could find w.r.t. multi stage 
> environments, but I haven't found  a solution that fits my needs yet.
> 
> Let's say, I have 4 "environments": dev, test, stage, production
> And 2 "kinds" of servers: web, db
> 
> To simplify things, I only have on variable, the size of the "ram".
> In "dev", "test" and "stage" the ram for "web" should be 1GB, and 4GB for 
> "prod" (artificial example to show the issue!)
> And in "dev", "test" and "stage" the ram for "db" should be 2GB, and 8GB 
> for "prod":

If you can't really change the tasks and must use a single variable
named 'ram', I would organize it this way:

# inventory file
[prod-db]
hostA

[prod-web]
hostB

[dev-db]
hostC

# group_vars/prod-db.yml
ram: 8

# group_vars/prod-web.yml
ram: 4

# group_vars/dev-db.yml
ram: 2

Giovanni

-- 
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/1422885971.2685985.221967289.3D565307%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to