Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using geerlingguy.php-versions prevents overriding geerlingguy.php's php_packages variable #19

Closed
ctorgalson opened this issue May 12, 2018 · 3 comments

Comments

@ctorgalson
Copy link

Greetings.

We just found out about and started to test this role alongside your geerlingguy.php role (thanks for these!)

Unfortunately, we've found that this role makes it impossible to customize geerlingguy.php's php_packages variable. I'm fairly sure this isn't a case of us misunderstanding the use or one or both roles, but I guess that's always a possibility 😄.

For example, the following variable definition in a playbook works unless the geerlingguy.php-versions role is used:

    # Replace default var with the same list, with mod-php and minus php7.1-fpm.
    php_packages:
      - "php{{ php_version }}"
      - "php{{ php_version }}-apcu"
      - "php{{ php_version }}-cli"
      - "php{{ php_version }}-common"
      - "php{{ php_version }}-curl"
      - "php{{ php_version }}-dev"
      - "php{{ php_version }}-gd"
      - "php{{ php_version }}-imap"
      - "php{{ php_version }}-json"
      - "php{{ php_version }}-mbstring"
      - "php{{ php_version }}-mcrypt"
      - "php{{ php_version }}-opcache"
      - "php{{ php_version }}-sqlite3"
      - "php{{ php_version }}-xml"
      - "php{{ php_version }}-yaml"
      - "libapache2-mod-php{{ php_version }}"

I've created a git repo containing a playbook and Vagrantfile to demonstrate both the working and non-working configurations: https://github.com/ctorgalson/php-versions

@geerlingguy
Copy link
Owner

@oxyc and I wrote this role mostly to make it super easy for people to switch between 5.6, 7.0, 7.1, and 7.2 on Drupal VM (https://www.drupalvm.com), and only when used in tandem with geerlingguy.php.

That said, if you just want to add packages to the list, the best way is to use the php_packages_extra variable in the geerlingguy.php role, and add additional packages there.

I admit the use case of this role is slightly narrow in that, if you don't need all the packages this role manages, and can't live with the extra packages being installed, then the best option is to fork the role and customize it to your needs—or as you say, drop using this role and manage the php_packages list entirely on your own.

@ctorgalson
Copy link
Author

@oxyc and I wrote this role mostly to make it super easy for people to switch between 5.6, 7.0, 7.1, and 7.2 on Drupal VM.

Fair enough. We'd been managing the php versions aspect manually up til now in any case. Thanks for the feedback (and also for the million-and-one roles)!

@ajardan
Copy link

ajardan commented Nov 5, 2018

@ctorgalson you can use a group or host var to override this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants