Or... use something like:

pkg: name="{{item}} state=installed
with_items:
  - {{devtools}}

and then have devtools be a list of the relevant packages set in group_vars
or some included file based on OS

On Thu, Jul 28, 2016 at 12:58 PM, Mark Janssen <maniac...@gmail.com> wrote:

> Add a conditional on your current task to only run on centos/redhat,
> something along the lines of:
> when: ansible_os_family == "RedHat"
>
> And then make a second task:
>
> tasks:
>   - name: Install Development Tools, git, curl, htop
>     apt: name={{ item }} state=present
>     with_items:
>       - build-essential
>       - git
>       - curl
>       - htop
>
> when: ansible_os_family == "Debian"
>
>
> On Wed, Jul 27, 2016 at 7:47 AM, Igor P. <pl33...@gmail.com> wrote:
>
>> Hi,
>>
>> I am new to Ansible and I am working a playbook that requires to have
>> Development-tool installed on on CentOS based server. However, I was
>> thinking about writing playbook that will be applicable to Debian-based OSs
>> such as Ubuntu for example. What would be the module that can install
>> Development-tools on both Fedora and Debian based systems?
>>
>> This is what I currently have:
>>
>> tasks:
>>   - name: Install Development Tools, git, curl, htop
>>     yum: name={{ item }} state=present update_cache=yes
>>     with_items:
>>       - "@development_tools"
>>       - git
>>       - curl
>>       - htop
>>
>>
>>
>> Thanks for you help.
>>
>> --
>> 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-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/d67a4b96-d83b-447e-b525-5be26589721c%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/d67a4b96-d83b-447e-b525-5be26589721c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Mark Janssen  --  maniac(at)maniac.nl
> Unix / Linux Open-Source and Internet Consultant
> Maniac.nl Sig-IO.nl Vps.Stoned-IT.com
>
>


-- 
Mark Janssen  --  maniac(at)maniac.nl
Unix / Linux Open-Source and Internet Consultant
Maniac.nl Sig-IO.nl Vps.Stoned-IT.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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKs9msjO6NkpvX49zVxRFw75PB5SE2J%2BWbJMaxi7vMGOesyo9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to