mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
Making things work...
This commit is contained in:
parent
91110e2534
commit
77fce59b08
11 changed files with 137 additions and 22 deletions
1
Gemfile
1
Gemfile
|
|
@ -14,6 +14,7 @@ group :production do
|
|||
gem 'puppet', puppetversion
|
||||
gem 'r10k', '~> 2.3'
|
||||
gem 'rugged', '~> 0.24'
|
||||
gem 'xmlrpc', '~> 0.3.0'
|
||||
end
|
||||
|
||||
group :development, :unit_tests do
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ GEM
|
|||
wisper (~> 1.6.1)
|
||||
unicode-display_width (1.2.1)
|
||||
wisper (1.6.1)
|
||||
xmlrpc (0.3.0)
|
||||
yamllint (0.0.9)
|
||||
trollop (~> 2)
|
||||
|
||||
|
|
@ -178,6 +179,7 @@ DEPENDENCIES
|
|||
tty-command (~> 0.4)
|
||||
tty-file (~> 0.3)
|
||||
tty-prompt (~> 0.12)
|
||||
xmlrpc (~> 0.3.0)
|
||||
yamllint (~> 0.0.9)
|
||||
|
||||
BUNDLED WITH
|
||||
|
|
|
|||
22
README.md
22
README.md
|
|
@ -31,13 +31,21 @@ My dot files and a tool to deploy them to various OS's
|
|||
```bash
|
||||
git clone git@github.com:genebean/dots.git ~/.dotfiles
|
||||
cd ~/.dotfiles
|
||||
bundle install
|
||||
bundle exec r10k puppetfile install --puppetfile ~/.dotfiles/production/puppet/Puppetfile -v
|
||||
bin/bootstrap.sh
|
||||
This script takes care of getting dots ready to use
|
||||
Enter the number of the task you want to perform:
|
||||
1) Mac setup
|
||||
2) EL setup
|
||||
3) Quit
|
||||
Task:
|
||||
```
|
||||
|
||||
#### Running Puppet
|
||||
|
||||
```bash
|
||||
# Any of these will work:
|
||||
bundle exec rake dots:run_puppet
|
||||
bundle exec rake dots:run_puppet_noop
|
||||
bundle exec puppet apply --environmentpath ~/.dotfiles/puppet ~/.dotfiles/puppet/production/manifests/site.pp
|
||||
```
|
||||
|
||||
|
|
@ -68,9 +76,9 @@ cd ~/repos/powerline-fonts
|
|||
|
||||
##### Thoughts on installing with Puppet:
|
||||
|
||||
* install packages using a provider for homebrew
|
||||
* install packages using the pip provider
|
||||
* use vcsrepo to clone the fonts
|
||||
* create a refresh-only exec that runs the install script
|
||||
* add a notify to the vcsrepo resource that triggers the exec
|
||||
* [x] install packages using a provider for homebrew
|
||||
* [ ] install packages using the pip provider
|
||||
* [ ] use vcsrepo to clone the fonts
|
||||
* [ ] create a refresh-only exec that runs the install script
|
||||
* [ ] add a notify to the vcsrepo resource that triggers the exec
|
||||
* this will also take care of bringing in new fonts or updates
|
||||
|
|
|
|||
13
Rakefile
13
Rakefile
|
|
@ -65,6 +65,11 @@ task :tests do
|
|||
Rake::Task[:spec].invoke
|
||||
end
|
||||
|
||||
desc 'Run dots'
|
||||
task :dots do
|
||||
ruby 'bin/dots.rb'
|
||||
end
|
||||
|
||||
namespace 'dots' do
|
||||
cmd = TTY::Command.new
|
||||
|
||||
|
|
@ -82,4 +87,12 @@ namespace 'dots' do
|
|||
~/.dotfiles/puppet/production/manifests/site.pp'
|
||||
cmd.run(command)
|
||||
end
|
||||
|
||||
desc 'Run Puppet (noop)'
|
||||
task :run_puppet_noop do
|
||||
command = 'bundle exec puppet apply \
|
||||
--environmentpath ~/.dotfiles/puppet \
|
||||
~/.dotfiles/puppet/production/manifests/site.pp --noop'
|
||||
cmd.run(command)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
24
bin/bootstrap.sh
Executable file
24
bin/bootstrap.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
echo 'This script takes care of getting dots ready to use'
|
||||
echo 'Enter the number of the task you want to perform:'
|
||||
|
||||
PS3='Task: '
|
||||
select TASK in 'Mac setup' 'EL setup' 'Quit';
|
||||
do
|
||||
case $TASK in
|
||||
'Mac setup' )
|
||||
~/.dotfile/bin/bootstrap/bootstrap_mac.sh now
|
||||
;;
|
||||
'EL setup' )
|
||||
~/.dotfile/bin/bootstrap/bootstrap_el.sh now
|
||||
;;
|
||||
'Quit' )
|
||||
echo 'Exiting'
|
||||
exit 0
|
||||
;;
|
||||
* )
|
||||
echo 'Invalid selection, quitting.'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
21
bin/bootstrap/bootstrap_mac.sh
Executable file
21
bin/bootstrap/bootstrap_mac.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ $1 == 'now' ]]; then
|
||||
# Install Homebrew
|
||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
|
||||
# Install dot's dependencies
|
||||
/usr/local/bin/brew install ruby cmake pkg-config
|
||||
/usr/local/bin/gem install --no-ri --no-rdoc bundler
|
||||
|
||||
# Make dot usable
|
||||
cd ~/.dotfiles
|
||||
/usr/local/bin/bundle install
|
||||
|
||||
# Install Puppet modules
|
||||
/usr/local/bin/bundle exec rake dots:run_r10k
|
||||
|
||||
# Display tasks that can be run
|
||||
echo 'These are the task that can now be executed:'
|
||||
/usr/local/bin/bundle exec rake -T |grep --color=never 'rake dots'
|
||||
fi
|
||||
|
|
@ -1,9 +1,12 @@
|
|||
# rubocop:disable FileName
|
||||
forge 'http://forge.puppetlabs.com'
|
||||
|
||||
# rubocop:disable Metrics/LineLength
|
||||
# The next line translates to '../../vendor/puppet_modules' aka ~/.dotfiles/vendor/puppet_modules
|
||||
moduledir "#{File.dirname(File.dirname(File.dirname(__FILE__)))}/vendor/puppet_modules"
|
||||
# rubocop:enable Metrics/LineLength
|
||||
|
||||
mod 'homebrew',
|
||||
:git => 'https://github.com/boxen/puppet-homebrew.git'
|
||||
mod 'puppetlabs-vcsrepo', '1.5.0'
|
||||
mod 'thekevjames-homebrew',
|
||||
git: 'https://github.com/genebean/puppet-homebrew.git',
|
||||
branch: 'non-root-and-bundler'
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
modulepath = modules:site:$basemodulepath
|
||||
config_version = 'scripts/config_version.sh $environmentpath $environment'
|
||||
modulepath = modules:site:~/.dotfiles/vendor/puppet_modules:$basemodulepath
|
||||
config_version = 'scripts/config_version.sh $environmentpath'
|
||||
|
|
|
|||
|
|
@ -10,3 +10,7 @@
|
|||
node default {
|
||||
notify{'This is from the default node.':}
|
||||
}
|
||||
|
||||
node 'dawns-macbook-pro.local' {
|
||||
include ::profile::mac
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,5 @@
|
|||
#!/bin/bash
|
||||
if [ -e $1/$2/.r10k-deploy.json ]
|
||||
then
|
||||
/opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/code_manager_config_version.rb $1 $2
|
||||
elif [ -e /opt/puppetlabs/server/pe_version ]
|
||||
then
|
||||
/opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/config_version.rb $1 $2
|
||||
else
|
||||
/usr/bin/git --version > /dev/null 2>&1 &&
|
||||
/usr/bin/git --git-dir $1/$2/.git rev-parse HEAD ||
|
||||
date +%s
|
||||
fi
|
||||
|
||||
/usr/bin/git --version > /dev/null 2>&1 &&
|
||||
/usr/bin/git --git-dir $1/../.git rev-parse HEAD ||
|
||||
date +%s
|
||||
|
|
|
|||
46
puppet/production/site/profile/manifests/mac.pp
Normal file
46
puppet/production/site/profile/manifests/mac.pp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# this contains the mac specific stuff
|
||||
class profile::mac {
|
||||
# $path = '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin'
|
||||
# notify{'This is from the mac profile.':}
|
||||
# exec { 'install homebrew':
|
||||
# command => '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"',
|
||||
# path => $path,
|
||||
# creates => '/usr/local/bin/brew',
|
||||
# }
|
||||
|
||||
#Package { provider => 'homebrew' }
|
||||
$homebrew_packages = [
|
||||
'bash-completion',
|
||||
'bundler-completion',
|
||||
'cmake',
|
||||
'coreutils',
|
||||
'docker-completion',
|
||||
'elixir',
|
||||
'erlang',
|
||||
'figlet',
|
||||
'git',
|
||||
'git-flow',
|
||||
'gnu-tar',
|
||||
'hub',
|
||||
'iftop',
|
||||
'mutt',
|
||||
'packer',
|
||||
'python',
|
||||
'ruby',
|
||||
'sl',
|
||||
'socat',
|
||||
'tmux',
|
||||
'tree',
|
||||
'unrar',
|
||||
'vagrant-completion',
|
||||
'watch',
|
||||
'wget',
|
||||
'zsh',
|
||||
'zsh-completions',
|
||||
]
|
||||
|
||||
package { $homebrew_packages:
|
||||
ensure => installed,
|
||||
provider => 'brew',
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue