I've had a little time to look at this. What looks to be happening is that 
the URI class adds a hard leading slash to ftp:// uri path components which 
fetch(1) doesn't handle well.

You can work around this by setting the package resource's 'source' 
parameter to use the http:// scheme. Set it globally using a resource 
default in your site.pp.

if $operatingsystem == 'FreeBSD' {
  $majorversion = regsubst($kernelversion, '^([0-9]+)\.([0-9]+)$', '\1')

  $scheme = 'http'
  $host   = 'ftp2.us.freebsd.org'
  $urlpath = 
"/pub/FreeBSD/ports/${hardwareisa}/packages-${majorversion}-stable/"

  Package { source => "${scheme}://${host}/${urlpath}" }
}

On Tuesday, August 20, 2013 12:15:38 PM UTC-7, joel johnston wrote:
>
> So I think the core issue at this point is that no matter where I try 
> to set PACKAGESITE (on the server via rc, on the client via rc, on the 
> shell via overrides) the path to the ftp server always returns: 
>
> Error: /Stage[main]/Rsync/Package[net/rsync]/ensure: change from 
> absent to present failed: Execution of '/usr/sbin/pkg_add -f 
>
> ftp://ftp.freebsd.org/%2Fpub/FreeBSD/ports/amd64/packages-9-stable/All/rsync-3.0.9_3.tbz'
>  
>
> returned 1: pkg_add: unable to fetch 'ftp://ftp.freebsd.org/ 
>
> The url is bad/wrong. For some reason it is injecting this %2F in 
> front of pub where it SHOULD just be /pub/.... 
>
> How and where is this getting set and how can I change it? 
>
>
> On Mon, Aug 12, 2013 at 5:54 PM, badgerious 
> <badg...@hotmail.com<javascript:>> 
> wrote: 
> > I should disclaim that I'm not a huge FreeBSD guy, but do have a couple 
> of 
> > FreeBSD boxes around. I've been content getting all packages with 
> 'pkg_add 
> > -r' (which seems to work fine with the unpatched freebsd provider); no 
> idea 
> > about the interactions with ports you've mentioned. 
> > 
> > Couple of others things regarding the patch (semi tangential): 
> > 
> > 1) If you do an install of puppet 3.2.3 from ports with ruby 1.9.3, you 
> get 
> > piles of warnings during puppet runs due to some class variable use in 
> the 
> > freebsd provider. This is fixed in vanilla puppet 3.2.3, but undone by 
> the 
> > patch. 
> > 
> > 2) If the freebsd provider is broken, seems like it should be going back 
> > upstream rather than patching in the port (forgive my ignorance if this 
> is 
> > in fact happening and the patch is interim). 
> > 
> > Eric 
> > 
> > 
> > On Monday, August 12, 2013 3:35:41 PM UTC-5, Russell Jackson wrote: 
> >> 
> >> The standard provider doesn't work with packages that have multiple 
> >> origins (the apache ports for instance) because the package name 
> doesn't 
> >> match was is recorded in the package database. So, what will happen is 
> that 
> >> puppet will think the package isn't installed on every run and attempt 
> to 
> >> install it. 
> >> 
> >> The only sane way around that was to use the package origin as a key 
> and 
> >> duplicated the '-r' functionality in the provider; this is what the 
> patch 
> >> does. Passing '-f' to pkg_add was questionable, but I remember there 
> being 
> >> problems without it. 
> >> 
> > -- 
> > You received this message because you are subscribed to a topic in the 
> > Google Groups "Puppet Users" group. 
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/puppet-users/1CqH0u84u6g/unsubscribe. 
> > To unsubscribe from this group and all its topics, send an email to 
> > puppet-users...@googlegroups.com <javascript:>. 
> > To post to this group, send email to 
> > puppet...@googlegroups.com<javascript:>. 
>
> > Visit this group at http://groups.google.com/group/puppet-users. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
>
> -- 
> ___________________ 
> Joel Johnston 
> 760.437.5116 
> www.metaband.net 
> www.j03l.com 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to