# 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'
become: yes
register: tar_install_status
- name: "SHOW INSTALLATION RESULTS"
ansible.builtin.debug:
var: tar_install_status
- name: "LINK: CREATE SYMLINK"
ansible.builtin.file:
src: "/opt/{{ app_prefix }}/{{ app_version }}_{{ app_release }}"
dest: "/opt/{{ app_prefix }}/live"
state: link
force: yes
follow: false
become: yes
become_user: "{{ owner }}"
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)