Skip to content
upgrade_program.yml 1.28 KiB
Newer Older
jerome's avatar
jerome committed
---

  - name: "install specific packages if any"
    apt:
      name: "{{ package }}"
      state: present
    loop: "{{ packages_list }}"
    loop_control:
      loop_var: package

  ### upgrading app from archive
  - block:
    - name: "copy {{ _tmp_new_app.path }}/{{ app_src_root_name }}/ to {{ app_instance_root }}"
      command: "rsync -ax {{ _tmp_new_app.path }}/{{ app_src_root_name }}/ {{ app_instance_root }}"
      when: app_src is defined and app_src != ''

    - name: "remove {{ _tmp_new_app.path }}"
      file:
        path: "{{ _tmp_new_app.path }}"
        state: absent
      changed_when: False
    when: app_src != ""
jerome's avatar
jerome committed

  ### upgrading from git
  - block:
    - name: "retrieving app from git repo {{ app_git_repo }}"
      git:
        repo: "{{ app_git_repo }}"
        dest: "{{ app_instance_root }}"
        force: yes
        version: "{{ app_version }}"
Mehdi Khadir's avatar
Mehdi Khadir committed
        recursive: false
jerome's avatar
jerome committed
      when: app_git_repo != ""
    become_user: "{{ run_user }}"
    vars:
      ansible_ssh_pipelining: true

  ### php requirements
  - name: "updates php requirements using composer"
    composer:
      command: "update"
      working_dir: "{{ app_instance_root }}"
    when: php_composer == "yes"

jerome's avatar
jerome committed
  ### python3 requirements
  - import_tasks: python3_requirements.yml
    when: python3 == "yes"