update to latest puphpet version
authorCornelius Weiß <mail@corneliusweiss.de>
Mon, 13 Jan 2014 14:08:29 +0000 (15:08 +0100)
committerCornelius Weiß <c.weiss@metaways.de>
Wed, 15 Jan 2014 07:25:51 +0000 (08:25 +0100)
Change-Id: I689412dac2ecddbb31ef443a28ca5d239ca88c9f
Reviewed-on: https://gerrit.tine20.org/tine20/2720
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Reviewed-by: Cornelius Weiß <c.weiss@metaways.de>
Tested-by: Cornelius Weiß <c.weiss@metaways.de>
15 files changed:
scripts/vagrant/Vagrantfile
scripts/vagrant/puphpet/config.yaml [moved from scripts/vagrant/puppet/hieradata/common.yaml with 70% similarity]
scripts/vagrant/puphpet/files/dot/.bash_aliases [new file with mode: 0644]
scripts/vagrant/puphpet/files/dot/.vimrc [new file with mode: 0644]
scripts/vagrant/puphpet/puppet/Puppetfile [new file with mode: 0644]
scripts/vagrant/puphpet/puppet/hiera.yaml [moved from scripts/vagrant/hiera.yaml with 50% similarity]
scripts/vagrant/puphpet/puppet/manifests/default.pp [moved from scripts/vagrant/puppet/manifests/default.pp with 64% similarity]
scripts/vagrant/puphpet/shell/execute-files.sh [new file with mode: 0644]
scripts/vagrant/puphpet/shell/initial-setup.sh [moved from scripts/vagrant/shell/initial-setup.sh with 64% similarity]
scripts/vagrant/puphpet/shell/librarian-puppet-vagrant.sh [moved from scripts/vagrant/shell/librarian-puppet-vagrant.sh with 64% similarity]
scripts/vagrant/puphpet/shell/os-detect.sh [moved from scripts/vagrant/shell/os-detect.sh with 85% similarity]
scripts/vagrant/puphpet/shell/self-promotion.txt [moved from scripts/vagrant/shell/self-promotion.txt with 100% similarity]
scripts/vagrant/puphpet/shell/update-puppet.sh [moved from scripts/vagrant/shell/update-puppet.sh with 78% similarity]
scripts/vagrant/puphpet/tine20.yaml [moved from scripts/vagrant/puppet/hieradata/tine20.yaml with 100% similarity]
scripts/vagrant/puppet/Puppetfile [deleted file]

index 2574c30..4251a90 100644 (file)
@@ -1,32 +1,36 @@
 Vagrant.configure("2") do |config|
   config.vm.box = "debian-wheezy72-x64-vbox43"
-  config.vm.box_url = "https://puphpet.s3.amazonaws.com/debian-wheezy72-x64-vbox43.box"
+  config.vm.box_url = "http://box.puphpet.com/debian-wheezy72-x64-vbox43.box"
 
   config.vm.network "private_network", ip: "192.168.56.101"
 
 
-  config.vm.synced_folder "../../tine20", "/var/www", id: "vagrant-root", :nfs => false
+  config.vm.synced_folder "./", "/var/www", id: "vagrant-root", :nfs => false
 
   config.vm.usable_port_range = (2200..2250)
   config.vm.provider :virtualbox do |virtualbox|
-    virtualbox.customize ["modifyvm", :id, "--name", "my-vm-box"]
     virtualbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
     virtualbox.customize ["modifyvm", :id, "--memory", "512"]
     virtualbox.customize ["setextradata", :id, "--VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
   end
 
-  config.vm.provision :shell, :path => "shell/initial-setup.sh"
-  config.vm.provision :shell, :path => "shell/update-puppet.sh"
-  config.vm.provision :shell, :path => "shell/librarian-puppet-vagrant.sh"
+  config.vm.provision :shell, :path => "puphpet/shell/initial-setup.sh"
+  config.vm.provision :shell, :path => "puphpet/shell/update-puppet.sh"
+  config.vm.provision :shell, :path => "puphpet/shell/librarian-puppet-vagrant.sh"
   config.vm.provision :puppet do |puppet|
     puppet.facter = {
       "ssh_username" => "vagrant"
     }
 
-    puppet.manifests_path = "puppet/manifests"
-    puppet.options = ["--verbose", "--hiera_config /vagrant/hiera.yaml", "--parser future"]
+    puppet.manifests_path = "puphpet/puppet/manifests"
+    puppet.options = ["--verbose", "--hiera_config /vagrant/puphpet/puppet/hiera.yaml", "--parser future"]
   end
 
+  config.vm.provision :shell, :path => "puphpet/shell/execute-files.sh"
+
+
+
+
   config.ssh.username = "vagrant"
 
   config.ssh.shell = "bash -l"
similarity index 70%
rename from scripts/vagrant/puppet/hieradata/common.yaml
rename to scripts/vagrant/puphpet/config.yaml
index 48bc8cd..094b96c 100644 (file)
@@ -2,31 +2,27 @@
 vagrantfile-local:
     vm:
         box: debian-wheezy72-x64-vbox43
-        box_url: 'https://puphpet.s3.amazonaws.com/debian-wheezy72-x64-vbox43.box'
+        box_url: 'http://box.puphpet.com/debian-wheezy72-x64-vbox43.box'
         hostname: null
         network:
             private_network: 192.168.56.101
-            forwarded_port:
-                hS7jk0Np9Ab5:
-                    host: ''
-                    guest: ''
+            forwarded_port: {  }
         provider:
             virtualbox:
                 modifyvm:
-                    name: my-vm-box
                     natdnshostresolver1: on
                     memory: '512'
                 setextradata:
                     VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root: 1
         provision:
             puppet:
-                manifests_path: puppet/manifests
+                manifests_path: puphpet/puppet/manifests
                 options:
-                    - --verbose
-                    - '--hiera_config /vagrant/hiera.yaml'
+                    - '--verbose'
+                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
                     - '--parser future'
         synced_folder:
-            LxME30gm6SNU:
+            LZhss9UMsFXn:
                 id: vagrant-root
                 source: ./
                 target: /var/www
@@ -55,11 +51,11 @@ apache:
         - php
         - rewrite
     vhosts:
-        Xan8mqMbuDOQ:
-            servername: awesome.dev
+        dYDR07tVlxGd:
+            servername: example.com
             serveraliases:
-                - www.awesome.dev
-            docroot: /var/www/awesome
+                - tine.exaple.com
+            docroot: /var/www
             port: '80'
             setenv:
                 - 'APP_ENV dev'
@@ -69,6 +65,8 @@ apache:
     group: www-data
     default_vhost: true
     mpm_module: prefork
+    mod_pagespeed: 0
+    mod_spdy: 0
 php:
     version: '55'
     composer: '1'
@@ -77,8 +75,8 @@ php:
             - cli
             - intl
             - mcrypt
-            - ldap
             - xsl
+            - ldap
         pear: {  }
         pecl:
             - pecl_http
@@ -86,7 +84,7 @@ php:
         display_errors: On
         error_reporting: '-1'
         session.save_path: /var/lib/php/session
-    timezone: Europe/Berlin
+    timezone: America/Chicago
 xdebug:
     install: '1'
     settings:
@@ -98,9 +96,22 @@ xdebug:
         xdebug.remote_port: '9000'
 xhprof:
     install: '1'
-    location: /var/www/xhprof
+drush:
+    install: 0
+    settings:
+        drush.tag_branch: 6.x
 mysql:
-    root_password: '123'
+    root_password: '1234'
     phpmyadmin: '1'
-
+    adminer: 0
+    databases: {  }
+beanstalkd:
+    install: 0
+    listenaddress: 0.0.0.0
+    listenport: '13000'
+    maxjobsize: '65535'
+    maxconnections: '1024'
+    binlogdir: /var/lib/beanstalkd/binlog
+    binlogfsync: null
+    binlogsize: '10485760'
 
diff --git a/scripts/vagrant/puphpet/files/dot/.bash_aliases b/scripts/vagrant/puphpet/files/dot/.bash_aliases
new file mode 100644 (file)
index 0000000..b1ab498
--- /dev/null
@@ -0,0 +1,52 @@
+if [ -f /etc/bash_completion ]; then
+    source /etc/bash_completion
+fi
+
+__has_parent_dir () {
+    # Utility function so we can test for things like .git/.hg without firing up a
+    # separate process
+    test -d "$1" && return 0;
+
+    current="."
+    while [ ! "$current" -ef "$current/.." ]; do
+        if [ -d "$current/$1" ]; then
+            return 0;
+        fi
+        current="$current/..";
+    done
+
+    return 1;
+}
+
+__vcs_name() {
+    if [ -d .svn ]; then
+        echo "-[svn]";
+    elif __has_parent_dir ".git"; then
+        echo "-[$(__git_ps1 'git %s')]";
+    elif __has_parent_dir ".hg"; then
+        echo "-[hg $(hg branch)]"
+    fi
+}
+
+black=$(tput -Txterm setaf 0)
+red=$(tput -Txterm setaf 1)
+green=$(tput -Txterm setaf 2)
+yellow=$(tput -Txterm setaf 3)
+dk_blue=$(tput -Txterm setaf 4)
+pink=$(tput -Txterm setaf 5)
+lt_blue=$(tput -Txterm setaf 6)
+
+bold=$(tput -Txterm bold)
+reset=$(tput -Txterm sgr0)
+
+# Nicely formatted terminal prompt
+export PS1='\n\[$bold\]\[$black\][\[$dk_blue\]\@\[$black\]]-[\[$green\]\u\[$yellow\]@\[$green\]\h\[$black\]]-[\[$pink\]\w\[$black\]]\[\033[0;33m\]$(__vcs_name) \[\033[00m\]\[$reset\]\n\[$reset\]\$ '
+
+alias ls='ls -F --color=always'
+alias dir='dir -F --color=always'
+alias ll='ls -l'
+alias cp='cp -iv'
+alias rm='rm -i'
+alias mv='mv -iv'
+alias grep='grep --color=auto -in'
+alias ..='cd ..'
diff --git a/scripts/vagrant/puphpet/files/dot/.vimrc b/scripts/vagrant/puphpet/files/dot/.vimrc
new file mode 100644 (file)
index 0000000..2ff1aa6
--- /dev/null
@@ -0,0 +1,414 @@
+set rtp+=$GOROOT/misc/vim
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Maintainer:
+"       Amir Salihefendic
+"       http://amix.dk - amix@amix.dk
+"
+" Version:
+"       5.0 - 29/05/12 15:43:36
+"
+" Blog_post:
+"       http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
+"
+" Awesome_version:
+"       Get this config, nice color schemes and lots of plugins!
+"
+"       Install the awesome version from:
+"
+"           https://github.com/amix/vimrc
+"
+" Syntax_highlighted:
+"       http://amix.dk/vim/vimrc.html
+"
+" Raw_version:
+"       http://amix.dk/vim/vimrc.txt
+"
+" Sections:
+"    -> General
+"    -> VIM user interface
+"    -> Colors and Fonts
+"    -> Files and backups
+"    -> Text, tab and indent related
+"    -> Visual mode related
+"    -> Moving around, tabs and buffers
+"    -> Status line
+"    -> Editing mappings
+"    -> vimgrep searching and cope displaying
+"    -> Spell checking
+"    -> Misc
+"    -> Helper functions
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => General
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Sets how many lines of history VIM has to remember
+set history=700
+
+" Enable filetype plugins
+filetype plugin on
+filetype indent on
+
+" Set to auto read when a file is changed from the outside
+set autoread
+
+" With a map leader it's possible to do extra key combinations
+" like <leader>w saves the current file
+let mapleader = ","
+let g:mapleader = ","
+
+" Fast saving
+nmap <leader>w :w!<cr>
+
+" :W sudo saves the file
+" (useful for handling the permission-denied error)
+command W w !sudo tee % > /dev/null
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => VIM user interface
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Set 7 lines to the cursor - when moving vertically using j/k
+set so=7
+
+" Turn on the WiLd menu
+set wildmenu
+
+" Ignore compiled files
+set wildignore=*.o,*~,*.pyc
+if has("win16") || has("win32")
+    set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
+else
+    set wildignore+=.git\*,.hg\*,.svn\*
+endif
+
+"Always show current position
+set ruler
+
+" Height of the command bar
+set cmdheight=2
+
+" A buffer becomes hidden when it is abandoned
+set hid
+
+" Configure backspace so it acts as it should act
+set backspace=eol,start,indent
+set whichwrap+=<,>,h,l
+
+" Ignore case when searching
+set ignorecase
+
+" When searching try to be smart about cases
+set smartcase
+
+" Highlight search results
+set hlsearch
+
+" Makes search act like search in modern browsers
+set incsearch
+
+" Don't redraw while executing macros (good performance config)
+set lazyredraw
+
+" For regular expressions turn magic on
+set magic
+
+" Show matching brackets when text indicator is over them
+set showmatch
+" How many tenths of a second to blink when matching brackets
+set mat=2
+
+" No annoying sound on errors
+set noerrorbells
+set novisualbell
+set t_vb=
+set tm=500
+
+" Add a bit extra margin to the left
+set foldcolumn=1
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Colors and Fonts
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Enable syntax highlighting
+syntax enable
+
+try
+    colorscheme desert
+catch
+endtry
+
+set background=dark
+
+" Set extra options when running in GUI mode
+if has("gui_running")
+    set guioptions-=T
+    set guioptions-=e
+    set t_Co=256
+    set guitablabel=%M\ %t
+endif
+
+" Set utf8 as standard encoding and en_US as the standard language
+set encoding=utf8
+
+" Use Unix as the standard file type
+set ffs=unix,dos,mac
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Files, backups and undo
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Turn backup off, since most stuff is in SVN, git et.c anyway...
+set nobackup
+set nowb
+set noswapfile
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Text, tab and indent related
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Use spaces instead of tabs
+set expandtab
+
+" Be smart when using tabs ;)
+set smarttab
+
+" 1 tab == 4 spaces
+set shiftwidth=4
+set tabstop=4
+
+" Linebreak on 500 characters
+set lbr
+set tw=500
+
+set ai "Auto indent
+set si "Smart indent
+set wrap "Wrap lines
+
+
+""""""""""""""""""""""""""""""
+" => Visual mode related
+""""""""""""""""""""""""""""""
+" Visual mode pressing * or # searches for the current selection
+" Super useful! From an idea by Michael Naumann
+vnoremap <silent> * :call VisualSelection('f', '')<CR>
+vnoremap <silent> # :call VisualSelection('b', '')<CR>
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Moving around, tabs, windows and buffers
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Treat long lines as break lines (useful when moving around in them)
+map j gj
+map k gk
+
+" Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search)
+map <space> /
+map <c-space> ?
+
+" Disable highlight when <leader><cr> is pressed
+map <silent> <leader><cr> :noh<cr>
+
+" Smart way to move between windows
+map <C-j> <C-W>j
+map <C-k> <C-W>k
+map <C-h> <C-W>h
+map <C-l> <C-W>l
+
+" Close the current buffer
+map <leader>bd :Bclose<cr>
+
+" Close all the buffers
+map <leader>ba :1,1000 bd!<cr>
+
+" Useful mappings for managing tabs
+map <leader>tn :tabnew<cr>
+map <leader>to :tabonly<cr>
+map <leader>tc :tabclose<cr>
+map <leader>tm :tabmove
+map <leader>t<leader> :tabnext
+
+" Opens a new tab with the current buffer's path
+" Super useful when editing files in the same directory
+map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
+
+" Switch CWD to the directory of the open buffer
+map <leader>cd :cd %:p:h<cr>:pwd<cr>
+
+" Specify the behavior when switching between buffers
+try
+  set switchbuf=useopen,usetab,newtab
+  set stal=2
+catch
+endtry
+
+" Return to last edit position when opening files (You want this!)
+autocmd BufReadPost *
+     \ if line("'\"") > 0 && line("'\"") <= line("$") |
+     \   exe "normal! g`\"" |
+     \ endif
+" Remember info about open buffers on close
+set viminfo^=%
+
+
+""""""""""""""""""""""""""""""
+" => Status line
+""""""""""""""""""""""""""""""
+" Always show the status line
+set laststatus=2
+
+" Format the status line
+set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Editing mappings
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Remap VIM 0 to first non-blank character
+map 0 ^
+
+" Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
+nmap <M-j> mz:m+<cr>`z
+nmap <M-k> mz:m-2<cr>`z
+vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
+vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
+
+if has("mac") || has("macunix")
+  nmap <D-j> <M-j>
+  nmap <D-k> <M-k>
+  vmap <D-j> <M-j>
+  vmap <D-k> <M-k>
+endif
+
+" Delete trailing white space on save, useful for Python and CoffeeScript ;)
+func! DeleteTrailingWS()
+  exe "normal mz"
+  %s/\s\+$//ge
+  exe "normal `z"
+endfunc
+autocmd BufWrite *.py :call DeleteTrailingWS()
+autocmd BufWrite *.coffee :call DeleteTrailingWS()
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => vimgrep searching and cope displaying
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" When you press gv you vimgrep after the selected text
+vnoremap <silent> gv :call VisualSelection('gv', '')<CR>
+
+" Open vimgrep and put the cursor in the right position
+map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>
+
+" Vimgreps in the current file
+map <leader><space> :vimgrep // <C-R>%<C-A><right><right><right><right><right><right><right><right><right>
+
+" When you press <leader>r you can search and replace the selected text
+vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR>
+
+" Do :help cope if you are unsure what cope is. It's super useful!
+"
+" When you search with vimgrep, display your results in cope by doing:
+"   <leader>cc
+"
+" To go to the next search result do:
+"   <leader>n
+"
+" To go to the previous search results do:
+"   <leader>p
+"
+map <leader>cc :botright cope<cr>
+map <leader>co ggVGy:tabnew<cr>:set syntax=qf<cr>pgg
+map <leader>n :cn<cr>
+map <leader>p :cp<cr>
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Spell checking
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Pressing ,ss will toggle and untoggle spell checking
+map <leader>ss :setlocal spell!<cr>
+
+" Shortcuts using <leader>
+map <leader>sn ]s
+map <leader>sp [s
+map <leader>sa zg
+map <leader>s? z=
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Misc
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Remove the Windows ^M - when the encodings gets messed up
+noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
+
+" Quickly open a buffer for scripbble
+map <leader>q :e ~/buffer<cr>
+
+" Toggle paste mode on and off
+map <leader>pp :setlocal paste!<cr>
+
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" => Helper functions
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! CmdLine(str)
+    exe "menu Foo.Bar :" . a:str
+    emenu Foo.Bar
+    unmenu Foo
+endfunction
+
+function! VisualSelection(direction, extra_filter) range
+    let l:saved_reg = @"
+    execute "normal! vgvy"
+
+    let l:pattern = escape(@", '\\/.*$^~[]')
+    let l:pattern = substitute(l:pattern, "\n$", "", "")
+
+    if a:direction == 'b'
+        execute "normal ?" . l:pattern . "^M"
+    elseif a:direction == 'gv'
+        call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.' . a:extra_filter)
+    elseif a:direction == 'replace'
+        call CmdLine("%s" . '/'. l:pattern . '/')
+    elseif a:direction == 'f'
+        execute "normal /" . l:pattern . "^M"
+    endif
+
+    let @/ = l:pattern
+    let @" = l:saved_reg
+endfunction
+
+
+" Returns true if paste mode is enabled
+function! HasPaste()
+    if &paste
+        return 'PASTE MODE  '
+    en
+    return ''
+endfunction
+
+" Don't close window, when deleting a buffer
+command! Bclose call <SID>BufcloseCloseIt()
+function! <SID>BufcloseCloseIt()
+   let l:currentBufNum = bufnr("%")
+   let l:alternateBufNum = bufnr("#")
+
+   if buflisted(l:alternateBufNum)
+     buffer #
+   else
+     bnext
+   endif
+
+   if bufnr("%") == l:currentBufNum
+     new
+   endif
+
+   if buflisted(l:currentBufNum)
+     execute("bdelete! ".l:currentBufNum)
+   endif
+endfunction
diff --git a/scripts/vagrant/puphpet/puppet/Puppetfile b/scripts/vagrant/puphpet/puppet/Puppetfile
new file mode 100644 (file)
index 0000000..3ba8743
--- /dev/null
@@ -0,0 +1,15 @@
+forge "http://forge.puppetlabs.com"
+mod 'stdlib', :git => 'https://github.com/puphpet/puppetlabs-stdlib.git'
+mod 'concat', :git => 'https://github.com/puphpet/puppetlabs-concat.git'
+mod 'apt', :git => 'https://github.com/puphpet/puppetlabs-apt.git'
+mod 'yum', :git => 'https://github.com/puphpet/puppet-yum.git'
+mod 'vcsrepo', :git => 'https://github.com/puphpet/puppetlabs-vcsrepo.git'
+mod 'ntp', :git => 'https://github.com/puphpet/puppetlabs-ntp.git'
+mod 'iptables', :git => 'https://github.com/puphpet/puppet-iptables.git'
+mod 'apache', :git => 'https://github.com/puphpet/puppetlabs-apache.git'
+mod 'php', :git => 'https://github.com/puphpet/puppet-php.git'
+mod 'composer', :git => 'https://github.com/puphpet/puppet-composer.git'
+mod 'puphpet', :git => 'https://github.com/puphpet/puppet-puphpet.git'
+mod 'drush', :git => 'https://github.com/puphpet/puppet-drush.git', :ref => 'new'
+mod 'mysql', :git => 'https://github.com/puphpet/puppetlabs-mysql.git'
+mod 'beanstalkd', :git => 'https://github.com/puphpet/puppet-beanstalkd.git'
similarity index 50%
rename from scripts/vagrant/hiera.yaml
rename to scripts/vagrant/puphpet/puppet/hiera.yaml
index 2cab35e..0cde1f6 100644 (file)
@@ -1,7 +1,7 @@
 ---
 :backends: yaml
 :yaml:
-    :datadir: '/vagrant/puppet/hieradata'
+    :datadir: '/vagrant/puphpet'
 :hierarchy:
-    - common
+    - config
 :logger: console
@@ -32,6 +32,17 @@ file { "/home/${::ssh_username}":
     owner  => $::ssh_username,
 }
 
+# copy dot files to ssh user's home directory
+exec { 'dotfiles':
+  cwd     => "/home/${::ssh_username}",
+  command => "cp -r /vagrant/puphpet/files/dot/.[a-zA-Z0-9]* /home/${::ssh_username}/ \
+              && chown -R ${::ssh_username} /home/${::ssh_username}/.[a-zA-Z0-9]* \
+              && cp -r /vagrant/puphpet/files/dot/.[a-zA-Z0-9]* /root/",
+  onlyif  => 'test -d /vagrant/puphpet/files/dot',
+  returns => [0, 1],
+  require => User[$::ssh_username]
+}
+
 case $::osfamily {
   # debian, ubuntu
   'debian': {
@@ -48,14 +59,31 @@ case $::osfamily {
   'redhat': {
     class { 'yum': extrarepo => ['epel'] }
 
+    class { 'yum::repo::rpmforge': }
+    class { 'yum::repo::repoforgeextras': }
+
     Class['::yum'] -> Yum::Managed_yumrepo <| |> -> Package <| |>
 
+    if defined(Package['git']) == false {
+      package { 'git':
+        ensure  => latest,
+        require => Class['yum::repo::repoforgeextras']
+      }
+    }
+
     exec { 'bash_git':
       cwd     => "/home/${::ssh_username}",
       command => "curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > /home/${::ssh_username}/.bash_git",
       creates => "/home/${::ssh_username}/.bash_git"
     }
 
+    exec { 'bash_git for root':
+      cwd     => '/root',
+      command => "cp /home/${::ssh_username}/.bash_git /root/.bash_git",
+      creates => '/root/.bash_git',
+      require => Exec['bash_git']
+    }
+
     file_line { 'link ~/.bash_git':
       ensure  => present,
       line    => 'if [ -f ~/.bash_git ] ; then source ~/.bash_git; fi',
@@ -66,13 +94,28 @@ case $::osfamily {
       ]
     }
 
+    file_line { 'link ~/.bash_git for root':
+      ensure  => present,
+      line    => 'if [ -f ~/.bash_git ] ; then source ~/.bash_git; fi',
+      path    => '/root/.bashrc',
+      require => [
+        Exec['dotfiles'],
+        Exec['bash_git'],
+      ]
+    }
+
     file_line { 'link ~/.bash_aliases':
       ensure  => present,
       line    => 'if [ -f ~/.bash_aliases ] ; then source ~/.bash_aliases; fi',
       path    => "/home/${::ssh_username}/.bash_profile",
-      require => [
-        File_line['link ~/.bash_git'],
-      ]
+      require => File_line['link ~/.bash_git']
+    }
+
+    file_line { 'link ~/.bash_aliases for root':
+      ensure  => present,
+      line    => 'if [ -f ~/.bash_aliases ] ; then source ~/.bash_aliases; fi',
+      path    => '/root/.bashrc',
+      require => File_line['link ~/.bash_git for root']
     }
 
     ensure_packages( ['augeas'] )
@@ -85,6 +128,8 @@ if $php_values == undef {
 
 case $::operatingsystem {
   'debian': {
+    include apt::backports
+
     add_dotdeb { 'packages.dotdeb.org': release => $lsbdistcodename }
 
     if is_hash($php_values) {
@@ -97,9 +142,23 @@ case $::operatingsystem {
         add_dotdeb { 'packages.dotdeb.org-php55': release => 'wheezy-php55' }
       }
     }
+
+    $server_lsbdistcodename = downcase($lsbdistcodename)
+
+    apt::force { 'git':
+      release => "${server_lsbdistcodename}-backports",
+      timeout => 60
+    }
   }
   'ubuntu': {
-    apt::key { '4F4EA0AAE5267A6C': }
+    apt::key { '4F4EA0AAE5267A6C':
+      key_server => 'hkp://keyserver.ubuntu.com:80'
+    }
+    apt::key { '4CBEDD5A':
+      key_server => 'hkp://keyserver.ubuntu.com:80'
+    }
+
+    apt::ppa { 'ppa:pdoes/ppa': require => Apt::Key['4CBEDD5A'] }
 
     if is_hash($php_values) {
       # Ubuntu Lucid 10.04, Precise 12.04, Quantal 12.10 and Raring 13.04 can do PHP 5.3 (default <= 12.10) and 5.4 (default <= 13.04)
@@ -152,7 +211,7 @@ define add_dotdeb ($release){
 ## Begin Apache manifest
 
 if $yaml_values == undef {
-  $yaml_values = loadyaml('/vagrant/puppet/hieradata/common.yaml')
+  $yaml_values = loadyaml('/vagrant/puphpet/config.yaml')
 }
 
 if $apache_values == undef {
@@ -165,7 +224,7 @@ $webroot_location = $puphpet::params::apache_webroot_location
 
 exec { "exec mkdir -p ${webroot_location}":
   command => "mkdir -p ${webroot_location}",
-  onlyif  => "test -d ${webroot_location}",
+  creates => $webroot_location,
 }
 
 if ! defined(File[$webroot_location]) {
@@ -202,6 +261,14 @@ if $::osfamily == 'debian' {
   }
 }
 
+if has_key($apache_values, 'mod_pagespeed') and $apache_values['mod_pagespeed'] == 1 {
+  class { 'puphpet::apache::modpagespeed': }
+}
+
+if has_key($apache_values, 'mod_spdy') and $apache_values['mod_spdy'] == 1 {
+  class { 'puphpet::apache::modspdy': }
+}
+
 create_resources(apache::vhost, $apache_values['vhosts'])
 
 define apache_mod {
@@ -247,8 +314,15 @@ if $php_fpm_ini == undef {
 if is_hash($apache_values) {
   include apache::params
 
+  if has_key($apache_values, 'mod_spdy') and $apache_values['mod_spdy'] == 1 {
+    $php_webserver_service_ini = 'cgi'
+  } else {
+    $php_webserver_service_ini = 'httpd'
+  }
+
   $php_webserver_service = 'httpd'
-  $php_webserver_user = $apache::params::user
+  $php_webserver_user    = $apache::params::user
+  $php_webserver_restart = true
 
   class { 'php':
     service => $php_webserver_service
@@ -256,8 +330,10 @@ if is_hash($apache_values) {
 } elsif is_hash($nginx_values) {
   include nginx::params
 
-  $php_webserver_service = "${php_prefix}fpm"
-  $php_webserver_user = $nginx::params::nx_daemon_user
+  $php_webserver_service     = "${php_prefix}fpm"
+  $php_webserver_service_ini = $php_webserver_service
+  $php_webserver_user        = $nginx::params::nx_daemon_user
+  $php_webserver_restart     = true
 
   class { 'php':
     package             => $php_webserver_service,
@@ -273,6 +349,16 @@ if is_hash($apache_values) {
     hasstatus  => true,
     require    => Package[$php_webserver_service]
   }
+} else {
+  $php_webserver_service     = undef
+  $php_webserver_service_ini = undef
+  $php_webserver_restart     = false
+
+  class { 'php':
+    package             => "${php_prefix}cli",
+    service             => $php_webserver_service,
+    service_autorestart => false,
+  }
 }
 
 class { 'php::devel': }
@@ -287,12 +373,23 @@ if count($php_values['modules']['pecl']) > 0 {
   php_pecl_mod { $php_values['modules']['pecl']:; }
 }
 if count($php_values['ini']) > 0 {
-  $php_values['ini'].each { |$key, $value|
-    puphpet::ini { $key:
-      entry       => "CUSTOM/${key}",
-      value       => $value,
-      php_version => $php_values['version'],
-      webserver   => $php_webserver_service
+  each( $php_values['ini'] ) |$key, $value| {
+    if is_array($value) {
+      each( $php_values['ini'][$key] ) |$innerkey, $innervalue| {
+        puphpet::ini { "${key}_${innerkey}":
+          entry       => "CUSTOM_${innerkey}/${key}",
+          value       => $innervalue,
+          php_version => $php_values['version'],
+          webserver   => $php_webserver_service_ini
+        }
+      }
+    } else {
+      puphpet::ini { $key:
+        entry       => "CUSTOM/${key}",
+        value       => $value,
+        php_version => $php_values['version'],
+        webserver   => $php_webserver_service_ini
+      }
     }
   }
 
@@ -314,17 +411,25 @@ puphpet::ini { $key:
   entry       => 'CUSTOM/date.timezone',
   value       => $php_values['timezone'],
   php_version => $php_values['version'],
-  webserver   => $php_webserver_service
+  webserver   => $php_webserver_service_ini
 }
 
 define php_mod {
-  php::module { $name: }
+  php::module { $name:
+    service_autorestart => $php_webserver_restart,
+  }
 }
 define php_pear_mod {
-  php::pear::module { $name: use_package => false }
+  php::pear::module { $name:
+    use_package         => false,
+    service_autorestart => $php_webserver_restart,
+  }
 }
 define php_pecl_mod {
-  php::pecl::module { $name: use_package => false }
+  php::pecl::module { $name:
+    use_package         => false,
+    service_autorestart => $php_webserver_restart,
+  }
 }
 
 if $php_values['composer'] == 1 {
@@ -340,6 +445,8 @@ if $php_values['composer'] == 1 {
   }
 }
 
+## Begin Xdebug manifest
+
 if $xdebug_values == undef {
   $xdebug_values = hiera('xdebug', false)
 }
@@ -358,7 +465,7 @@ if $xdebug_values['install'] != undef and $xdebug_values['install'] == 1 {
   }
 
   if is_hash($xdebug_values['settings']) and count($xdebug_values['settings']) > 0 {
-    $xdebug_values['settings'].each { |$key, $value|
+    each( $xdebug_values['settings'] ) |$key, $value| {
       puphpet::ini { $key:
         entry       => "XDEBUG/${key}",
         value       => $value,
@@ -375,20 +482,58 @@ if $xhprof_values == undef {
   $xhprof_values = hiera('xhprof', false)
 }
 
+if $apache_values == undef {
+  $apache_values = hiera('apache', false)
+}
+
+if $nginx_values == undef {
+  $nginx_values = hiera('nginx', false)
+}
+
+if is_hash($apache_values) or is_hash($nginx_values) {
+  $xhprof_webserver_restart = true
+} else  {
+  $xhprof_webserver_restart = false
+}
+
 if is_hash($xhprof_values) and $xhprof_values['install'] == 1 {
-  $xhprofPath = $xhprof_values['location']
+  if $::operatingsystem == 'ubuntu' {
+    apt::key { '8D0DC64F':
+      key_server => 'hkp://keyserver.ubuntu.com:80'
+    }
+
+    apt::ppa { 'ppa:brianmercer/php5-xhprof': require => Apt::Key['8D0DC64F'] }
+  }
 
-  php::pecl::module { 'xhprof':
-    use_package     => false,
-    preferred_state => 'beta',
+  $xhprof_package = $puphpet::params::xhprof_package
+
+  if is_hash($apache_values) {
+    $xhprof_webroot_location = $puphpet::params::apache_webroot_location
+    $xhprof_webserver_service = Service['httpd']
+  } elsif is_hash($nginx_values) {
+    $xhprof_webroot_location = $puphpet::params::nginx_webroot_location
+    $xhprof_webserver_service = Service['nginx']
+  } else {
+    $xhprof_webroot_location = $xhprof_values['location']
+    $xhprof_webserver_service = undef
+  }
+
+  if defined(Package[$xhprof_package]) == false {
+    package { $xhprof_package:
+      ensure  => installed,
+      require => Package['php'],
+      notify  => $xhprof_webserver_service,
+    }
   }
 
+  ensure_packages( ['graphviz'] )
+
   exec { 'delete-xhprof-path-if-not-git-repo':
     command => "rm -rf ${xhprofPath}",
-    onlyif => "test ! -d ${xhprofPath}/.git"
+    onlyif  => "test ! -d ${xhprofPath}/.git"
   }
 
-  vcsrepo { $xhprofPath:
+  vcsrepo { "${xhprof_webroot_location}/xhprof":
     ensure   => present,
     provider => git,
     source   => 'https://github.com/facebook/xhprof.git',
@@ -398,12 +543,12 @@ if is_hash($xhprof_values) and $xhprof_values['install'] == 1 {
   file { "${xhprofPath}/xhprof_html":
     ensure  => directory,
     mode    => 0775,
-    require => Vcsrepo[$xhprofPath]
+    require => Vcsrepo["${xhprof_webroot_location}/xhprof"]
   }
 
   composer::exec { 'xhprof-composer-run':
     cmd     => 'install',
-    cwd     => $xhprofPath,
+    cwd     => "${xhprof_webroot_location}/xhprof",
     require => [
       Class['composer'],
       File["${xhprofPath}/xhprof_html"]
@@ -411,6 +556,30 @@ if is_hash($xhprof_values) and $xhprof_values['install'] == 1 {
   }
 }
 
+## Begin Drush manifest
+
+if $drush_values == undef {
+  $drush_values = hiera('drush', false)
+}
+
+if $drush_values['install'] != undef and $drush_values['install'] == 1 {
+  if ($drush_values['settings']['drush.tag_branch'] != undef) {
+    $drush_tag_branch = $drush_values['settings']['drush.tag_branch']
+  } else {
+    $drush_tag_branch = ''
+  }
+
+  ## @see https://drupal.org/node/2165015
+  include drush::git::drush
+
+  ## class { 'drush::git::drush':
+  ##   git_branch => $drush_tag_branch,
+  ##   update     => true,
+  ## }
+}
+
+## End Drush manifest
+
 ## Begin MySQL manifest
 
 if $mysql_values == undef {
@@ -429,6 +598,12 @@ if $nginx_values == undef {
   $nginx_values = hiera('nginx', false)
 }
 
+if is_hash($apache_values) or is_hash($nginx_values) {
+  $mysql_webserver_restart = true
+} else {
+  $mysql_webserver_restart = false
+}
+
 if $mysql_values['root_password'] {
   class { 'mysql::server':
     root_password => $mysql_values['root_password'],
@@ -440,9 +615,13 @@ if $mysql_values['root_password'] {
 
   if is_hash($php_values) {
     if $::osfamily == 'redhat' and $php_values['version'] == '53' and ! defined(Php::Module['mysql']) {
-      php::module { 'mysql': }
+      php::module { 'mysql':
+        service_autorestart => $mysql_webserver_restart,
+      }
     } elsif ! defined(Php::Module['mysqlnd']) {
-      php::module { 'mysqlnd': }
+      php::module { 'mysqlnd':
+        service_autorestart => $mysql_webserver_restart,
+      }
     }
   }
 }
@@ -467,7 +646,7 @@ define mysql_db (
   }
 }
 
-if $mysql_values['phpmyadmin'] == 1 and is_hash($php_values) {
+if has_key($mysql_values, 'phpmyadmin') and $mysql_values['phpmyadmin'] == 1 and is_hash($php_values) {
   if $::osfamily == 'debian' {
     if $::operatingsystem == 'ubuntu' {
       apt::key { '80E7349A06ED541C': }
@@ -490,24 +669,45 @@ if $mysql_values['phpmyadmin'] == 1 and is_hash($php_values) {
   include puphpet::params
 
   if is_hash($apache_values) {
-    $mysql_webroot_location = $puphpet::params::apache_webroot_location
+    $mysql_pma_webroot_location = $puphpet::params::apache_webroot_location
   } elsif is_hash($nginx_values) {
-    $mysql_webroot_location = $puphpet::params::nginx_webroot_location
+    $mysql_pma_webroot_location = $puphpet::params::nginx_webroot_location
 
     mysql_nginx_default_conf { 'override_default_conf':
-      webroot => $mysql_webroot_location
+      webroot => $mysql_pma_webroot_location
     }
   }
 
-  file { "${mysql_webroot_location}/phpmyadmin":
-    target  => "/usr/share/${phpMyAdmin_folder}",
-    ensure  => link,
-    replace => 'no',
+  exec { 'move phpmyadmin to webroot':
+    command => "mv /usr/share/${phpMyAdmin_folder} ${mysql_pma_webroot_location}/phpmyadmin",
+    onlyif  => "test ! -d ${mysql_pma_webroot_location}/phpmyadmin",
     require => [
       Package[$phpMyAdmin_package],
-      File[$mysql_webroot_location]
+      File[$mysql_pma_webroot_location]
     ]
   }
+
+  file { "/usr/share/${phpMyAdmin_folder}":
+    target  => "${mysql_pma_webroot_location}/phpmyadmin",
+    ensure  => link,
+    replace => 'no',
+    require => Exec['move phpmyadmin to webroot']
+  }
+}
+
+if has_key($mysql_values, 'adminer') and $mysql_values['adminer'] == 1 and is_hash($php_values) {
+  if is_hash($apache_values) {
+    $mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location
+  } elsif is_hash($nginx_values) {
+    $mysql_adminer_webroot_location = $puphpet::params::nginx_webroot_location
+  } else {
+    $mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location
+  }
+
+  class { 'puphpet::adminer':
+    location => "${mysql_adminer_webroot_location}/adminer",
+    owner    => 'www-data'
+  }
 }
 
 define mysql_nginx_default_conf (
@@ -531,10 +731,20 @@ define mysql_nginx_default_conf (
   }
 }
 
+# Begin beanstalkd
+
+if $beanstalkd_values == undef {
+  $beanstalkd_values = hiera('beanstalkd', false)
+}
+
+if has_key($beanstalkd_values, 'install') and $beanstalkd_values['install'] == 1 {
+  beanstalkd::config { $beanstalkd_values: }
+}
+
 # tine20 manifest
 
 if $tine20_values == undef {
-  $tine20_values = loadyaml('/vagrant/puppet/hieradata/tine20.yaml')
+  $tine20_values = loadyaml('/vagrant/puphpet/tine20.yaml')
 }
 
 mysql::db { $tine20_values['database']['name']:
@@ -608,4 +818,4 @@ exec { 'phing-tine-install':
   require => [
     File['/var/www/install.properties']
   ]
-}
+}
\ No newline at end of file
diff --git a/scripts/vagrant/puphpet/shell/execute-files.sh b/scripts/vagrant/puphpet/shell/execute-files.sh
new file mode 100644 (file)
index 0000000..2e4baae
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+VAGRANT_CORE_FOLDER=$(cat "/.puphpet-stuff/vagrant-core-folder.txt")
+
+shopt -s nullglob
+files=("${VAGRANT_CORE_FOLDER}"/files/exec-once/*)
+
+if [[ ! -f /.puphpet-stuff/exec-once-ran && (${#files[@]} -gt 0) ]]; then
+    echo 'Running files in files/exec-once'
+    find "${VAGRANT_CORE_FOLDER}/files/exec-once" -maxdepth 1 -type f \( ! -iname ".gitignore" \) -exec chmod +x '{}' \; -exec {} \;
+    echo 'Finished running files in files/exec-once'
+    echo 'To run again, delete file /.puphpet-stuff/exec-once-ran'
+    touch /.puphpet-stuff/exec-once-ran
+fi
+
+echo 'Running files in files/exec-always'
+find "${VAGRANT_CORE_FOLDER}/files/exec-always" -maxdepth 1 -type f \( ! -iname ".gitignore" \) -exec chmod +x '{}' \; -exec {} \;
+echo 'Finished running files in files/exec-always'
similarity index 64%
rename from scripts/vagrant/shell/initial-setup.sh
rename to scripts/vagrant/puphpet/shell/initial-setup.sh
index 724963a..6482104 100644 (file)
@@ -1,21 +1,26 @@
 #!/bin/bash
 
-OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
-CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
+VAGRANT_CORE_FOLDER="/vagrant/puphpet"
+
+OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
+CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
 
 if [[ ! -d /.puphpet-stuff ]]; then
-    cat /vagrant/shell/self-promotion.txt
     mkdir /.puphpet-stuff
+
+    echo "${VAGRANT_CORE_FOLDER}" > "/.puphpet-stuff/vagrant-core-folder.txt"
+
+    cat "${VAGRANT_CORE_FOLDER}/shell/self-promotion.txt"
     echo "Created directory /.puphpet-stuff"
 fi
 
 if [[ ! -f /.puphpet-stuff/initial-setup-repo-update ]]; then
-    if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
+    if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
         echo "Running initial-setup apt-get update"
         apt-get update >/dev/null
         touch /.puphpet-stuff/initial-setup-repo-update
         echo "Finished running initial-setup apt-get update"
-    elif [[ "$OS" == 'centos' ]]; then
+    elif [[ "${OS}" == 'centos' ]]; then
         echo "Running initial-setup yum update"
         yum update -y >/dev/null
         echo "Finished running initial-setup yum update"
@@ -27,7 +32,7 @@ if [[ ! -f /.puphpet-stuff/initial-setup-repo-update ]]; then
     fi
 fi
 
-if [[ "$OS" == 'ubuntu' && ("$CODENAME" == 'lucid' || "$CODENAME" == 'precise') && ! -f /.puphpet-stuff/ubuntu-required-libraries ]]; then
+if [[ "${OS}" == 'ubuntu' && ("${CODENAME}" == 'lucid' || "${CODENAME}" == 'precise') && ! -f /.puphpet-stuff/ubuntu-required-libraries ]]; then
     echo 'Installing basic curl packages (Ubuntu only)'
     apt-get install -y libcurl3 libcurl4-gnutls-dev >/dev/null
     echo 'Finished installing basic curl packages (Ubuntu only)'
@@ -1,7 +1,9 @@
 #!/bin/bash
 
-OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
-CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
+VAGRANT_CORE_FOLDER=$(cat "/.puphpet-stuff/vagrant-core-folder.txt")
+
+OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
+CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
 
 # Directory in which librarian-puppet should manage its modules directory
 PUPPET_DIR=/etc/puppet/
@@ -9,7 +11,7 @@ PUPPET_DIR=/etc/puppet/
 $(which git > /dev/null 2>&1)
 FOUND_GIT=$?
 
-if [ "$FOUND_GIT" -ne '0' ] && [ ! -f /.puphpet-stuff/librarian-puppet-installed ]; then
+if [ "${FOUND_GIT}" -ne '0' ] && [ ! -f /.puphpet-stuff/librarian-puppet-installed ]; then
     $(which apt-get > /dev/null 2>&1)
     FOUND_APT=$?
     $(which yum > /dev/null 2>&1)
@@ -27,15 +29,15 @@ if [ "$FOUND_GIT" -ne '0' ] && [ ! -f /.puphpet-stuff/librarian-puppet-installed
     echo 'Finished installing git'
 fi
 
-if [[ ! -d "$PUPPET_DIR" ]]; then
-    mkdir -p "$PUPPET_DIR"
-    echo "Created directory $PUPPET_DIR"
+if [[ ! -d "${PUPPET_DIR}" ]]; then
+    mkdir -p "${PUPPET_DIR}"
+    echo "Created directory ${PUPPET_DIR}"
 fi
 
-cp "/vagrant/puppet/Puppetfile" "$PUPPET_DIR"
+cp "${VAGRANT_CORE_FOLDER}/puppet/Puppetfile" "${PUPPET_DIR}"
 echo "Copied Puppetfile"
 
-if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
+if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
     if [[ ! -f /.puphpet-stuff/librarian-base-packages ]]; then
         echo 'Installing base packages for librarian'
         apt-get install -y build-essential ruby-dev >/dev/null
@@ -45,7 +47,7 @@ if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
     fi
 fi
 
-if [ "$OS" == 'ubuntu' ]; then
+if [ "${OS}" == 'ubuntu' ]; then
     if [[ ! -f /.puphpet-stuff/librarian-libgemplugin-ruby ]]; then
         echo 'Updating libgemplugin-ruby (Ubuntu only)'
         apt-get install -y libgemplugin-ruby >/dev/null
@@ -54,7 +56,7 @@ if [ "$OS" == 'ubuntu' ]; then
         touch /.puphpet-stuff/librarian-libgemplugin-ruby
     fi
 
-    if [ "$CODENAME" == 'lucid' ] && [ ! -f /.puphpet-stuff/librarian-rubygems-update ]; then
+    if [ "${CODENAME}" == 'lucid' ] && [ ! -f /.puphpet-stuff/librarian-rubygems-update ]; then
         echo 'Updating rubygems (Ubuntu Lucid only)'
         echo 'Ignore all "conflicting chdir" errors!'
         gem install rubygems-update >/dev/null
@@ -71,12 +73,19 @@ if [[ ! -f /.puphpet-stuff/librarian-puppet-installed ]]; then
     echo 'Finished installing librarian-puppet'
 
     echo 'Running initial librarian-puppet'
-    cd "$PUPPET_DIR" && librarian-puppet install --clean >/dev/null
+    cd "${PUPPET_DIR}" && librarian-puppet install --clean >/dev/null
     echo 'Finished running initial librarian-puppet'
 
     touch /.puphpet-stuff/librarian-puppet-installed
 else
     echo 'Running update librarian-puppet'
-    cd "$PUPPET_DIR" && librarian-puppet update >/dev/null
+    cd "${PUPPET_DIR}" && librarian-puppet update >/dev/null
     echo 'Finished running update librarian-puppet'
 fi
+
+if [[ "${OS}" == 'centos' ]]; then
+    echo "Replacing puppetlabs-git module with custom"
+    rm -rf /etc/puppet/modules/git
+    git clone https://github.com/puphpet/puppetlabs-git.git /etc/puppet/modules/git
+    echo "Finished replacing puppetlabs-git module with custom"
+fi
similarity index 85%
rename from scripts/vagrant/shell/os-detect.sh
rename to scripts/vagrant/puphpet/shell/os-detect.sh
index 07d2adb..a521f44 100644 (file)
@@ -9,7 +9,7 @@ ID="unknown"
 CODENAME="unknown"
 RELEASE="unknown"
 
-if [ "$OS" == "Linux" ]; then
+if [ "${OS}" == "Linux" ]; then
     # detect centos
     grep "centos" /etc/issue -i -q
     if [ $? = '0' ]; then
@@ -36,12 +36,12 @@ fi
 
 declare -A info
 
-info[id]=$(echo "$ID" | tr '[A-Z]' '[a-z]')
-info[codename]=$(echo "$CODENAME" | tr '[A-Z]' '[a-z]')
-info[release]=$(echo "$RELEASE" | tr '[A-Z]' '[a-z]')
+info[id]=$(echo "${ID}" | tr '[A-Z]' '[a-z]')
+info[codename]=$(echo "${CODENAME}" | tr '[A-Z]' '[a-z]')
+info[release]=$(echo "${RELEASE}" | tr '[A-Z]' '[a-z]')
 
 if [ "$TYPE" ] ; then 
-    echo "${info[$TYPE]}"
+    echo "${info[${TYPE}]}"
 else 
     echo -e "ID\t${info[id]}"
     echo -e "CODENAME\t${info[codename]}"
similarity index 78%
rename from scripts/vagrant/shell/update-puppet.sh
rename to scripts/vagrant/puphpet/shell/update-puppet.sh
index 128707c..55201a1 100644 (file)
@@ -1,11 +1,13 @@
 #!/bin/bash
 
-OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
-RELEASE=$(/bin/bash /vagrant/shell/os-detect.sh RELEASE)
-CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
+VAGRANT_CORE_FOLDER=$(cat "/.puphpet-stuff/vagrant-core-folder.txt")
+
+OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
+RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE)
+CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
 
 if [[ ! -f /.puphpet-stuff/update-puppet ]]; then
-    if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
+    if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
         echo "Downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
         wget --quiet --tries=5 --timeout=10 -O "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" "http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
         echo "Finished downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
@@ -19,11 +21,11 @@ if [[ ! -f /.puphpet-stuff/update-puppet ]]; then
         echo "Updating Puppet to latest version"
         apt-get -y install puppet >/dev/null
         PUPPET_VERSION=$(puppet help | grep 'Puppet v')
-        echo "Finished updating puppet to latest version: $PUPPET_VERSION"
+        echo "Finished updating puppet to latest version: ${PUPPET_VERSION}"
 
         touch /.puphpet-stuff/update-puppet
         echo "Created empty file /.puphpet-stuff/update-puppet"
-    elif [ "$OS" == 'centos' ]; then
+    elif [ "${OS}" == 'centos' ]; then
         echo "Downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
         yum -y --nogpgcheck install "http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm" >/dev/null
         echo "Finished downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
@@ -35,7 +37,7 @@ if [[ ! -f /.puphpet-stuff/update-puppet ]]; then
         echo "Installing/Updating Puppet to latest version"
         yum -y install puppet >/dev/null
         PUPPET_VERSION=$(puppet help | grep 'Puppet v')
-        echo "Finished installing/updating puppet to latest version: $PUPPET_VERSION"
+        echo "Finished installing/updating puppet to latest version: ${PUPPET_VERSION}"
 
         touch /.puphpet-stuff/update-puppet
         echo "Created empty file /.puphpet-stuff/update-puppet"
diff --git a/scripts/vagrant/puppet/Puppetfile b/scripts/vagrant/puppet/Puppetfile
deleted file mode 100644 (file)
index 252ae8e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-forge "http://forge.puppetlabs.com"
-mod 'stdlib', :git => 'git://github.com/puphpet/puppetlabs-stdlib.git'
-mod 'concat', :git => 'git://github.com/puphpet/puppetlabs-concat.git'
-mod 'apt', :git => 'git://github.com/puphpet/puppetlabs-apt.git'
-mod 'yum', :git => 'git://github.com/puphpet/puppet-yum.git'
-mod 'vcsrepo', :git => 'git://github.com/puphpet/puppetlabs-vcsrepo.git'
-mod 'ntp', :git => 'git://github.com/puphpet/puppetlabs-ntp.git'
-mod 'iptables', :git => 'git://github.com/puphpet/puppet-iptables.git'
-mod 'apache', :git => 'git://github.com/puphpet/puppetlabs-apache.git'
-mod 'php', :git => 'git://github.com/puphpet/puppet-php.git'
-mod 'composer', :git => 'git://github.com/puphpet/puppet-composer.git'
-mod 'puphpet', :git => 'git://github.com/puphpet/puppet-puphpet.git'
-mod 'mysql', :git => 'git://github.com/puphpet/puppetlabs-mysql.git'