Do you have a specific question about the above playbook?

If configuration of different hosts is *VERY* different, like one is a
database server and one is not, this is where you would write two plays,
each applying different tasks/roles to each.

Otherwise, it's a case of setting inventory variables on specific groups or
hosts.



On Fri, Oct 24, 2014 at 6:19 PM, <[email protected]> wrote:

> I am new to ansible and need suggestion as I how to perform different task
> in different hosts.
>
> I need to setup jdk & wls in one host and move the binaries(jdk/wls) from
> same server to other servers.
> I was able to setup on one server(01) but want to move to other
> hosts(02/03) instead of setting up.What is the ideal approach to do without
> copying to temporary location & iterate on other servers.
>
> ===========
>    playbook
> ===========
> ---
> - name: Check for fmw path exists
>   stat: path=/a/b
>   register: check_fmw_path
> - name: fmw folder exists
>   debug: msg=' Folder already exists'
>   when: check_fmw_path.stat.exists
> - name: Missing directory
>
>   file: path=/a/b state=directory owner=test group=testgrp mode=755
>   when: check_fmw_path.stat.exists == false
> - name: Check for jdk path exists
>   stat: path=/c/d
>   register: check_jdk_path
> - name: jdk folder exists
>   debug: msg='jdk Folder already exists'
>   when: check_jdk_path.stat.exists
> - name: Missing jdk directory
>
>   file: path=/c/d state=directory owner=test group=testgrp mode=755
>   when: check_jdk_path.stat.exists == false
> - name: Copying the jdk binaries
>   copy: src=/temp/jdk-7u60-linux-x64.tar.gz dest=/c/d owner=test
> group=testgrp mode=755
> - name: Extracting jdk binaries
>   command: chdir=/c/d /bin/tar zxvf jdk-7u60-linux-x64.tar.gz
> - name: Setting up Weblogic binaries using silent mode
>   shell: /temp/wls_binaries.sh
> ==
>
> Please suggest
>
> -Vinay
>
>  --
> 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/d64aeb63-9511-4341-b76b-965fc505177d%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d64aeb63-9511-4341-b76b-965fc505177d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2BnsWgxk1_-4-ngpEFRPt0hJjBG23SgMukg7dgbWteAhims6Nw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to