Hi there. This is my first time making my own custom Ansible Role inside of Bedrock, and I’m running into some issues, and was hoping I could get some help.
I made a new role using galaxy-ansible
, and added the following items:
To my php.ini file under the php
role, I added this:
ZendGuardLoader_path: /srv/www/domain/zend/zend-loader-php5.6-darwin10.7-x86_64/ZendGuardLoader.so
ZendGuardLoader_opcache_path: /srv/www/domain/zend/zend-loader-php5.6-darwin10.7-x86_64/opcache.so
ZendGuardLoader_enabled: 1
ZendGuardLoader_licensing: 0
Under my zend role, I added to defaults/main.yml
': ZendGuardLoader_version: '7.0.0'
In tasks/main.yml
I added:
- name: Download Zend
get_url: >
url=http://downloads.zend.com/guard/{{ ZendGuardLoader_version }}/zend-loader-php5.6-darwin10.7-x86_64.tar.gz
dest=/srv/www/domain/zend/zend-loader-php5.6-darwin10.7-x86_64.tar.gz
- name: Extract and install Zend
unarchive: src=/srv/www/domain/zend/zend-loader-php5.6-darwin10.7-x86_64.tar.gz
dest=/srv/www/domain/zend/
copy=no
This all worked correctly. It download the latest version (7.0.0
), copied it to the correct directory, added the lines to php.ini
and ran the provision correctly. However, the permissions are -rwxrwxrwx 1 nobody nogroup
.
So, couple of questions:
- How do I not hardcode /srv/www/domain? I tried using
dest="{{ www_root }}/{{ item.key }}/zend/
but got an item can not be found error, or something like that. - How do I make the directory
zend
with Ansible? To get this to work, I had to manually ssh into vagrant, and create the folder, and change the ownership using sudo. So, there is something I am doing wrong. - How do I set appropriate permissions?
- Use variables instead of hardcoding links in
php.ini