From 43017883c2d5533b083bfc0386f3fc064e80a65d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 16 Jan 2018 17:40:27 -0200 Subject: Handles OpenPGP key for ondrej_ubuntu repo --- files/ondrej_ubuntu_php.gpg | Bin 0 -> 364 bytes manifests/series5/packages/dpa.pp | 2 +- manifests/series5/packages/ppa.pp | 26 +++++++++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 files/ondrej_ubuntu_php.gpg diff --git a/files/ondrej_ubuntu_php.gpg b/files/ondrej_ubuntu_php.gpg new file mode 100644 index 0000000..04c5d9b Binary files /dev/null and b/files/ondrej_ubuntu_php.gpg differ diff --git a/manifests/series5/packages/dpa.pp b/manifests/series5/packages/dpa.pp index bff8bd1..297c4a2 100644 --- a/manifests/series5/packages/dpa.pp +++ b/manifests/series5/packages/dpa.pp @@ -7,7 +7,7 @@ class php::series5::packages::dpa { source => 'puppet:///modules/php/deb.sury.org.gpg', } - file { '/etc/apt/sources.list.d/php.list' : + file { '/etc/apt/sources.list.d/php.list': ensure => present, owner => "root", group => "root", diff --git a/manifests/series5/packages/ppa.pp b/manifests/series5/packages/ppa.pp index 10c5b56..e420822 100644 --- a/manifests/series5/packages/ppa.pp +++ b/manifests/series5/packages/ppa.pp @@ -3,7 +3,7 @@ class php::series5::packages::ppa { # ensure => present, #} - ## TODO: check repository key! + # 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', @@ -11,6 +11,30 @@ class php::series5::packages::ppa { # 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', + } + + 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, + } + # The needed packages: we could also try libapache2-mod-php5.6filter package { 'php5': name => 'php5.6', -- cgit v1.2.3