mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 17:37:43 -04:00
Code to make CentOS work
This commit is contained in:
parent
4b75708af5
commit
904f5cdd55
3 changed files with 220 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
class profile::linux {
|
class profile::linux {
|
||||||
case $facts['os']['family'] {
|
case $facts['os']['family'] {
|
||||||
'Debian': { include ::profile::linux::debian }
|
'Debian': { include ::profile::linux::debian }
|
||||||
|
'RedHat': { include ::profile::linux::el }
|
||||||
default: { fail("${facts['os']['family']} isn't supported yet") }
|
default: { fail("${facts['os']['family']} isn't supported yet") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
118
puppet/production/site/profile/manifests/linux/el.pp
Normal file
118
puppet/production/site/profile/manifests/linux/el.pp
Normal file
|
|
@ -0,0 +1,118 @@
|
||||||
|
# Profile for the Red Hat family of OS's
|
||||||
|
class profile::linux::el {
|
||||||
|
$homedir = lookup('homedir')
|
||||||
|
$uid = find_owner($homedir)
|
||||||
|
$gid = find_group($homedir)
|
||||||
|
$user = homedir_to_user($homedir)
|
||||||
|
|
||||||
|
include ::profile::linux::el::docker_repos
|
||||||
|
Yumrepo <| |> -> Package <| |> # lint:ignore:spaceship_operator_without_tag
|
||||||
|
|
||||||
|
$yum_packages = [
|
||||||
|
'cmake',
|
||||||
|
'device-mapper-persistent-data',
|
||||||
|
'docker-ce',
|
||||||
|
'figlet',
|
||||||
|
'git',
|
||||||
|
'gitflow',
|
||||||
|
'lvm2',
|
||||||
|
'python2-pip',
|
||||||
|
'python2-psutil',
|
||||||
|
'tmux',
|
||||||
|
'tree',
|
||||||
|
'yum-utils',
|
||||||
|
'zsh',
|
||||||
|
]
|
||||||
|
|
||||||
|
$python_pacakges = [
|
||||||
|
'powerline-status',
|
||||||
|
]
|
||||||
|
|
||||||
|
package {
|
||||||
|
default:
|
||||||
|
ensure => 'installed',
|
||||||
|
;
|
||||||
|
'epel-release':
|
||||||
|
notify => Exec['yum clean all'],
|
||||||
|
;
|
||||||
|
$yum_packages:
|
||||||
|
require => Package['epel-release'],
|
||||||
|
;
|
||||||
|
$python_pacakges:
|
||||||
|
ensure => 'latest',
|
||||||
|
provider => 'pip',
|
||||||
|
require => Package['python2-pip'],
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dirs = [
|
||||||
|
"${homedir}/.local",
|
||||||
|
"${homedir}/.local/share",
|
||||||
|
"${homedir}/.local/share/fonts",
|
||||||
|
"${homedir}/.vim",
|
||||||
|
"${homedir}/.vim/bundle",
|
||||||
|
"${homedir}/repos",
|
||||||
|
]
|
||||||
|
|
||||||
|
file { $dirs:
|
||||||
|
ensure => 'directory',
|
||||||
|
owner => $uid,
|
||||||
|
group => $gid,
|
||||||
|
}
|
||||||
|
|
||||||
|
vcsrepo {
|
||||||
|
default:
|
||||||
|
ensure => 'latest',
|
||||||
|
user => $user,
|
||||||
|
owner => $uid,
|
||||||
|
group => $gid,
|
||||||
|
provider => 'git',
|
||||||
|
;
|
||||||
|
"${homedir}/.oh-my-zsh":
|
||||||
|
ensure => 'present',
|
||||||
|
source => 'https://github.com/robbyrussell/oh-my-zsh.git',
|
||||||
|
;
|
||||||
|
"${homedir}/.oh-my-zsh/custom/themes":
|
||||||
|
source => 'git@github.com:genebean/my-oh-zsh-themes.git',
|
||||||
|
;
|
||||||
|
"${homedir}/.vim/bundle/Vundle.vim":
|
||||||
|
source => 'https://github.com/VundleVim/Vundle.vim.git',
|
||||||
|
require => File[$dirs],
|
||||||
|
;
|
||||||
|
"${homedir}/repos/powerline-fonts":
|
||||||
|
source => 'https://github.com/powerline/fonts.git',
|
||||||
|
require => File[$dirs],
|
||||||
|
notify => Exec['update-fonts'],
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
exec {
|
||||||
|
default:
|
||||||
|
logoutput => true,
|
||||||
|
environment => "HOME=${homedir}",
|
||||||
|
refreshonly => true,
|
||||||
|
;
|
||||||
|
'yum clean all':
|
||||||
|
command => '/bin/yum clean all',
|
||||||
|
;
|
||||||
|
'set-shell-to-zsh':
|
||||||
|
path => '/bin:/usr/bin',
|
||||||
|
command => "chsh -s /usr/bin/zsh `grep '${uid}:${gid}' /etc/passwd |cut -d ':' -f1`",
|
||||||
|
cwd => $homedir,
|
||||||
|
unless => "grep '${uid}:${gid}' /etc/passwd | grep '/usr/bin/zsh'",
|
||||||
|
require => Package['zsh'],
|
||||||
|
;
|
||||||
|
'update-fonts':
|
||||||
|
command => "${homedir}/repos/powerline-fonts/install.sh",
|
||||||
|
cwd => "${homedir}/repos/powerline-fonts",
|
||||||
|
notify => Exec['set-font-ownership'],
|
||||||
|
;
|
||||||
|
'set-font-ownership':
|
||||||
|
path => '/bin:/usr/bin',
|
||||||
|
command => "chown -R ${uid}:${gid} ${homedir}/.local/share/fonts/*",
|
||||||
|
cwd => $homedir,
|
||||||
|
require => Exec['update-fonts'],
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
# These repos are the ones setup by
|
||||||
|
# https://download.docker.com/linux/centos/docker-ce.repo
|
||||||
|
class profile::linux::el::docker_repos {
|
||||||
|
yumrepo { 'docker-ce-edge':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/edge',
|
||||||
|
descr => 'Docker CE Edge - $basearch',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-edge-debuginfo':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/edge',
|
||||||
|
descr => 'Docker CE Edge - Debuginfo $basearch',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-edge-source':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/source/edge',
|
||||||
|
descr => 'Docker CE Edge - Sources',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-nightly':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/nightly',
|
||||||
|
descr => 'Docker CE Nightly - $basearch',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-nightly-debuginfo':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/nightly',
|
||||||
|
descr => 'Docker CE Nightly - Debuginfo $basearch',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-nightly-source':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/source/nightly',
|
||||||
|
descr => 'Docker CE Nightly - Sources',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-stable':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/stable',
|
||||||
|
descr => 'Docker CE Stable - $basearch',
|
||||||
|
enabled => '1',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-stable-debuginfo':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/stable',
|
||||||
|
descr => 'Docker CE Stable - Debuginfo $basearch',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-stable-source':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/source/stable',
|
||||||
|
descr => 'Docker CE Stable - Sources',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-test':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/test',
|
||||||
|
descr => 'Docker CE Test - $basearch',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-test-debuginfo':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/test',
|
||||||
|
descr => 'Docker CE Test - Debuginfo $basearch',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
yumrepo { 'docker-ce-test-source':
|
||||||
|
ensure => 'present',
|
||||||
|
baseurl => 'https://download.docker.com/linux/centos/7/source/test',
|
||||||
|
descr => 'Docker CE Test - Sources',
|
||||||
|
enabled => '0',
|
||||||
|
gpgcheck => '1',
|
||||||
|
gpgkey => 'https://download.docker.com/linux/centos/gpg',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue