aboutsummaryrefslogtreecommitdiff
path: root/manifests/packages/ppa.pp
blob: 4dc4f7ae7d1bff779bce9d0de2c195448ff4be49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class php::packages::ppa {
  #package { 'python-software-properties':
  #  ensure => present,
  #}

  ## TODO: check repository key!
  #exec { 'add-apt-repository-ondrej-php':
  #  command => '/usr/bin/add-apt-repository -y ppa:ondrej/php && apt-get update',
  #  user    => 'root',
  #  creates => '/etc/apt/sources.list.d/ondrej-ubuntu-php-xenial.list',
  #  require => Package['python-software-properties'],
  #}

  # The needed packages: we could also try libapache2-mod-php5.6filter
  package { 'php5':
    name    => 'php5.6',
    #require => Exec['add-apt-repository-ondrej-php'],
  }

  package { 'php5-cli':
    name    => 'php5.6-cli',
    #require => Exec['add-apt-repository-ondrej-php'],
  }

  package { [ 'php5.6-mysql', 'php5.6-sqlite3', 'php5.6-curl', 'php5.6-gmp', 'libapache2-mod-php5.6' ]:
    ensure  => installed,
    #require => Exec['add-apt-repository-ondrej-php'],
  }

  # Optional packages
  package { [ "php5.6-gd", "php-imagick" ]:
    ensure  => installed,
    #require => Exec['add-apt-repository-ondrej-php'],
  }

  # Not available anymore
  package { 'php5.6-suhosin':
    ensure  => absent,
    #require => Exec['add-apt-repository-ondrej-php'],
  }

  # 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'],
  }
}