From 4670009f3c26606db723f20c518b0acc1986e20a Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Wed, 29 Apr 2015 20:16:49 +0300 Subject: [PATCH] Fix exec resource ensurability for auxiliary repos Dependence on part of the files created by the exec statements in nailgun::auxiliaryrepos was inadequate to work with patching tests. Now replaced with unless statements to ensure all files and directories. Release file is now set to replace => false. Change-Id: I3fe15130d3c70ab4441b7fe9e3b108f617738cc8 Closes-Bug: #1450124 --- deployment/puppet/nailgun/manifests/auxiliaryrepos.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp b/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp index 97e75b8d77..8b97b47671 100644 --- a/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp +++ b/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp @@ -48,17 +48,21 @@ class nailgun::auxiliaryrepos( exec { 'create_ubuntu_repo_dirs': path => '/bin:/sbin:/usr/bin:/usr/sbin', command => "bash -c \"mkdir -p ${ubuntu_dir}/pool/{main,restricted} ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-amd64/\"", - creates => "${ubuntu_dir}/pool", + unless => "test -d ${ubuntu_dir}/pool && \ + test -d ${ubuntu_dir}/dists/auxiliary/main/binary-amd64 && \ + test -d ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64", } exec { 'create_ubuntu_repo_Packages': path => '/bin:/sbin:/usr/bin:/usr/sbin', command => "bash -c \"touch ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-amd64/Packages\"", - creates => "${ubuntu_dir}/dists/auxiliary/main/binary-amd64/Packages", + unless => "test -f ${ubuntu_dir}/dists/auxiliary/main/binary-amd64/Packages && \ + test -f ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64/Packages", } file { $release_files: ensure => file, + replace => false, source => 'puppet:///modules/nailgun/Release-auxiliary', mode => '0644', owner => 'root',