---

- name: Allow phar execution
  lineinfile:
    dest=/etc/php.d/suhosin.ini
    regexp='^suhosin.executor.include.whitelist = phar'
    insertafter='^;suhosin.stealth = 1'
    line='suhosin.executor.include.whitelist = phar'
    state=present
  when: php_package != "php55u" and php_package != "php56u"

- name: Install composer
  shell: curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer
    creates=/usr/bin/composer

- name: Make sure /usr/lib/composer exists
  action: file path=/usr/lib/composer state=directory

- name: Set up composer environment variables
  template: src=composer.sh.j2 dest=/etc/profile.d/composer.sh

- name: Install drush
  shell: source /etc/profile.d/composer.sh && composer global require drush/drush:{{ drush.version }} && drush
    creates=/usr/bin/drush

- name: Ensure drupal/files dir exists
  file: path=/vagrant/{{ drupal_files }} state=directory

# - name: Install drush sql-sync-pipe
#   shell: cd {{ composer.path }}/vendor/drush/drush/commands && git clone https://github.com/mvance/sql-sync-pipe.git
#     creates={{ composer.path }}/vendor/drush/drush/commands/sql-sync-pipe/sql_sync_pipe.drush.inc



---

- name: Allow phar execution
  lineinfile:
    dest=/etc/php.d/suhosin.ini
    regexp='^suhosin.executor.include.whitelist = phar'
    insertafter='^;suhosin.stealth = 1'
    line='suhosin.executor.include.whitelist = phar'
    state=present
  when: php_package != "php55u" and php_package != "php56u"

- name: Install composer
  shell: curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer
    creates=/usr/bin/composer

- name: Make sure /usr/lib/composer exists
  action: file path=/usr/lib/composer state=directory

- name: Set up composer environment variables
  template: src=composer.sh.j2 dest=/etc/profile.d/composer.sh

- name: Install drush
  shell: source /etc/profile.d/composer.sh && composer global require drush/drush:{{ drush.version }} && drush
    creates=/usr/bin/drush

- name: Ensure drupal/files dir exists and set it to world writable
  file: path=/vagrant/{{ drupal_files }} state=directory mode=0777

# - name: Install drush sql-sync-pipe
#   shell: cd {{ composer.path }}/vendor/drush/drush/commands && git clone https://github.com/mvance/sql-sync-pipe.git
#     creates={{ composer.path }}/vendor/drush/drush/commands/sql-sync-pipe/sql_sync_pipe.drush.inc



Set the files folder to have 777 permissions.
Set the files folder to have 777 permissions.
