geerlingguy / drupal-vm

A VM for Drupal development
https://www.drupalvm.com/
MIT License
1.37k stars 645 forks source link

When deploying on Ubuntu no way to stop repo='ppa:ondrej/php' from being added. #1418

Closed gheydon closed 7 years ago

gheydon commented 7 years ago

Issue Type

Your OS

Summary

So I could install php 5.5 onto the newly build system there is no method to stopo the repository repo='ppa:ondrej/php' from being added, which will force you to install php7.1 and not 5.5. If there was a way to turn this repository off or even allow the specifying of another repository or even a list of repositories and then in you can use the "php_packages" variable to specify which packages to install.

oxyc commented 7 years ago

What if we added when: php_version != '' as a conditional for including the geerlingguy.php-versions role? By setting php_version: '' the user could then use the defaults in geerlingguy.php and/or set their own packages with php_packages. As long as the variable exists I don't think anything outside of geerlingguy.php-versions depend on it (dashboard wont know the version).

gheydon commented 7 years ago

ATM this is what I have done so that would be great. It will get me over this hump, but being able to specify repos in the config.ymp would give that higher level of flexibility.

oxyc commented 7 years ago

You could also add repositories using pre_provision_tasks_dir or pre_provision_scripts.

gheydon commented 7 years ago

perfect, most likely solves my other issue that I just added.

Thanks.

gheydon commented 7 years ago

I have been finalising the dev box for my client and using my new powers for good. I have found 1 small issue which causes you to configure the same thing in many places.

When I was doing the vagrant up I kept noticing that config file paths were set to /etc/php//fpm.

I had a quick look and there is no where to set up a single default path something like

php_fpm_conf: /etc/php5/fpm

and then all the other vars build on top of that value.

oxyc commented 7 years ago

As the geerlingguy.php role needs to be flexible enough to work with Centos 6/7, Debian, Fedora, Ubuntu 12/14/16 there's really not a good way to build on top of variables. Blame Debian/Ubuntu. They went a bit crazy with the directory structure for PHP so there's quite a few paths that need to be changed.

I'm confused though, the default paths should be /etc/php/7.0/fpm, like the upstream role sets https://github.com/geerlingguy/ansible-role-php/blob/master/vars/Debian.yml#L20. Are you sure they're all set to /etc/php//*? that should only happen if the geerlingguy.php-versions role runs.

I added a brief note about variables in the PR I opened https://github.com/geerlingguy/drupal-vm/pull/1419/commits/91962459c5758984093b9e70a2b1337e68a64d70. For Ubuntu 14.04 you would basically have to undo the changes done in geerlingguy.php when it defaulted to PHP 7.0 https://github.com/geerlingguy/ansible-role-php/commit/b63cf5a754eeabdfbebfeda4d1245469b128cc95#diff-d1209cdec7b44f17b36d7a26a22473d0

oxyc commented 7 years ago

Fixed in #1419.