Ansible Module unarchive: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with " - name: "Install C3 IntelliJ Plugin" unarchive: src: "{{ansible_env.C3_SERVER_ROOT}}/config/c3/c3-intellij-plugin.zip" dest: "{{ idea_plugins_path }}" when: (in...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
=External=
* https://docs.ansible.com/ansible/latest/collections/ansible/builtin/unarchive_module.html


=Internal=
* [[Ansible_Concepts#unarchive|Ansible Concepts]]


 
=Overview=
- name: "Install C3 IntelliJ Plugin"
<syntaxhighlight lang='yaml'>
- name: "Install IntelliJ Plugin"
  unarchive:
    src: "{{ansible_env.SOME_DIR}}/some-other-dir/some-file.zip"
    dest: "{{ some_path }}"
  when: (intellij_version == intellij.version|string) and (builder == 'gradle') and intellij_plugin_dir.stat.exists and not some_dir.stat.exists
</syntaxhighlight>
=Listing the Content=
It seems it extracts the content even if I want to list it:
<syntaxhighlight lang='yaml'>
- name: List the content of an archive
   unarchive:
   unarchive:
     src: "{{ansible_env.C3_SERVER_ROOT}}/config/c3/c3-intellij-plugin.zip"
     src: /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/lib/src.zip
     dest: "{{ idea_plugins_path }}"
     dest: /tmp
   when: (intellij_version == intellij.version|string) and (builder == 'gradle') and intellij_plugin_dir.stat.exists and not c3_intellij_plugin_dir.stat.exists
    list_files: true
   register: unarchive_result
</syntaxhighlight>

Latest revision as of 10:05, 5 July 2021

External

Internal

Overview

- name: "Install IntelliJ Plugin"
  unarchive:
    src: "{{ansible_env.SOME_DIR}}/some-other-dir/some-file.zip"
    dest: "{{ some_path }}"
  when: (intellij_version == intellij.version|string) and (builder == 'gradle') and intellij_plugin_dir.stat.exists and not some_dir.stat.exists

Listing the Content

It seems it extracts the content even if I want to list it:

- name: List the content of an archive
  unarchive:
    src: /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/lib/src.zip
    dest: /tmp
    list_files: true
  register: unarchive_result