Ansible Module unarchive: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
Line 7: Line 7:
=Overview=
=Overview=
<syntaxhighlight lang='yaml'>
<syntaxhighlight lang='yaml'>
- name: "Install C3 IntelliJ Plugin"
- name: "Install IntelliJ Plugin"
   unarchive:
   unarchive:
     src: "{{ansible_env.SOME_DIR}}/some-other-dir/some-file.zip"
     src: "{{ansible_env.SOME_DIR}}/some-other-dir/some-file.zip"
     dest: "{{ some_path }}"
     dest: "{{ some_path }}"
   when: (intellij_version == intellij.version|string) and (builder == 'gradle') and intellij_plugin_dir.stat.exists and not some_dir.stat.exists
   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:
    src: /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/lib/src.zip
    dest: /tmp
    list_files: true
  register: unarchive_result
</syntaxhighlight>
</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