name the vars differently so they don't override, then you can
mix/match as you please

type1_jenkins_mods:
 - git

type2_jenkins_mods:
    - svn
    - pipeline

common_jenkins_mods:
  - chuck-norris

they you can

with_items: "{{common_jenkins_mods|union(type1_jenkins_mods)}}"

for example.

On Fri, Jan 9, 2015 at 5:08 AM, Matthew Macdonald-Wallace
<[email protected]> wrote:
> Hi Bryan and thanks for the reply.
>
> The problem I'm trying to solve is collecting multiple jenkins plugins
> across roles but only executing the installation of them once.
>
> At the moment, I have to list and then install the plugins in each
> individual <role>/tasks/main.yml whereas what I'd like to do is something
> like this:
>
> group_vars/server_type_1
>
> jenkins_modules:
>     - git
>     - ansiicolor
>
>
> group_vars/server_type_2
> jenkins_modules:
>     - svn
>     - pipeline
>
> group_vars/all
> jenkins_modules:
>     - chuck-norris
>
>
> and then have a handler or similar install the relevant plugins (for example
> a host in server_type_1 group would have chuck-norris, git and ansiicolor
> installed, whereas a host in server_type_2 would have chuck-norris, svn and
> pipeline installed instead).
>
> I hope this makes things a bit clearer.
>
> Matt
>
>
> On Tuesday, 6 January 2015 13:55:49 UTC, Matthew Macdonald-Wallace wrote:
>>
>> Hi all,
>>
>> We have a number of clients for whom we manage systems using Ansible.  I'm
>> fairly new to Ansible however my background is heavy use of Chef and Puppet
>> so I understand most of the concepts.
>>
>> In order to make our lives easier, we have a central "ansible" git repo
>> containing generic roles.  This is then cloned as a submodule into each
>> client repo where we override variables and config files accordingly to make
>> the "generic" roles from the master repo client specific.
>>
>> One of the roles that we have installs and configures Jenkins CI Server.
>> We have a set of "base" jenkins plugins that we install as part of the
>> Jenkins role, however for some clients we will want to install and configure
>> additional plugins.
>>
>> Is there any way within Ansible that I can collect a list of these plugins
>> from various roles (git, svn, capistrano etc.) and then have them installed
>> by the Jenkins role?
>>
>> The current approach is to have a "command" task in each role to execute
>> the jenkins-cli command to install the plugins which seems like a very
>> un-DRY way of doing things.
>>
>> I'm reasonably happy with Python so I'm happy to write a module if this is
>> what is required, however I'm hoping that this is a solved problem!
>>
>> Thanks in advance for any help,
>>
>> Matt
>>
>> P.S. FWIW, it looks like https://github.com/ansible/ansible/pull/6674
>> might solve this for me, but it's not been merged as far as I can tell.
>
> --
> 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/01ed5ce4-9ff8-433a-9cab-078868d2b361%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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/CAJ5XC8%3D025a8-NROeu0bBjMty6A_%3DCQc9ryegqyZZuuYcbY-oA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to