Ansible "copy" works from the control machine, not between arbitrary sets
of servers.

If you're ok with that, use the copy module.

if not, you would need to use "fetch" to grab it first, then "copy" to push
it out to others.  I'll admit that's a very uncommon use case though, and
better if you can centralize.



On Sat, Oct 25, 2014 at 2:04 PM, <[email protected]> wrote:

> They are similar application hosts & want to move files from host1 to
> host2/3.Once I setup jdk & wls binaries simply want to move files to other
> hosts.
> How to setup  inventory variables on specific groups or hosts.& call/use
> it in playbook.
>
> main.yml
> - hosts: a-server
>   user: auser
>   gather_facts: yes
>
>   roles:
>     - weblogic
>
> hosts
> [a-server]
> vmxxx1-x.x
>
> Currently I setup only one server in hosts file for a-server & want to
> extend the playbook to  copy files on to other hosts.
>
> -Vinay
>
> On Friday, October 24, 2014 5:10:38 PM UTC-7, Michael DeHaan wrote:
>>
>> 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/f9cdda73-f98f-447e-9ffc-928f6cde7cb8%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/f9cdda73-f98f-447e-9ffc-928f6cde7cb8%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%2BnsWgwx4%2Bsq7tUH%2BknZttUeqSqYcAz2MMF77Sy8nMDHG76u2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to