Hi James,
thanks for the tip. I think the approach is not totally suitable for my
situation. I would rather not define all the databases for one server in one
place for two reasons:
I would like to have it very easy to "move" the database to a different server
(only in the sense that it gets installed on a different server if I run
everything from scratch to install a test/staging environment)
Also quite important is that I want to be able to run a playbook that installs
just db01 and not db02 to save development time (e.g., when I change the
database schema of db01, but do not want to run the tasks that check if there
needs to be updates to db02 or when I want to setup a new test environment
where I know that I do not need db02...).
Maybe there is a way to setup things that I have to compromise at most on one
of these things?
On 20.11.2014 17:18, James Cammarata wrote:
> Hi David, the best way to do this would be to make the role aware of the fact
> that there may be more than one database installed on it, so that the
> variables in the group would then become an array:
>
> # group_vars/foo.yml:
> databases:
> - name: db01
> user: db_user1
> password: xxxxxx
> - name: db02
> user: db_user2
> password: xxxxxx
> ...
>
> And then you would loop over this list in your role tasks.
>
> Hope that helps!
>
>
> On Thu, Nov 20, 2014 at 5:30 AM, David Fritzsche
> <
david.fritzsche...@mvua.de
> <mailto:
ansible-project%2Bunsu...@googlegroups.com>.
> <mailto:
ansible...@googlegroups.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
ansible-proje...@googlegroups.com
> <mailto:
ansible-proje...@googlegroups.com>.
> <mailto:
ansible...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/CAMFyvFiBJy%2BvD90h_9zTBCqLxaXd6qV76LUnavdq9XqdW68hGQ%40mail.gmail.com
> <
https://groups.google.com/d/msgid/ansible-project/CAMFyvFiBJy%2BvD90h_9zTBCqLxaXd6qV76LUnavdq9XqdW68hGQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.