class php::ppa inherits php::repository { #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'] { content => "deb http://ppa.launchpad.net/ondrej/php/ubuntu ${::lsbdistcodename} main\n", require => File['/etc/apt/trusted.gpg.d/ondrej_ubuntu_php.gpg'], } }