enablerepo option

451 views
Skip to first unread message

puppetstan

unread,
Sep 13, 2013, 11:23:32 AM9/13/13
to puppet...@googlegroups.com
Hi

I would like to use enablerepo option for activate repo and verify package latest version

my manifest :

package { "fusioninventory-agent": ensure => latest, enablerepo => [ "epel", "remi" ]; }

there this patch : http://projects.puppetlabs.com/issues/2247 but it does not work in my configuration

Can you have the same problem or an other solution to activate multiple rpm repo with enablerepo command?
regards

puppetstan

unread,
Sep 19, 2013, 10:23:46 AM9/19/13
to puppet...@googlegroups.com
or if you have an other idea to use enablerepo i m interesting

regards

Sneha More

unread,
Sep 20, 2013, 6:39:28 AM9/20/13
to puppet...@googlegroups.com
Hi,
  

package { “xyz”:

      ensure => latest,

      enablerepo => “epel”,  }

This internally executes,

yum -y --enablerepo=epel install xyz.

So can use "Exec" just for enabling repo and then you can use package resource to install package.

I hope this should work.

Thanks and Regards,
Sneha More,
NTTD GTS, OSS centre, India (Pune)

puppetstan

unread,
Sep 21, 2013, 12:49:35 PM9/21/13
to puppet...@googlegroups.com
hi

thanks for your answer

but for use enablerepo option your oblige to pass the patch?



Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :

puppetstan

unread,
Sep 21, 2013, 12:55:58 PM9/21/13
to puppet...@googlegroups.com
i think Exec is a good alternative


Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :

puppetstan

unread,
Sep 21, 2013, 1:18:42 PM9/21/13
to puppet...@googlegroups.com
A question, if in my Exec "toto" i use command = yum -y --enablerepo=epel install fusioninventory-agent

and in my definition package there is :

ensure => latest,
require => Exec['toto'],

If i want upgrade package is not possible because the upgrade option in yum does not work

and if in my Exec "toto" i use command = yum -y --enablerepo=epel upgrade fusioninventory-agent

If i want to install package is not possible because the install option in yum does not work




Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :

Sneha More

unread,
Sep 23, 2013, 2:27:46 AM9/23/13
to puppet...@googlegroups.com
Hi,
   Is there any problem with your yum command?
I could not understand, why yum install is not working?
Have you tried executing the same command manually?

puppetstan

unread,
Sep 23, 2013, 6:16:07 AM9/23/13
to puppet...@googlegroups.com
Hi

This configuration is not good if fusioninventory-agent is installed and puppet want to verify the latest version because yum command option is "install" and not "update" . This configuration is only good if fusioninventory-agent is not installed.

exec { 'fusioninventory-agent':
 command => 'yum -y install fusioninventory-agent --enablerepo=*',
 path => '/usr/bin',

}

package { 'fusioninventory-agent':
                 ensure => latest,
                require => Exec['fusioninventory-agent'],
        }



This configuration is not good if fusioninventory-agent is not installed and puppet want to verify fusioninventory-agent is present  because yum command option is "update" and not "install" . This configuration is only good  if fusioninventory-agent is installed.

exec { 'fusioninventory-agent':
 command => 'yum -y update fusioninventory-agent --enablerepo=*',
 path => '/usr/bin',

}

package { 'fusioninventory-agent':
                 ensure => latest,
                require => Exec['fusioninventory-agent'],
        }

What is the solution, an idea?

Regards





Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :

Sneha More

unread,
Sep 24, 2013, 2:01:31 AM9/24/13
to puppet...@googlegroups.com
Hi,
 I understood the problem,
You may try following things.
Just try running the commnad -> yum -y install fusioninventory-agent --enablerepo=epel
And check whether its installing latest version or not.
1. If it is installing latest version then just use this in manifest:

exec { 'fusioninventory-agent':
 command => 'yum -y update fusioninventory-agent --enablerepo=*',
 path => '/usr/bin',
}
Dont use Package resource again.
Because it also does the same as yum command.

2. If it is not installing latest version and if you know the latest version then specify that in your command, like
yum -y install fusioninventory-agent-1.2.0 --enablerepo=epel (here i have assumed 1.2.0 as latest version )
And use just
exec { 'fusioninventory-agent':
 command => 'yum -y update fusioninventory-agent-1.2.0 --enablerepo=epel',
 path => '/usr/bin',
}
Do not use Package resource again.

I hope this will help you.

Thanks & Regards
Sneha More


--
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/5ejsIE5EFww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

puppetstan

unread,
Sep 24, 2013, 11:43:30 AM9/24/13
to puppet...@googlegroups.com
Thanks a lot for your answer but i don't know configure it with no package...actually my configuration is this :


class fusioninventory-agent::redhat {

package { "fusioninventory-agent": ensure => latest}

#exec { 'fusioninventory-agent':
#  command => 'yum -y install fusioninventory-agent --enablerepo=*',
#  path => '/usr/bin',
#}

#package { 'fusioninventory-agent':
#                 ensure => latest,
#                require => Exec['fusioninventory-agent'],
#        }


file { '/etc/sysconfig/fusioninventory-agent':
                        ensure => present,
                        owner => 'root',
                        group => 'root',
                        mode => 0644,
                        content => template("/etc/puppet/modules/fusioninventory-agent/templates/fusioninventory-agent.erb"),
                        require => Package["fusioninventory-agent"],
                        notify => Service["fusioninventory-agent"]
        }


service { 'fusioninventory-agent':
                        ensure => running,
                        hasstatus => false,
                        hasrestart => false,
                        enable => true,
                        require => File['/etc/sysconfig/fusioninventory-agent']

        }
}


Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :

Sneha More

unread,
Sep 24, 2013, 1:43:08 PM9/24/13
to puppet...@googlegroups.com
Hi ,
  you can try this,

class fusioninventory-agent::redhat {

# if you know the latest version of fusioninventory-agent, directly specify the version in the Exec command

exec { 'fusioninventory-agent':
  command => 'yum -y install fusioninventory-agent-2.3.2 --enablerepo=epel',
  path => '/usr/bin',
}

file { '/etc/sysconfig/fusioninventory-agent' :
                        ensure => present,
                        owner => 'root',
                        group => 'root',
                        mode => 0644,
                        content => template("/etc/puppet/modules/
fusioninventory-agent/templates/fusioninventory-
agent.erb"),
                        require => Exec["fusioninventory-
agent"],
                        notify => Service["fusioninventory-
agent"]

        }


service { 'fusioninventory-agent':
                        ensure => running,
                        hasstatus => false,
                        hasrestart => false,
                        enable => true,
                        require => File['/etc/sysconfig/
fusioninventory-agent']

        }
}
 Regards,
Sneha.

puppetstan

unread,
Sep 25, 2013, 3:36:01 AM9/25/13
to puppet...@googlegroups.com
Hi Sneha

Thanks a lot for your configuration but this solution is only good if i know latest version, but if i know, i'm oblige to modify all the time the configuration when there a new version but if i don't know latest version this solution is not possible...

An other idea is modifiy repo and change enabled=0 by enabled=1 and after install or update modify enabled=0 by enabled=1 ? Your opinion?
Regards and thanks


 [dag]
 gpgcheck=0
 enabled=1
 name=$releasever-$basearch on dag
 baseurl=http://serveurdags/RPMS.dag/

 


Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :

Sneha More

unread,
Sep 25, 2013, 5:28:27 AM9/25/13
to puppet...@googlegroups.com
Hi,
    exec { 'fusioninventory-agent':
     command => 'yum -y install fusioninventory-agent --enablerepo=epel',
     path => '/usr/bin',
   }


An other idea is modifiy repo and change enabled=0 by enabled=1 and after install or update modify enabled=0 by enabled=1 ? Your opinion?
Regards and thanks


 [dag]
 gpgcheck=0
 enabled=1
 name=$releasever-$basearch on dag
 baseurl=http://serveurdags/RPMS.dag/

This will solve your issue. but as you have baseurl , why don't you try source => http://serveurdags/RPMS.dag/ in package resource.
like :
package { "fusioninventory-agent":
     ensure => 'latest',
     source => 'http://serveurdags/RPMS.dag/',}
Please have look in to more attributes of Package resource.


Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :
Hi

I would like to use enablerepo option for activate repo and verify package latest version

my manifest :

package { "fusioninventory-agent": ensure => latest, enablerepo => [ "epel", "remi" ]; }

there this patch : http://projects.puppetlabs.com/issues/2247 but it does not work in my configuration

Can you have the same problem or an other solution to activate multiple rpm repo with enablerepo command?
regards
--
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/5ejsIE5EFww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To post to this group, send email to puppet...@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 all
Reply to author
Forward
0 new messages