aboutsummaryrefslogtreecommitdiff
path: root/manifests/ppa.pp
blob: 1166439bc6b24f60d669b2130ddd84301d43b8c3 (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
class php::ppa {
  #package { 'python-software-properties':
  #  ensure => present,
  #}

  # This required alternative checking of 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'],
  #}

  file { '/etc/apt/trusted.gpg.d/ondrej_ubuntu_php.gpg':
    ensure  => present,
    owner   => "root",
    group   => "root",
    mode    => "0644",
    source  => 'puppet:///modules/php/ondrej_ubuntu_php.gpg',
    notify  => Exec['php-apt-auto-update'],
  }

  file { '/etc/apt/sources.list.d/php.list':
    ensure  => present,
    owner   => "root",
    group   => "root",
    mode    => "0644",
    content => "deb http://ppa.launchpad.net/ondrej/php/ubuntu ${::lsbdistcodename} main\n",
    require => File['/etc/apt/trusted.gpg.d/ondrej_ubuntu_php.gpg'],
    notify  => Exec['php-apt-auto-update'],
  }

  exec { 'php-apt-auto-update':
    command     => "/usr/bin/apt-get update",
    user        => "root",
    refreshonly => true,
  }
}