{"action":"created","issue":{"url":"https://api.github.com/repos/mayflower/puppet-php/issues/147","labels_url":"https://api.github.com/repos/mayflower/puppet-php/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/mayflower/puppet-php/issues/147/comments","events_url":"https://api.github.com/repos/mayflower/puppet-php/issues/147/events","html_url":"https://github.com/mayflower/puppet-php/pull/147","id":122009219,"number":147,"title":"Fixes non-overridable paths","user":{"login":"cgalvarez","id":10707639,"avatar_url":"https://avatars.githubusercontent.com/u/10707639?v=3","gravatar_id":"","url":"https://api.github.com/users/cgalvarez","html_url":"https://github.com/cgalvarez","followers_url":"https://api.github.com/users/cgalvarez/followers","following_url":"https://api.github.com/users/cgalvarez/following{/other_user}","gists_url":"https://api.github.com/users/cgalvarez/gists{/gist_id}","starred_url":"https://api.github.com/users/cgalvarez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgalvarez/subscriptions","organizations_url":"https://api.github.com/users/cgalvarez/orgs","repos_url":"https://api.github.com/users/cgalvarez/repos","events_url":"https://api.github.com/users/cgalvarez/events{/privacy}","received_events_url":"https://api.github.com/users/cgalvarez/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mayflower/puppet-php/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/mayflower/puppet-php/labels/in%20progress","name":"in progress","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mayflower/puppet-php/milestones/13","html_url":"https://github.com/mayflower/puppet-php/milestones/4.0.0","labels_url":"https://api.github.com/repos/mayflower/puppet-php/milestones/13/labels","id":1213284,"number":13,"title":"4.0.0","description":"","creator":{"login":"fpletz","id":114159,"avatar_url":"https://avatars.githubusercontent.com/u/114159?v=3","gravatar_id":"","url":"https://api.github.com/users/fpletz","html_url":"https://github.com/fpletz","followers_url":"https://api.github.com/users/fpletz/followers","following_url":"https://api.github.com/users/fpletz/following{/other_user}","gists_url":"https://api.github.com/users/fpletz/gists{/gist_id}","starred_url":"https://api.github.com/users/fpletz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpletz/subscriptions","organizations_url":"https://api.github.com/users/fpletz/orgs","repos_url":"https://api.github.com/users/fpletz/repos","events_url":"https://api.github.com/users/fpletz/events{/privacy}","received_events_url":"https://api.github.com/users/fpletz/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":20,"state":"open","created_at":"2015-07-17T17:36:31Z","updated_at":"2015-12-14T16:24:54Z","due_on":"2015-12-23T23:00:00Z","closed_at":null},"comments":19,"created_at":"2015-12-14T09:57:21Z","updated_at":"2015-12-19T00:00:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mayflower/puppet-php/pulls/147","html_url":"https://github.com/mayflower/puppet-php/pull/147","diff_url":"https://github.com/mayflower/puppet-php/pull/147.diff","patch_url":"https://github.com/mayflower/puppet-php/pull/147.patch"},"body":"When I have tried to install the recently released PHP 7.0.0, I have come across some issues:\r\n\r\n1. The path for FPM pool conf files are built with `$::php::params::fpm_pool_dir` instead of `$::php::fpm::config::pool_base_dir`. This makes impossible to override the path of these files, but this path can be overriden with previous parameter from class `php::fpm::config`, and that path should be used because the pools belong to FPM and should use its base dir.\r\n2. The path for PHP extensions ini files are built with `$::php::params::config_root_ini`, and we have the same previous problem: it is impossible to override that path. This should be a parameter from the defined type `php::extension`, but it would not be *hierable* due to the intrinsic nature of the defined type. The best approach I have come along is adding a new parameter `$::php::config_root_ini` to class `php` (at `manifests/init.pp`), so it becomes tuneable through manifests and Hiera also.\r\n3. `php5enmod` and `php5query` commands in debian/ubuntu becomes `phpenmod` and `phpquery` with PHP 7, so the module fails to enable the requested extensions in those systems. The path to those tools could be added as parameter of the defined type `php::extension`, but, as it is a global command for the machine, I think it should be in the main class `php` at `init.pp`, where I have added them. I have added their defaults in `php::params`, so they inherit properly the default values when not provided.\r\n4. All paths can be easily changed if a new param `$::php::params::cfg_root` is added to `php::params`.\r\n\r\nSo firstly I used the following Hiera setup to get PHP 7 working in my ubuntu virtual machine:\r\n\r\n```\r\nphp::cli::inifile: '/etc/php/7.0/cli/php.ini'\r\nphp::extensions:\r\n  'xdebug':\r\n    ensure: '2.4.0RC3'\r\n    provider: 'pecl'\r\nphp::fpm::config::config_file: '/etc/php/7.0/fpm/php-fpm.conf'\r\nphp::fpm::config::error_log: '/var/log/php7.0-fpm.log'\r\nphp::fpm::config::inifile: '/etc/php/7.0/fpm/php.ini'\r\nphp::fpm::config::pid_file: '/var/run/php/php7.0-fpm.pid'\r\nphp::fpm::config::pool_base_dir: '/etc/php/7.0/fpm/pool.d'\r\nphp::fpm::inifile: '/etc/php/7.0/fpm/php.ini'\r\nphp::fpm::service::service_name: 'php7.0-fpm'\r\nphp::fpm::pools:\r\n  'www':\r\n    listen: '/var/run/php/php7.0-fpm.sock'\r\nphp::package_prefix: 'php7.0-'\r\nphp::repo::ubuntu::ppa: 'ondrej/php-7.0'\r\n```\r\n\r\n\r\nBut then:\r\n\r\n* **1** forced pool to be at '/etc/php5/fpm/pool.d/www', but it should be at '/etc/php/7.0/fpm/pool.d/www'. After applying, the pull request fixes issue **1** it and the module works as expected.\r\n* **2** forced `xdebug` extension conf file to be at `'/etc/php5/mods-available/xdebug.ini'`, but it should be at `'etc/php/7.0/mods-available/xdebug.ini'`. After applying, the pull request fixes issue **2** and the module works as expected.\r\n* **3** fired puppet error `Could not find command '/usr/sbin/php5query'` or `Could not find command '/usr/sbin/php5enmod'`. After applying, the pull request fixes **3** and the module works as expected.\r\n* after applying the pull request, hiera setup becomes easier and shorter.\r\n\r\nAfter applying the pull request, the Hiera code becomes:\r\n\r\n```\r\nphp::extensions:\r\n  'xdebug':\r\n    ensure: '2.4.0RC3'\r\n    provider: 'pecl'\r\nphp::fpm::config::error_log: '/var/log/php7.0-fpm.log'\r\nphp::fpm::config::pid_file: '/var/run/php/php7.0-fpm.pid'\r\nphp::fpm::service::service_name: 'php7.0-fpm'\r\nphp::fpm::pools:\r\n  'www':\r\n    listen: '/var/run/php/php7.0-fpm.sock'\r\nphp::package_prefix: 'php7.0-'\r\nphp::params::config_root: '/etc/php/7.0'\r\nphp::repo::ubuntu::ppa: 'ondrej/php-7.0'\r\n```\r\n\r\nI have only tested this in Ubuntu 14.04, but the changes proposed in the pull request should not introduce errors in any other system. Finally, the pull request makes the module much more customizable.\r\n\r\nResolves #146 "},"comment":{"url":"https://api.github.com/repos/mayflower/puppet-php/issues/comments/165923636","html_url":"https://github.com/mayflower/puppet-php/pull/147#issuecomment-165923636","issue_url":"https://api.github.com/repos/mayflower/puppet-php/issues/147","id":165923636,"user":{"login":"cubiclelord","id":9519908,"avatar_url":"https://avatars.githubusercontent.com/u/9519908?v=3","gravatar_id":"","url":"https://api.github.com/users/cubiclelord","html_url":"https://github.com/cubiclelord","followers_url":"https://api.github.com/users/cubiclelord/followers","following_url":"https://api.github.com/users/cubiclelord/following{/other_user}","gists_url":"https://api.github.com/users/cubiclelord/gists{/gist_id}","starred_url":"https://api.github.com/users/cubiclelord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubiclelord/subscriptions","organizations_url":"https://api.github.com/users/cubiclelord/orgs","repos_url":"https://api.github.com/users/cubiclelord/repos","events_url":"https://api.github.com/users/cubiclelord/events{/privacy}","received_events_url":"https://api.github.com/users/cubiclelord/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T00:00:59Z","updated_at":"2015-12-19T00:00:59Z","body":"I think I found an issue with $config_root_ini. When using the ondrej-php7 packages on Ubuntu 14.04, the extension configs are all stored in /etc/php/mods-avaialble, not /etc/php/7.0/mods-available, which is where the current module expects them to be. Any ideas about how to adjust this?"}}