salted-rails 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -0
- data/lib/salted-rails/config.rb +71 -55
- data/lib/salted-rails/helper_base.rb +15 -0
- data/lib/salted-rails/vagrant_helper.rb +15 -9
- data/lib/salted-rails/version.rb +1 -1
- data/pillar/capistrano/top.sls +1 -1
- data/pillar/common.sls +1 -8
- data/pillar/vagrant/top.sls +1 -1
- data/salt/apt/load_packages.sls +5 -0
- data/salt/apt/update_packages.sls +5 -0
- data/salt/bin/change_mirror.sh +10 -6
- data/salt/bin/misc_fixes.sh +26 -0
- data/salt/bin/provision +40 -3
- data/salt/ci/cruisecontrolrb.sls +17 -11
- data/salt/ci/teamcity/etc/init.d/teamcity +4 -4
- data/salt/ci/teamcity/init.sls +18 -18
- data/salt/crons/init.sls +2 -2
- data/salt/databases/init.sls +45 -14
- data/salt/databases/mysql/client.sls +1 -1
- data/salt/databases/mysql/common.sls +3 -3
- data/salt/databases/mysql/server.sls +1 -1
- data/salt/databases/packages.sls +47 -0
- data/salt/databases/phpmyadmin/etc/nginx/admin.d/phpmyadmin.conf +10 -7
- data/salt/databases/postgresql/client.sls +5 -0
- data/salt/databases/postgresql/init.sls +10 -0
- data/salt/databases/sqlite3.sls +6 -0
- data/salt/databases/sqlitebrowser.sls +4 -0
- data/salt/editors/gvim.sls +5 -1
- data/salt/editors/rubymine.sls +16 -16
- data/salt/editors/vim/init.sls +71 -2
- data/salt/editors/vim/vimrc +8 -1
- data/salt/gui/desktop.sls +9 -0
- data/salt/gui/x2go.sls +5 -0
- data/salt/lang/jenv.sls +64 -0
- data/salt/lang/php/etc/php5/fpm/pool.d/www.conf +2 -2
- data/salt/lang/phpenv.sls +82 -0
- data/salt/lang/rbenv.sls +115 -0
- data/salt/lang/ruby.sls +24 -37
- data/salt/munin/nginx.sls +3 -1
- data/salt/munin/node.sls +2 -1
- data/salt/munin/php5-fpm.sls +3 -1
- data/salt/net/hosts.sls +9 -0
- data/salt/net/ntp.sls +6 -0
- data/salt/net/ufw.sls +8 -0
- data/salt/railsapp/gems.sls +5 -3
- data/salt/railsapp/init.sls +6 -2
- data/salt/scm/bazaar.sls +10 -0
- data/salt/scm/git/gitconfig +42 -0
- data/salt/scm/git/init.sls +21 -0
- data/salt/scm/init.sls +5 -0
- data/salt/scm/mercurial.sls +10 -0
- data/salt/scm/subversion.sls +6 -0
- data/salt/{vagrant/top.sls → top.sls} +24 -9
- data/salt/utils/file.sls +19 -0
- data/salt/utils/html.sls +5 -0
- data/salt/utils/init.sls +6 -0
- data/salt/{sysutils → utils}/net.sls +4 -0
- data/salt/{sysutils → utils}/status.sls +0 -0
- data/salt/utils/tmux/home/tmux-dev +7 -0
- data/salt/utils/tmux/home/tmux.conf +89 -0
- data/salt/utils/tmux/init.sls +32 -0
- data/salt/vagrant/minion.sls +1 -1
- data/salt/www/chromium.sls +5 -0
- data/salt/www/nginx/etc/nginx/admin.d/doc.conf +7 -0
- data/salt/www/nginx/etc/nginx/admin.d/nginx_status.conf +7 -0
- data/salt/www/nginx/etc/nginx/sites-available/.gitignore +3 -0
- data/salt/www/nginx/etc/nginx/sites-available/admin.conf +47 -0
- data/salt/www/nginx/init.sls +102 -16
- data/salt/www/nginx/srv/www/admin/favicon.ico +0 -0
- data/salt/www/nginx/srv/www/admin/favicon.png +0 -0
- data/salt/www/nginx/srv/www/admin/index.php +67 -0
- data/salt/www/nginx/srv/www/admin/phpinfo.php +3 -0
- data/salt/www/nginx/srv/www/admin/robots.txt +2 -0
- data/salt/www/users.sls +0 -9
- metadata +41 -20
- data/salt/bin/fix_hostname.sh +0 -6
- data/salt/capistrano/deploy_requirements.sls +0 -5
- data/salt/capistrano/top.sls +0 -4
- data/salt/databases/client.sls +0 -18
- data/salt/databases/server.sls +0 -19
- data/salt/gui/init.sls +0 -3
- data/salt/lang/ruby.sls.bak +0 -106
- data/salt/lang/system_ruby.sls +0 -43
- data/salt/sysutils/file.sls +0 -8
- data/salt/sysutils/init.sls +0 -5
- data/salt/sysutils/tmux.sls +0 -3
- data/salt/www/admin/etc/nginx/nginx.conf +0 -53
- data/salt/www/admin/etc/nginx/sites-available/.gitignore +0 -3
- data/salt/www/admin/etc/nginx/sites-available/phpmyadmin.conf +0 -7
- data/salt/www/admin/init.sls +0 -31
data/salt/net/ntp.sls
ADDED
data/salt/net/ufw.sls
ADDED
data/salt/railsapp/gems.sls
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
include:
|
2
|
-
- lang.
|
2
|
+
- lang.rbenv
|
3
3
|
|
4
4
|
tmp_railsapp_gems:
|
5
5
|
file.directory:
|
@@ -9,6 +9,8 @@ tmp_railsapp_gems:
|
|
9
9
|
- group: {{ pillar['username'] }}
|
10
10
|
- makedirs: True
|
11
11
|
- clean: True
|
12
|
+
- require:
|
13
|
+
- sls: lang.rbenv
|
12
14
|
|
13
15
|
railsapp_gems:
|
14
16
|
file.recurse:
|
@@ -17,15 +19,15 @@ railsapp_gems:
|
|
17
19
|
- file_mode: 644
|
18
20
|
- user: {{ pillar['username'] }}
|
19
21
|
- group: {{ pillar['username'] }}
|
22
|
+
- exclude_pat: '.*swp'
|
20
23
|
- require:
|
21
24
|
- file.directory: tmp_railsapp_gems
|
22
25
|
cmd.run:
|
23
26
|
# Run twice if first fails (weirdness with installing ruby-debug)
|
24
|
-
- name:
|
27
|
+
- name: bundle install || bundle install
|
25
28
|
- cwd: /tmp/railsapp_gems
|
26
29
|
- user: {{ pillar['username'] }}
|
27
30
|
- group: {{ pillar['username'] }}
|
28
31
|
- require:
|
29
32
|
- file: railsapp_gems
|
30
|
-
- gem.installed: base_gems
|
31
33
|
|
data/salt/railsapp/init.sls
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
include:
|
2
|
-
- databases
|
2
|
+
- databases.packages
|
3
3
|
- railsapp.packages
|
4
|
+
{%- if ('app' in pillar['roles']) %}
|
5
|
+
{%- if 'ruby' in pillar['versions'] %}
|
4
6
|
- railsapp.gems
|
5
|
-
{%-
|
7
|
+
{%- endif %}
|
8
|
+
{%- endif %}
|
9
|
+
{%- if ('mysql' in pillar['roles']) %}
|
6
10
|
- railsapp.mysql_database
|
7
11
|
{%- endif %}
|
data/salt/scm/bazaar.sls
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
[core]
|
2
|
+
autocrlf=input
|
3
|
+
safecrlf=true
|
4
|
+
# Thanks to http://git.or.cz/gitwiki/Aliases
|
5
|
+
[alias]
|
6
|
+
ci = commit
|
7
|
+
co = checkout
|
8
|
+
st = status
|
9
|
+
br = branch
|
10
|
+
me = merge
|
11
|
+
# usage: git chmod +x file,...
|
12
|
+
chmod=update-index --chmod
|
13
|
+
staged = diff --cached
|
14
|
+
unstaged = diff
|
15
|
+
both = diff HEAD
|
16
|
+
oneline = log --oneline
|
17
|
+
abbrev = rev-parse --short
|
18
|
+
nmm = branch -a --no-merged master
|
19
|
+
nmr = branch -a --no-merged release_candidate
|
20
|
+
nme = branch -a --no-merged edge
|
21
|
+
merge-no-ff = merge --no-ff
|
22
|
+
edit-unmerged = "!fgit() { git ls-files --unmerged | cut -f2 | sort -u ; }; gvim `fgit`"
|
23
|
+
add-unmerged = "!fgit() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `fgit`"
|
24
|
+
[color]
|
25
|
+
branch = auto
|
26
|
+
diff = auto
|
27
|
+
interactive = auto
|
28
|
+
status = auto
|
29
|
+
[log]
|
30
|
+
decorate = short
|
31
|
+
[gui]
|
32
|
+
spellingdictionary = en_GB
|
33
|
+
[push]
|
34
|
+
# later versions have simple - push only the current branch to the one that git pull would pull from (use --all for all branches when pulling or pushing)
|
35
|
+
# git on LTS ubuntu doesn't have it
|
36
|
+
default = matching
|
37
|
+
[merge]
|
38
|
+
# Show what we are changing from as well as the two options
|
39
|
+
conflictstyle = diff3
|
40
|
+
[diff]
|
41
|
+
# match on unique lines first so we are less likely to get weird diffs matching lines with just braces etc
|
42
|
+
algorithm = patience
|
@@ -0,0 +1,21 @@
|
|
1
|
+
git:
|
2
|
+
pkg.installed:
|
3
|
+
- pkgs:
|
4
|
+
- git
|
5
|
+
{%- if 'gui' in pillar['roles'] %}
|
6
|
+
- git-gui
|
7
|
+
- gitk
|
8
|
+
- qgit
|
9
|
+
{%- endif %}
|
10
|
+
file.managed:
|
11
|
+
- source: salt://scm/git/gitconfig
|
12
|
+
- name: {{ pillar['homedir'] }}/.gitconfig
|
13
|
+
- user: {{ pillar['username'] }}
|
14
|
+
- group: {{ pillar['username'] }}
|
15
|
+
- template: jinja
|
16
|
+
- replace: false
|
17
|
+
- mode: 644
|
18
|
+
- require:
|
19
|
+
- pkg: git
|
20
|
+
|
21
|
+
# consider git-web, but may need to force www.nginx to make sure apache doesnt get loaded
|
data/salt/scm/init.sls
ADDED
@@ -1,17 +1,29 @@
|
|
1
1
|
base:
|
2
2
|
'*':
|
3
3
|
- apt.partner-sources
|
4
|
-
- vagrant.minion
|
5
4
|
- apt.unwanted
|
5
|
+
- apt.load_packages
|
6
|
+
- vagrant.minion
|
6
7
|
- www.users
|
7
|
-
-
|
8
|
-
-
|
8
|
+
- utils
|
9
|
+
- crons
|
10
|
+
- net.hosts
|
11
|
+
- net.ntp
|
12
|
+
- net.ufw
|
13
|
+
- scm
|
9
14
|
- editors.vim
|
10
|
-
- sysutils.tmux
|
11
|
-
{%- if 'app' in pillar['roles'] %}
|
12
|
-
- databases.client
|
13
15
|
- lang.ruby
|
16
|
+
{%- if ('ruby' in pillar['versions']) %}
|
17
|
+
- lang.rbenv
|
14
18
|
- railsapp
|
19
|
+
{%- endif %}
|
20
|
+
- lang.php
|
21
|
+
{%- if ('php' in pillar['versions']) %}
|
22
|
+
- lang.phpenv
|
23
|
+
{%- endif %}
|
24
|
+
#- lang.java # - require if we load jenv or java programs
|
25
|
+
{%- if ('java' in pillar['versions']) %}
|
26
|
+
- lang.jenv
|
15
27
|
{%- endif %}
|
16
28
|
{%- if 'web' in pillar['roles'] %}
|
17
29
|
- www.nginx
|
@@ -20,13 +32,16 @@ base:
|
|
20
32
|
- databases
|
21
33
|
{%- endif %}
|
22
34
|
{%- if 'gui' in pillar['roles'] %}
|
23
|
-
|
35
|
+
# lxde
|
36
|
+
- gui.desktop
|
24
37
|
- gui.x2go
|
25
38
|
- editors.gvim
|
26
|
-
- editors.rubymine
|
27
39
|
- www.chromium
|
28
40
|
{%- endif %}
|
29
|
-
{%- if '
|
41
|
+
{%- if 'rubymine' in pillar['versions'] %}
|
42
|
+
- editors.rubymine
|
43
|
+
{%- endif %}
|
44
|
+
{%- if 'teamcity' in pillar['versions'] %}
|
30
45
|
- ci.teamcity
|
31
46
|
{%- endif %}
|
32
47
|
{%- if 'cruisecontrolrb' in pillar['roles'] %}
|
data/salt/utils/file.sls
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Optional packages
|
2
|
+
file:
|
3
|
+
pkg.installed:
|
4
|
+
- pkgs:
|
5
|
+
- gzip
|
6
|
+
- unzip
|
7
|
+
- saidar
|
8
|
+
- less
|
9
|
+
- meld
|
10
|
+
- p7zip
|
11
|
+
- p7zip-full
|
12
|
+
{%- if 'gui' in pillar['roles'] %}
|
13
|
+
- pinta
|
14
|
+
{%- endif %}
|
15
|
+
- unrar-free
|
16
|
+
# Available only in later ubuntu releases?
|
17
|
+
#- p7zip-rar
|
18
|
+
#- rar
|
19
|
+
#- unrar
|
data/salt/utils/html.sls
ADDED
data/salt/utils/init.sls
ADDED
File without changes
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# Thanks http://lukaszwrobel.pl/blog/tmux-tutorial-split-terminal-windows-easily
|
2
|
+
|
3
|
+
# ctrl-A for commads
|
4
|
+
unbind C-b
|
5
|
+
set -g prefix C-a
|
6
|
+
|
7
|
+
# Alt-arrow for switching panes
|
8
|
+
bind -n M-Left select-pane -L
|
9
|
+
bind -n M-Right select-pane -R
|
10
|
+
bind -n M-Up select-pane -U
|
11
|
+
bind -n M-Down select-pane -D
|
12
|
+
|
13
|
+
# Highlight active windows
|
14
|
+
setw -g monitor-activity on
|
15
|
+
set -g visual-activity on
|
16
|
+
|
17
|
+
# highlight current windows (with yello)
|
18
|
+
set-window-option -g window-status-current-bg yellow
|
19
|
+
|
20
|
+
# ctrl-b D - use dev layout
|
21
|
+
bind D source-file ~/.tmux/dev
|
22
|
+
|
23
|
+
# Thanks http://justinlilly.com/dotfiles/tmux.html
|
24
|
+
set -g base-index 1
|
25
|
+
|
26
|
+
set -g history-limit 100000
|
27
|
+
|
28
|
+
unbind r
|
29
|
+
bind-key r source-file ~/.tmux.conf
|
30
|
+
unbind S
|
31
|
+
bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'"
|
32
|
+
unbind |
|
33
|
+
bind-key | split-window -h
|
34
|
+
unbind _
|
35
|
+
bind-key _ split-window -v
|
36
|
+
|
37
|
+
setw -g aggressive-resize on
|
38
|
+
|
39
|
+
set-option -g bell-action any
|
40
|
+
set-option -g visual-bell off
|
41
|
+
|
42
|
+
set-option -g set-titles on
|
43
|
+
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name, active(or not)
|
44
|
+
|
45
|
+
#setw -g mode-mouse on
|
46
|
+
#set-option -g mouse-select-pane on
|
47
|
+
|
48
|
+
# Thanks
|
49
|
+
# http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/
|
50
|
+
|
51
|
+
set -g mode-mouse on
|
52
|
+
set -g mouse-resize-pane on
|
53
|
+
set -g mouse-select-pane on
|
54
|
+
set -g mouse-select-window on
|
55
|
+
|
56
|
+
# Toggle mouse on with ^B m
|
57
|
+
bind m \
|
58
|
+
set -g mode-mouse on \;\
|
59
|
+
set -g mouse-resize-pane on \;\
|
60
|
+
set -g mouse-select-pane on \;\
|
61
|
+
set -g mouse-select-window on \;\
|
62
|
+
display 'Mouse: ON'
|
63
|
+
|
64
|
+
# Toggle mouse off with ^B M
|
65
|
+
bind M \
|
66
|
+
set -g mode-mouse off \;\
|
67
|
+
set -g mouse-resize-pane off \;\
|
68
|
+
set -g mouse-select-pane off \;\
|
69
|
+
set -g mouse-select-window off \;\
|
70
|
+
display 'Mouse: OFF'
|
71
|
+
|
72
|
+
unbind +
|
73
|
+
bind + \
|
74
|
+
new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \;\
|
75
|
+
swap-pane -s tmux-zoom.0 \;\
|
76
|
+
select-window -t tmux-zoom
|
77
|
+
|
78
|
+
unbind -
|
79
|
+
bind - \
|
80
|
+
last-window \;\
|
81
|
+
swap-pane -s tmux-zoom.0 \;\
|
82
|
+
kill-window -t tmux-zoom
|
83
|
+
|
84
|
+
|
85
|
+
# Thanks http://jasonwryan.com/blog/2011/06/07/copy-and-paste-in-tmux/
|
86
|
+
|
87
|
+
unbind p
|
88
|
+
bind p paste-buffer
|
89
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
tmux:
|
2
|
+
pkg:
|
3
|
+
- installed
|
4
|
+
file.directory:
|
5
|
+
- name: {{ pillar['homedir'] }}/.tmux
|
6
|
+
- user: {{ pillar['username'] }}
|
7
|
+
- group: {{ pillar['username'] }}
|
8
|
+
- mode: 755
|
9
|
+
- require_in:
|
10
|
+
- pkg: tmux
|
11
|
+
|
12
|
+
tmux-conf:
|
13
|
+
file.managed:
|
14
|
+
- name: {{ pillar['homedir'] }}/.tmux.conf
|
15
|
+
- source: salt://utils/tmux/home/tmux.conf
|
16
|
+
- user: {{ pillar['username'] }}
|
17
|
+
- group: {{ pillar['username'] }}
|
18
|
+
#- template: jinja
|
19
|
+
- mode: 644
|
20
|
+
- require:
|
21
|
+
- pkg: tmux
|
22
|
+
|
23
|
+
tmux-dev:
|
24
|
+
file.managed:
|
25
|
+
- name: {{ pillar['homedir'] }}/.tmux/dev
|
26
|
+
- source: salt://utils/tmux/home/tmux-dev
|
27
|
+
- user: {{ pillar['username'] }}
|
28
|
+
- group: {{ pillar['username'] }}
|
29
|
+
#- template: jinja
|
30
|
+
- mode: 644
|
31
|
+
- require:
|
32
|
+
- file.directory: tmux
|
data/salt/vagrant/minion.sls
CHANGED
data/salt/www/chromium.sls
CHANGED