How to turn on Centos 8 repo

57 views
Skip to first unread message

Keyzer Suze

unread,
Mar 24, 2020, 7:51:01 PM3/24/20
to Puppet Users
Hi

I want to turn on the high availability repo.

How to I do that, with re creating the repo file ?

A

warron.french

unread,
Mar 26, 2020, 8:30:47 AM3/26/20
to puppet...@googlegroups.com
Did you get an answer Keyzer?

Do you still have the file /etc/yum.repos.d/Centos-Base.repo, or do you need to recreate the entire repo from scratch?  How I respond depends on your answer.

--------------------------
Warron French



--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/59832e87-1dda-45fc-a226-2e6a2f75d667%40googlegroups.com.

Keyzer Suze

unread,
Mar 27, 2020, 1:10:28 AM3/27/20
to puppet...@googlegroups.com
Hi

Looking at configure brand new installs

basically i have Centos 8 template (VMWare) and I create new machines, login assign name to it and run puppet agent.

I wanted to use high availability packages and i need to turn on the repo.

Not sure the best way of doing it, I don't want to recreate the file, just want to turn on enabled 


thanks



Andy Hall

unread,
Mar 27, 2020, 11:11:48 AM3/27/20
to Puppet Users
Puppet needs to own the file to use the yumrepo resource type so if you ensure all aspects match then effectively using the enabled parameter should just change that file. But if anything doesn't match then yes it will create a new file. But is shouldn't be too difficult to work it out from the docs after a few puppet runs to get it right : https://puppet.com/docs/puppet/5.5/types/yumrepo.html

If that just doesn't work then look at file_line from stdlib if you have to.


On Friday, March 27, 2020 at 5:10:28 AM UTC, Keyzer Suze wrote:
Hi

Looking at configure brand new installs

basically i have Centos 8 template (VMWare) and I create new machines, login assign name to it and run puppet agent.

I wanted to use high availability packages and i need to turn on the repo.

Not sure the best way of doing it, I don't want to recreate the file, just want to turn on enabled 


thanks



On Thu, Mar 26, 2020 at 11:30 PM warron.french <warron...@gmail.com> wrote:
Did you get an answer Keyzer?

Do you still have the file /etc/yum.repos.d/Centos-Base.repo, or do you need to recreate the entire repo from scratch?  How I respond depends on your answer.

--------------------------
Warron French



On Tue, Mar 24, 2020 at 7:51 PM Keyzer Suze <keyze...@gmail.com> wrote:
Hi

I want to turn on the high availability repo.

How to I do that, with re creating the repo file ?

A

--
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...@googlegroups.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...@googlegroups.com.

warron.french

unread,
Mar 27, 2020, 12:30:56 PM3/27/20
to puppet...@googlegroups.com
Keyser, do you mean what syntax to generate a repo file for the CentOS high availability packages?

I am trying to understand your requirement clearly.
--------------------------
Warron French



Keyzer Suze

unread,
Mar 28, 2020, 10:04:50 PM3/28/20
to puppet...@googlegroups.com
Hi

Okay sorry for the confusion.

So brand new centos 8 install

all the repo files are in the /etc/yum.repo.d directory

I want to turn on the high availability repo 

I would rather not replace the whole files - yes I can see its contents, but I don't want to maintain the file in puppet I want to maintain the state of the repo

on a very basic level I want to change the enabled option in the file to 1 / true







Andy Hall

unread,
Mar 29, 2020, 5:33:57 AM3/29/20
to Puppet Users
As stated above if you match the existing file with a yumrepo resource then yes it will effectively change just the file but puppet will now own that so it has to match or else it will create a new file.

So if the existing file looks like this...

[BaseOS]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

And you now want to just enable it then something like this may work...

yumrepo { 'BaseOS':
  desc => 'CentOS-$releasever - Base
  mirrorlist => 'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra'
  gpgcheck => 0
  enabled => 1
  gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial'
}

And if you can't get it to work and you absolutely cannot have two similar files with one disabled and one enabled then look a something like fileline in the stdlib to edit a line in a file - but the yumrepo resource type is the way to go.

Tip: you need to get a test host so you can just start playing with this stuff and seeing how it works. Also please read the resource type docs as they are great : https://puppet.com/docs/puppet/5.5/types/yumrepo.html
To unsubscribe from this group and stop receiving emails from it, send an email to puppet...@googlegroups.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...@googlegroups.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...@googlegroups.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...@googlegroups.com.

Vadym Chepkov

unread,
Mar 29, 2020, 7:32:00 AM3/29/20
to Puppet Users
As was advised, it's better manage the whole repository, using puppet/yum module for example.

You can manage some of the feature of the repo, this way:

yumrepo { 'HighAvailability':
  descr => 'name=CentOS-$releasever - HA',
  enabled => '1',
  target => '/etc/yum.repos.d/CentOS-HA.repo',
}

Keyzer Suze

unread,
Apr 5, 2020, 3:15:26 AM4/5/20
to puppet...@googlegroups.com
Hi

Thanks yeah I knew i could do this. seems a bit over the top - what if a patch changes this .. any way I went with the file editing option instead

Ta

To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/88fc904d-9088-462c-acd8-ce6fb18ee25c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages