ansible/roles/app.install/tasks/main.yml
- name: Check if current dir exists
stat:
path: "{{ app_current_dir }}"
register: current_dir
- name: Check if root dir exists
stat:
path: "{{ app_root }}"
register: root_dir
- name: Migrate legacy structure
include_tasks: migrate.yml
when:
- current_dir.stat.exists == false
- root_dir.stat.exists == true
- name: Create project deployment structure
file:
path: "{{ item }}"
state: directory
recurse: yes
owner: "{{ system_user }}"
group: "{{ system_user }}"
mode: 0755
with_items:
- "{{ app_releases_dir }}"
- "{{ app_shared_dir }}/var/security-advisories"
- "{{ app_shared_dir }}/var/log"
- "{{ app_shared_dir }}/var/cache"
- "{{ app_shared_dir }}/var/proxy"
- "{{ app_shared_dir }}/var/repo"