Ask Your Question
1

How do i use yumrepo in Puppet like yum-config-manager?

asked 2018-01-18 11:30:55 -0500

vrmerlin gravatar image

I'm trying to have Puppet install Docker. Per the Docker documentation, the list of yum repositories are added by this command:

yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

I'd like to have Puppet do this for me, so I was hoping this would work:

yumrepo { "docker":
    descr => 'docker',
    baseurl => 'https://download.docker.com/linux/centos/docker-ce.repo',
    enabled => 1
}

But, this doesn't work.

Unfortunately, the URL used in the yum-config-manager contains an entire list of name/baseurl/enabled/gpgcheck/gpgkey entries, where the yumrepo is for a single entry. So, is there a way to add the entire list of entries provided by the docker URL with one yumrepo command, or some other command?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-10-01 15:34:00 -0500

rcarmstrong gravatar image

Ran into the same issue. I was able to resolve my issue by configuring it as follows:

yumrepo { 'docker':
  ensure => 'present',
  descr => 'Docker Community Edition repository for CentOS',
  baseurl => 'https://download.docker.com/linux/centos/7/x86_64/stable',
  enabled => 'true'
}

Hope this helps!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-01-18 11:30:55 -0500

Seen: 130 times

Last updated: Jan 18