hunterslobi.blogg.se

Untar linux command example
Untar linux command example









untar linux command example
  1. #Untar linux command example how to#
  2. #Untar linux command example install#
  3. #Untar linux command example zip file#
  4. #Untar linux command example archive#
untar linux command example

Hope this article gives you some introduction about Ansible unarchive module through examples. in that case, you can use this remote_src option. Sometimes we do not want to copy the files or our files would somehow be already present on the remote target server. remote_src tells the unarchive module to look for the source file on the remote server unless otherwise unarchive would check for the file on the control machine and try to copy it.Īnsible unarchive is by default designed to copy the file mentioned in the src from the control machine ( where Ansible is installed ) to the remote server. What is this remote_src in ansible unarchive moduleīy this time you would have understood what is this remote_src is but if you are still having a question. Unarchive: src: "" dest: "/opt/tomcat8/" mode: 0755 remote_src: yes register: "tcinstall" - name: Start the tomcat instanceīecome: yes shell: "./startup.sh" args: chdir: "/opt/tomcat8/apache-tomcat-8.5.49/bin"

#Untar linux command example install#

Mode: 0755 - name : Download and install tomcat 0-openjdk-develīecome: yes file: path: "/opt/tomcat8" state: directory The Playbook - name: Playbook to download and install tomcat8īecome: yes yum: name: java -1.8. Un-tar or uncompress the tomcat into the directory created.

untar linux command example

  • Download the tar.gz file of Tomcat8 binaries.
  • Here is a quick example playbook which performs the following tasks

    #Untar linux command example zip file#

    This is an exciting and wonderful feature of Ansible unarchive module, as it can take URLs as a source of zip file and download it and uncompress it. Now let us see the other features of Ansible unarchive module.ĭownload a Zip file from remote URL and decompress using unarchive Now we know how this unarchive module is working and this playbook has set some context. In a Simple playbook like this we may not measure the value of reducing a task but when it comes to big roles reducing a Number of tasks means something. Vars: - userid : "weblogic" - oracle_home: "/opt/oracle" - jdk_instl_file: "server-jre-8u191-linux-圆4.tar.gz" tasks: - name : Copy the Java JDK filesīecome: yes become_user: " " name: Playbook to copy file and uncompress In this playbook, we use the usual copy module to copy the files over to the remote server and uncompress it using the tar -xvf command Playbook without Unarchive - A usual approach The Example playbooks with and without unarchive module are given below. In the preceding Snapshot, you can see how the playbook with two tasks became a Single task with help of unarchive. Unarchive could do it as a Single task as it can optionally copy the file from control machine to target remote server and uncompress it there. Let us suppose that you have a playbook with two tasks as follows

    #Untar linux command example archive#

    refer the below postĪnsible Archive Examples - Zip files and Directories

    #Untar linux command example how to#

    If you would like to know how to create archive with ansible. So I guess this gives you a clear understanding of how Ansible unarchive module does the job in the background.īefore going to ansible unarchive. If this arg is not supported, it will always unpack the archive. It Uses gtar’s -diff arg to calculate if changed or not.This module requires zipinfo and gtar/ unzip command on the target remote host.Some Quick notes before we see an example of this module Since most of the *nix distributions are having these tools built-in. So the target server must have these commands installed. this module uses the basic unzip and tar -xvf command-line tools to perform the operation. Though the unarchive module is part of Ansible. Ansible unarchive module can optionally copy the files to the remote server before uncompressing them. What is Ansible Unarchive Module and How does it workĪnsible Unarchive module helps to unpack or uncompress the files from an archive file such as tar, tar.gz, zip. What is this remote_src in ansible unarchive module.Download a Zip file from remote URL and decompress using unarchive.

    untar linux command example

  • Playbook with unArchive - A Difference factor.
  • Playbook without Unarchive - A usual approach.
  • What is Ansible Unarchive Module and How does it work.










  • Untar linux command example