{"action":"created","issue":{"url":"https://api.github.com/repos/geerlingguy/ansible-role-php-versions/issues/13","repository_url":"https://api.github.com/repos/geerlingguy/ansible-role-php-versions","labels_url":"https://api.github.com/repos/geerlingguy/ansible-role-php-versions/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/geerlingguy/ansible-role-php-versions/issues/13/comments","events_url":"https://api.github.com/repos/geerlingguy/ansible-role-php-versions/issues/13/events","html_url":"https://github.com/geerlingguy/ansible-role-php-versions/issues/13","id":270410725,"number":13,"title":"Role overwrites gerrlingguy.php's php_packages","user":{"login":"socketwench","id":763448,"avatar_url":"https://avatars3.githubusercontent.com/u/763448?v=4","gravatar_id":"","url":"https://api.github.com/users/socketwench","html_url":"https://github.com/socketwench","followers_url":"https://api.github.com/users/socketwench/followers","following_url":"https://api.github.com/users/socketwench/following{/other_user}","gists_url":"https://api.github.com/users/socketwench/gists{/gist_id}","starred_url":"https://api.github.com/users/socketwench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socketwench/subscriptions","organizations_url":"https://api.github.com/users/socketwench/orgs","repos_url":"https://api.github.com/users/socketwench/repos","events_url":"https://api.github.com/users/socketwench/events{/privacy}","received_events_url":"https://api.github.com/users/socketwench/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-01T18:46:05Z","updated_at":"2017-11-18T16:46:12Z","closed_at":null,"author_association":"NONE","body":"## Description\r\n\r\nWhen using this role, the php_packages variable is completely overridden by the role's defaults. \r\n\r\nFor example, this is in my group_vars:\r\n\r\n```\r\nphp_packages:\r\n  - php\r\n  - php-fpm\r\n  - php-cli\r\n  - php7.1-common\r\n  - php-gd\r\n  - php-mbstring\r\n  - php-xml\r\n  - php-memcached\r\n  - php7.1-opcache\r\n  - php-sqlite3\r\n  - php7.1-mysql\r\n  - php7.1-curl\r\n```\r\n\r\nWhen using this role, however, the task reads:\r\n\r\n`TASK [geerlingguy.php : Ensure PHP packages are installed.] ********************\r\nok: [45.56.85.211] => (item=[u'php7.1', u'php7.1-apcu', u'php7.1-cli', u'php7.1-common', u'php7.1-curl', u'php7.1-dev', u'php7.1-fpm', u'php7.1-gd', u'php7.1-imap', u'php7.1-json', u'php7.1-mbstring', u'php7.1-mcrypt', u'php7.1-opcache', u'php7.1-sqlite3', u'php7.1-xml', u'php7.1-yaml'])`\r\n\r\nThis corresponds to the defaults provided by this role for my platform: https://github.com/geerlingguy/ansible-role-php-versions/blob/master/vars/Debian.yml\r\n\r\nThe problem appears to be in the set_fact that does not check if the variable exists elsewhere first. \r\n\r\nThis is a bit of a problem for database backed sites, since we can't install mysql using the method familiar when only using the php role, and not this role as well.\r\n\r\n## Workaround\r\n\r\nInstead of overriding the php_packages variable, use php_packages_extra\r\n\r\n## Proposed solution\r\n\r\nEither document that this role overrides php_packages completely, or split off the set_fact to account for a preexisting definition."},"comment":{"url":"https://api.github.com/repos/geerlingguy/ansible-role-php-versions/issues/comments/345454411","html_url":"https://github.com/geerlingguy/ansible-role-php-versions/issues/13#issuecomment-345454411","issue_url":"https://api.github.com/repos/geerlingguy/ansible-role-php-versions/issues/13","id":345454411,"user":{"login":"yethee","id":559488,"avatar_url":"https://avatars0.githubusercontent.com/u/559488?v=4","gravatar_id":"","url":"https://api.github.com/users/yethee","html_url":"https://github.com/yethee","followers_url":"https://api.github.com/users/yethee/followers","following_url":"https://api.github.com/users/yethee/following{/other_user}","gists_url":"https://api.github.com/users/yethee/gists{/gist_id}","starred_url":"https://api.github.com/users/yethee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yethee/subscriptions","organizations_url":"https://api.github.com/users/yethee/orgs","repos_url":"https://api.github.com/users/yethee/repos","events_url":"https://api.github.com/users/yethee/events{/privacy}","received_events_url":"https://api.github.com/users/yethee/received_events","type":"User","site_admin":false},"created_at":"2017-11-18T16:46:12Z","updated_at":"2017-11-18T16:46:12Z","author_association":"NONE","body":"What version of Ansible are you using?\r\n\r\nThis behaviour is valid for Ansible of 2.4.1.0. In 2.4.0.0 or lower local variable is not overridden."}}
{"actor":{"display_login":"yethee"}}