Examples of Multiple Instances of a "thing" on a single box
12 views
Skip to first unread message
Nick Tkach
unread,
Sep 20, 2016, 1:43:06 PM9/20/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Does anyone know of any good examples of having more than one instance of an app per box? Most examples seem to be grouped into something like web_servers group has boxes 1,2,3 and has a nice, neat *one* httpd on 1, *one* httpd on 2, and *one* httpd on 3. Problem I'm having is that I'm working with an Apache httpd setup where there aren't any nice, neat divisions like that. Apache httpd is on all the boxes, but box 1 might have conf appA, appB, and appC and box2 might have appB, appC, and appQ.
I've got something that sort of works based on a combination of group_vars files (appA.yml, appB.yml, etc) and clunky site.yml tasks like
My concern is it doesn't easily scale to add in other environments or apps. Eventually we'll need to add in "dev" and "qa" and "staging". I realize this isn't a great description and I don't expect a full solution. I'm just looking for examples beyond just okay here's a tomcat on box1, box2, and box4 and an apache on box 2 and box 4.
Dick Davies
unread,
Sep 22, 2016, 9:53:10 AM9/22/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible list
If you're talking about one httpd install with multiple vhosts, I'd
have an httpd role
that sets up a standard apache layout and then other roles to create
.vhost files
(Apaches 'Include' directive helps here).
Apply the httpd role everywhere you need it and add the other roles on top.
If you mark the vhost roles as having a dependency on the httpd roles
you can also
access the httpd roles vars and handlers, which keeps things manageable.