aboutsummaryrefslogtreecommitdiff
path: root/manifests/packages/dpa.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/packages/dpa.pp')
-rw-r--r--manifests/packages/dpa.pp67
1 files changed, 67 insertions, 0 deletions
diff --git a/manifests/packages/dpa.pp b/manifests/packages/dpa.pp
new file mode 100644
index 0000000..1af6ab9
--- /dev/null
+++ b/manifests/packages/dpa.pp
@@ -0,0 +1,67 @@
+class php::packages::dpa {
+ file { '/etc/apt/trusted.gpg.d/deb.sury.org-php.gpg':
+ ensure => present,
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ source => 'pupet:///modules/php/files/deb.sury.org.gpg',
+ }
+
+ file { '/etc/apt/sources.list.d/php.list' :
+ ensure => present,
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ content => "deb https://packages.sury.org/php/ ${::lsbdistcodename} main\n",
+ require => File['/etc/apt/trusted.gpg.d/php.gpg'],
+ notify => Exec['php-apt-auto-update'],
+ }
+
+ exec { 'php-apt-auto-update':
+ command => "/usr/bin/apt-get update",
+ user => "root",
+ refreshonly => true,
+ }
+
+ # The needed packages: we could also try libapache2-mod-php5.6filter
+ package { 'php5':
+ name => 'php5.6',
+ require => File['/etc/apt/sources.list.d/php.list',
+ }
+
+ package { 'php5-cli':
+ name => 'php5.6-cli',
+ require => File['/etc/apt/sources.list.d/php.list',
+ }
+
+ package { [ 'php5.6-mysql', 'php5.6-sqlite3', 'php5.6-curl', 'php5.6-gmp', 'libapache2-mod-php5.6' ]:
+ ensure => installed,
+ require => File['/etc/apt/sources.list.d/php.list',
+ }
+
+ # Optional packages
+ package { [ "php5.6-gd", "php-imagick" ]:
+ ensure => installed,
+ require => File['/etc/apt/sources.list.d/php.list',
+ }
+
+ # Not available anymore
+ package { 'php5.6-suhosin':
+ ensure => absent,
+ require => File['/etc/apt/sources.list.d/php.list',
+ }
+
+ # The needed apache modules
+ apache::module { 'php5.6':
+ ensure => present,
+ require => Package['libapache2-mod-php5.6'],
+ }
+
+ # Default alternative
+ file { "/etc/alternatives/php":
+ ensure => "/usr/bin/php5.6",
+ owner => root,
+ group => root,
+ require => Package['php5'],
+ }
+}