diff --git a/defaults/main.yml b/defaults/main.yml index 6a6da0f..f35ba22 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -88,7 +88,8 @@ magento_cron_tasks: ## A list of folders that contain content that should persist through releases. magento_shared_folders: [] ## Directories are defined in key -> value pairs, where the "src" is the directory that contains the content, and -## "dest" is where it should exist in Magento. If the source directories do not exist, they are created. +## "dest" is where it should exist in Magento. The dest is relative to to the release folder of magento. +## If the source directories do not exist, they are created. # - src: # dest: ## State can be any of the ansible file states, but defaults to directory diff --git a/tasks/installation.yml b/tasks/installation.yml index 75b500c..a0cc06d 100644 --- a/tasks/installation.yml +++ b/tasks/installation.yml @@ -98,27 +98,6 @@ group: "{{ magento_group }}" mode: "u=rw,g=,o=" -- name: "Enable maintenance mode" - file: - path: "{{ magento_release_folder }}/{{ magento_release_version }}/var/.maintenance.flag" - owner: "{{ magento_user }}" - group: "{{ magento_group }}" - state: "touch" - when: - - magento_skip_release == False - -- name: "Release the application" - file: - src: "{{ magento_release_folder }}/{{ magento_release_version }}" - force: "yes" - path: "{{ magento_app_root }}" - owner: "{{ magento_user }}" - group: "{{ magento_group }}" - state: "link" - register: "magento_release_updated" - when: - - magento_skip_release == False - - name: "Ensure the source content exists" file: path: "{{ item.src }}" @@ -136,7 +115,7 @@ # where "sitewards/path/to" does not exist. - name: "Ensure the destination container directories exist" file: - path: "{{ item.dest | dirname }}" + path: "{{ magento_release_folder }}/{{ magento_release_version }}/{{ item.dest | dirname }}" state: "directory" owner: "{{ magento_user }}" group: "{{ magento_group }}" @@ -147,19 +126,39 @@ - name: "Delete the destinations if they exist" file: - path: "{{ item.dest }}" + path: "{{ magento_release_folder }}/{{ magento_release_version }}/{{ item.dest }}" state: "absent" with_items: "{{ magento_shared_folders }}" - name: "Ensure the symlinks for the shared content exist" file: src: "{{ item.src }}" - path: "{{ item.dest }}" + path: "{{ magento_release_folder }}/{{ magento_release_version }}/{{ item.dest }}" owner: "{{ magento_user }}" group: "{{ magento_group }}" state: "{{ item.state | default('link') }}" with_items: "{{ magento_shared_folders }}" +- name: "Enable maintenance mode" + file: + path: "{{ magento_release_folder }}/{{ magento_release_version }}/var/.maintenance.flag" + owner: "{{ magento_user }}" + group: "{{ magento_group }}" + state: "touch" + when: + - magento_skip_release == False + +- name: "Release the application" + file: + src: "{{ magento_release_folder }}/{{ magento_release_version }}" + force: "yes" + path: "{{ magento_app_root }}" + owner: "{{ magento_user }}" + group: "{{ magento_group }}" + state: "link" + register: "magento_release_updated" + when: + - magento_skip_release == False - name: "Reload the PHP runtime" service: name: "{{ magento_php_service }}" diff --git a/templates/logrotate.j2 b/templates/logrotate.j2 index 2ef7d03..c030097 100644 --- a/templates/logrotate.j2 +++ b/templates/logrotate.j2 @@ -1,3 +1,4 @@ +#/var/www/html/var/log/*log { {{ magento_app_root }}/var/log/*log { weekly rotate 12