Am Freitag, 13. November 2015 02:40:30 UTC+1 schrieb Stefan Lasiewski:
>
> Hello Everyone,
>
> I am running Puppet 3.8 on CentOS 6. I'm trying to install a yum 
> repository from an RPM package, as well as modify the contents of the .repo 
> file after the package is installed.
>
> My example manifest is below. In my `yumrepo {'remi-safe':}` class, I 
> require `require => Package['remi-release'],` so that the Package will be 
> installed before the yumrepo class is called.
>
>
> # Install the REMI repo for some PHP software
> class stefanl::remi (
>   $ensure   = 'latest',
>   $enabled  = true,
>   $priority = '80',
> ) {
>
>   package { 'remi-release':
>     ensure  => $ensure,
>   }
>
>   yumrepo { 'remi-safe':
>     enabled  => $enabled,
>     priority => $priority,
>     require  => Package['remi-release'],
>   }
>
> }
>
>
> Instead, what seems to happen is that:
>
> 1. `yumrepo {'remi-safe':}` is called first, creates a file named 
> `/etc/yum.repos.d/remi-safe.repo`
> 2. Then `package { 'remi-release':}` is called. I guess that since 
> `/etc/yum.repos.d/remi-safe.repo` was already created, remi-release doesn't 
> bother to install /etc/yum.repos.d/remi-safe.repo from the RPM, and I end 
> up with a useless .repo file.
>
>
> [root@webhost yum.repos.d]# cat remi-safe.repo
> [remi-safe]
> enabled=true
> priority=80
> [root@webhost yum.repos.d]#
>
>
>
> I'm a little confused why this is happening. Can I use `yumrepo` to modify 
> a file installed by `package`?
>

I suspect the yumrepo type removes lines not provided in the puppet 
manifest. So the rpm remi-release  package adds the *.repo file and yumrepo 
deletes lines? You might add the other settings to the yumrepo type too.

Why would you wan't to manage the yumrepo file with puppet if its already 
installed by the remo-release rpm? If the "remi-release" package does not 
add other things beside the repo file you could just not install the 
package and use the yumrepo type "standalone".

- Thomas




 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e70a5b98-558f-438c-90df-51ba981bcc5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to