Skip to content

Commit

Permalink
Add in persistent folders
Browse files Browse the repository at this point in the history
  • Loading branch information
David Farrington committed Feb 15, 2015
1 parent 1b2c191 commit baae1d4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
22 changes: 18 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,46 @@

# Which version of Magento to deploy
magento_version: 1.9.1.0

# Directories
magento_home_dir: '/var/www/{{ magento_project_name }}'
magento_release_dir: '{{magento_home_dir }}/releases'
magento_current_release: '{{magento_home_dir }}/current'
magento_previous_release: '{{magento_home_dir }}/previous'
magento_src_dir: '/opt/magento_src'
magento_storage_dir: '/mnt/{{ magento_project_name }}'
magento_media_dir: '{{ magento_storage_dir }}/media'
magento_var_dir: '{{ magento_storage_dir }}/var'
magento_persistent_dirs:
- '{{ magento_media_dir }}'
- '{{ magento_var_dir }}'

# Memcached
magento_use_memcached: yes
magento_memcached_port: 11211
magento_memcached_host: localhost

# SSL
magento_ssl: no
magento_ssl_crt_file:
magento_ssl_key_file:

# .htpasswd protection
magento_auth: no
magento_auth_user:
magento_auth_password:

# Nginx log files
magento_access_log: /var/log/nginx/access.log
magento_error_log: /var/log/nginx/error.log

#System handlers
# System handlers
magento_application_group: '{{ magento_project_name }}'
magento_application_user: '{{ magento_project_name }}'

# Get our public key so we can login as the application user
magento_public_key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"

# nginx protected
magento_auth: no

# Database settings
magento_db_host: localhost
magento_table_prefix: ''
Expand Down
2 changes: 2 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

- name: restart nginx
service: name=nginx state=restarted

Expand Down
2 changes: 1 addition & 1 deletion tasks/magento.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- name: Magento | Move Magento to expected folder
command: mv /opt/magento/ {{ magento_src_dir }} creates={{ magento_src_dir }}

- name: Magento | Remove installation crud
- name: Magento | Remove installation cruft
file: path={{ magento_src_dir }}/{{ item }} state=absent
with_items:
- php.ini.sample
Expand Down
4 changes: 4 additions & 0 deletions tasks/users_and_accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
file: path={{ magento_media_dir }} state=directory
owner={{ magento_application_user }} group='www-data'

- name: Users & Accounts | Ensure var directory is made
file: path={{ magento_var_dir }} state=directory mode=775
owner='www-data' group='www-data' recurse=true

- name: Users & Accounts | Add key to authorized keys
authorized_key: user={{ magento_application_user }} key="{{ magento_public_key }}"

Expand Down
1 change: 1 addition & 0 deletions templates/bash_profile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ export APP_MAGE_SRC='{{ magento_src_dir }}'
export APP_MEDIA_DIR='{{ magento_media_dir }}'
export APP_UNIX_USER='{{ magento_application_user }}'
export APP_UNIX_GROUP='{{ magento_application_group }}'
export APP_PERSISTENT_DIRS='{{ magento_persistent_dirs|join(",") }}'

0 comments on commit baae1d4

Please sign in to comment.