Forge Home

php_fact

This module adds a custom PHP packages fact.

Jake Spain

thespain

5,535 downloads

5,535 latest version

5.0 quality score

Version information

  • 0.1.0 (latest)
released Aug 24th 2017
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 6.0.0
  • RedHat
    ,
    CentOS

Start using this module

Documentation

thespain/php_fact — version 0.1.0 Aug 24th 2017

Puppet Forge GitHub tag

puppet-php-fact

A custom Puppet fact for reporting the full version of all installed PHP packages.

What this fact returns

This custom fact will return all installed versions of php including multiple Software Collections version. This is more useful than the typical version returned by php -v because this fact also returns the backported patch number. You can find information about backporting at https://access.redhat.com/security/updates/backporting

Example Facter Output:

This is what it looks like when you have the stock PHP installed along with the 5.5 version that is only available via CentOS or SoftwareCollections.org and versions 5.6 and 7.0 from Red Hat.

"php_packages": {
  "php": {
    "full_version": "5.4.16-42",
    "base_version": "5.4.16",
    "major": "5",
    "minor": "4",
    "revsion": "16",
    "backport": "42",
    "os": "el7",
    "arch": "x86_64",
    "package": "php-5.4.16-42.el7.x86_64"
  },
  "php55": {
    "full_version": "5.5.21-5",
    "base_version": "5.5.21",
    "major": "5",
    "minor": "5",
    "revsion": "21",
    "backport": "5",
    "os": "el7",
    "arch": "x86_64",
    "package": "php55-php-5.5.21-5.el7.x86_64",
    "software_collection": "php55"
  },
  "php56": {
    "full_version": "5.6.25-1",
    "base_version": "5.6.25",
    "major": "5",
    "minor": "6",
    "revsion": "25",
    "backport": "1",
    "os": "el7",
    "arch": "x86_64",
    "package": "rh-php56-php-5.6.25-1.el7.x86_64",
    "software_collection": "rh-php56"
  },
  "php70": {
    "full_version": "7.0.10-2",
    "base_version": "7.0.10",
    "major": "7",
    "minor": "0",
    "revsion": "10",
    "backport": "2",
    "os": "el7",
    "arch": "x86_64",
    "package": "rh-php70-php-7.0.10-2.el7.x86_64",
    "software_collection": "rh-php70"
  }
}

Limitations

This fact is currently only compatible with the Redhat osfamily.

Not automated testing yet.

Development

Contributing

Pull requests are welcome!

Contributors

Gene Liverman (@genebean) - Refactored for ease of readability and quicker execution time.