---
# Tasks to setup cakephp by copying the correct configs

- name: Copy CakePHP config files
  template: src={{item}}.j2 dest={{code_dir}}/common/config/{{item}} 
  with_items:
  - database.php
  - core.php
- name: Create links for CakePHP config files
  file: state=link src={{code_dir}}/common/config/{{item}} dest=/var/www-prod/app/config/{{item}}
  with_items:
  - database.php
  - core.php
- name: Give read permissions to the code directory
  file: path=/var/www-prod state=directory recurse=yes mode=555
- name: Create cache directory
  file: path=/var/www-prod/app/tmp/cache state=directory recurse=yes mode=777
---
# Tasks to setup cakephp by copying the correct configs

- name: Copy CakePHP config files
  template: src={{item}}.j2 dest={{code_dir}}/common/config/{{item}} 
  with_items:
  - database.php
  - core.php
- name: Create links for CakePHP config files
  file: state=link src=../../../../common/config/{{item}} dest={{code_dir}}/versions/current/app/config/{{item}} force=yes
  with_items:
  - database.php
  - core.php
- name: Give read permissions to the code directory
  file: path=/var/www-prod state=directory recurse=yes mode=555
- name: Create cache directory
  file: path=/var/www-prod/app/tmp/cache state=directory recurse=yes mode=777
Create links for cakephp configs with relative path
roles/setup_cakephp: Create links for cakephp configs with relative path

The symbolic links for core.php and database.php in app/config/ are now
created with relative paths to configs present in common/config
