Hi,
I am kinda confused on what is the right syntax to try out this. Running a
role multiple times in a single playbok but a different var_files each time.
I have a web server role for a LAMP stack that will also install the Apache
vhost site. My idea was that I can run this role on the same server if I
was installing multiple sites - Ansible would just skip the software
installations but just install the vhost configs.
This works fine if I run the playbook multiple times manually. What I want
to do is to do this multiple times in one single playbook. My assumption is
that I should be using Role Dependencies (amirite?).
My current playbook *roughly*
---
# Deployment for web servers
#
- hosts: $hosts
user: $user
sudo: true
name: Install Apache and PHP.
vars_files:
- $config_path
roles:
- common
- webservers
As you can see, I heavily use vars_files since I find configs to be in a
separate file much easier to manage.
What I am confused is how can I use role dependencies but load up a
different var_files each time round? The example in the documentation seems
to imply just individual variable replacements but my webservers role has
several variables that need to be set for a site install which will make it
unwieldy.
Any help is much appreciated. Thanks!
--
Invoke Labs – A business building company that equips new digital ventures
for long term success.
Twitter <http://www.twitter.com/InvokeLabs> |
Facebook<http://www.facebook.com/InvokeLabs>
| LinkedIn <http://www.linkedin.com/company/invoke-labs> |
Blog<http://www.invokemedia.com/blog/>
|
*Check out the latest products from Invoke Labs
<http://www.invokelabs.com/>: Pendo Rent
<http://www.pendorent.com/> and myBestHelper <http://mybesthelper.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].
For more options, visit https://groups.google.com/groups/opt_out.