How to Make Your Own yum Repo

Jump to: navigation, search

Basic Steps

ssh alpha
cd /share/repos
mkdir custom (or whatever you are calling the repo)
cd custom
scp the rpm file to your new directory
createrepo .
cd /opt/bks/src/cluster/puppet/modules/bks-yum-repos/files/yum.repos.d
cp hpsdr.repo custom.repo
vim custom.repo

change whats in [] and the name and the baseurl save and quit

cd /opt/bks/src/cluster/puppet/modules/bks-yum-repos/
vim Modulefile

increment version, save and quit

puppet module build .
puppet module install -f pkg/****.tar.gz (This is whatever file the output says

To list out all the facts you can use in templates: facter --puppet

To create a puppet module

cd manifests
vim init.pp
cd ../../
puppet module generate bks-arkeia (or whatever you want to name it)
cd bks-arkeia
cd manifests
vim client.pp (you can call it whatever you want .pp)

To test the puppet module:

puppet parser validate filename

To create a module:

puppet module generate bks-bla

To test it, import the puppet class in the Then add the module to a test machine on foreman, then on the test machine type: puppet agent -t

For the exec statements make sure you have ensure => refreshonly