Skip to content

Commit

Permalink
Merge pull request #12 from sitewards/change_relative_symlink_pathes
Browse files Browse the repository at this point in the history
AdHoc (change) Use relative pathes for the shared folders
  • Loading branch information
toxix authored Jan 14, 2020
2 parents c7409c1 + e7fc3f1 commit a25feb5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 23 additions & 24 deletions tasks/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 }}"
Expand All @@ -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 }}"
Expand Down
1 change: 1 addition & 0 deletions templates/logrotate.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#/var/www/html/var/log/*log {
{{ magento_app_root }}/var/log/*log {
weekly
rotate 12
Expand Down

0 comments on commit a25feb5

Please sign in to comment.