DEV Community

Query Filter
Query Filter

Posted on

gradle-80

# 1. Ensure destination directory exists on target host
- name: "CREATE VERSIONED TARGET DIRECTORY"
  ansible.builtin.file:
    path: "/opt/{{ app_prefix }}/{{ app_version }}_{{ app_release }}"
    state: directory
    owner: "{{ owner | default('cometgran') }}"
    group: comet
    mode: '0755'
  become: yes

# 2. Extract TAR archive into created directory
- name: "INSTALL: UNPACK TAR ARCHIVE"
  ansible.builtin.unarchive:
    src: "{{ found_tars.files[0].path }}"
    dest: "/opt/{{ app_prefix }}/{{ app_version }}_{{ app_release }}"
    remote_src: yes
    owner: "{{ owner | default('cometgran') }}"
    group: comet
    mode: '0755'
    extra_opts:
      - '--strip-components=1'  # Keep if TAR contains top-level wrapper folder
  become: yes
  register: tar_install_status
Enter fullscreen mode Exit fullscreen mode

Top comments (0)