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.
Files changed (90) hide show
  1. data/README.md +7 -0
  2. data/lib/salted-rails/config.rb +71 -55
  3. data/lib/salted-rails/helper_base.rb +15 -0
  4. data/lib/salted-rails/vagrant_helper.rb +15 -9
  5. data/lib/salted-rails/version.rb +1 -1
  6. data/pillar/capistrano/top.sls +1 -1
  7. data/pillar/common.sls +1 -8
  8. data/pillar/vagrant/top.sls +1 -1
  9. data/salt/apt/load_packages.sls +5 -0
  10. data/salt/apt/update_packages.sls +5 -0
  11. data/salt/bin/change_mirror.sh +10 -6
  12. data/salt/bin/misc_fixes.sh +26 -0
  13. data/salt/bin/provision +40 -3
  14. data/salt/ci/cruisecontrolrb.sls +17 -11
  15. data/salt/ci/teamcity/etc/init.d/teamcity +4 -4
  16. data/salt/ci/teamcity/init.sls +18 -18
  17. data/salt/crons/init.sls +2 -2
  18. data/salt/databases/init.sls +45 -14
  19. data/salt/databases/mysql/client.sls +1 -1
  20. data/salt/databases/mysql/common.sls +3 -3
  21. data/salt/databases/mysql/server.sls +1 -1
  22. data/salt/databases/packages.sls +47 -0
  23. data/salt/databases/phpmyadmin/etc/nginx/admin.d/phpmyadmin.conf +10 -7
  24. data/salt/databases/postgresql/client.sls +5 -0
  25. data/salt/databases/postgresql/init.sls +10 -0
  26. data/salt/databases/sqlite3.sls +6 -0
  27. data/salt/databases/sqlitebrowser.sls +4 -0
  28. data/salt/editors/gvim.sls +5 -1
  29. data/salt/editors/rubymine.sls +16 -16
  30. data/salt/editors/vim/init.sls +71 -2
  31. data/salt/editors/vim/vimrc +8 -1
  32. data/salt/gui/desktop.sls +9 -0
  33. data/salt/gui/x2go.sls +5 -0
  34. data/salt/lang/jenv.sls +64 -0
  35. data/salt/lang/php/etc/php5/fpm/pool.d/www.conf +2 -2
  36. data/salt/lang/phpenv.sls +82 -0
  37. data/salt/lang/rbenv.sls +115 -0
  38. data/salt/lang/ruby.sls +24 -37
  39. data/salt/munin/nginx.sls +3 -1
  40. data/salt/munin/node.sls +2 -1
  41. data/salt/munin/php5-fpm.sls +3 -1
  42. data/salt/net/hosts.sls +9 -0
  43. data/salt/net/ntp.sls +6 -0
  44. data/salt/net/ufw.sls +8 -0
  45. data/salt/railsapp/gems.sls +5 -3
  46. data/salt/railsapp/init.sls +6 -2
  47. data/salt/scm/bazaar.sls +10 -0
  48. data/salt/scm/git/gitconfig +42 -0
  49. data/salt/scm/git/init.sls +21 -0
  50. data/salt/scm/init.sls +5 -0
  51. data/salt/scm/mercurial.sls +10 -0
  52. data/salt/scm/subversion.sls +6 -0
  53. data/salt/{vagrant/top.sls → top.sls} +24 -9
  54. data/salt/utils/file.sls +19 -0
  55. data/salt/utils/html.sls +5 -0
  56. data/salt/utils/init.sls +6 -0
  57. data/salt/{sysutils → utils}/net.sls +4 -0
  58. data/salt/{sysutils → utils}/status.sls +0 -0
  59. data/salt/utils/tmux/home/tmux-dev +7 -0
  60. data/salt/utils/tmux/home/tmux.conf +89 -0
  61. data/salt/utils/tmux/init.sls +32 -0
  62. data/salt/vagrant/minion.sls +1 -1
  63. data/salt/www/chromium.sls +5 -0
  64. data/salt/www/nginx/etc/nginx/admin.d/doc.conf +7 -0
  65. data/salt/www/nginx/etc/nginx/admin.d/nginx_status.conf +7 -0
  66. data/salt/www/nginx/etc/nginx/sites-available/.gitignore +3 -0
  67. data/salt/www/nginx/etc/nginx/sites-available/admin.conf +47 -0
  68. data/salt/www/nginx/init.sls +102 -16
  69. data/salt/www/nginx/srv/www/admin/favicon.ico +0 -0
  70. data/salt/www/nginx/srv/www/admin/favicon.png +0 -0
  71. data/salt/www/nginx/srv/www/admin/index.php +67 -0
  72. data/salt/www/nginx/srv/www/admin/phpinfo.php +3 -0
  73. data/salt/www/nginx/srv/www/admin/robots.txt +2 -0
  74. data/salt/www/users.sls +0 -9
  75. metadata +41 -20
  76. data/salt/bin/fix_hostname.sh +0 -6
  77. data/salt/capistrano/deploy_requirements.sls +0 -5
  78. data/salt/capistrano/top.sls +0 -4
  79. data/salt/databases/client.sls +0 -18
  80. data/salt/databases/server.sls +0 -19
  81. data/salt/gui/init.sls +0 -3
  82. data/salt/lang/ruby.sls.bak +0 -106
  83. data/salt/lang/system_ruby.sls +0 -43
  84. data/salt/sysutils/file.sls +0 -8
  85. data/salt/sysutils/init.sls +0 -5
  86. data/salt/sysutils/tmux.sls +0 -3
  87. data/salt/www/admin/etc/nginx/nginx.conf +0 -53
  88. data/salt/www/admin/etc/nginx/sites-available/.gitignore +0 -3
  89. data/salt/www/admin/etc/nginx/sites-available/phpmyadmin.conf +0 -7
  90. data/salt/www/admin/init.sls +0 -31
@@ -1,4 +1,11 @@
1
- " source $VIMRUNTIME/mswin.vim
1
+ execute pathogen#infect()
2
+
3
+ map <C-n> :NERDTreeToggle<CR>
4
+ " open a NERDTree automatically when vim starts up if no files were specified
5
+ " autocmd vimenter * if !argc() | NERDTree | endif
6
+ "
7
+ source $VIMRUNTIME/mswin.vim
8
+
2
9
  if has("gui_running")
3
10
  colorscheme murphy
4
11
  else
@@ -0,0 +1,9 @@
1
+ include:
2
+ - gui.lxde
3
+
4
+ desktop:
5
+ cmd.run:
6
+ - name: 'true'
7
+ - require:
8
+ - sls: gui.lxde
9
+
@@ -1,3 +1,6 @@
1
+ include:
2
+ - gui.desktop
3
+
1
4
  x2go:
2
5
  pkgrepo.managed:
3
6
  - humanname: X2Go PPA repository
@@ -8,6 +11,8 @@ x2go:
8
11
  - x2goserver-xsession
9
12
  - require:
10
13
  - pkgrepo: x2go
14
+ - sls: gui.desktop
15
+
11
16
  file.sed:
12
17
  - name: /etc/ssh/sshd_config
13
18
  - before: ^HostKey /etc/ssh/ssh_host_ecdsa_key
@@ -0,0 +1,64 @@
1
+ include:
2
+ - scm
3
+
4
+ jenv_deps:
5
+ pkg.installed:
6
+ - names:
7
+ - build-essential
8
+ - openssl
9
+ - curl
10
+ - zlib1g
11
+ - zlib1g-dev
12
+ - libssl-dev
13
+ - libyaml-dev
14
+ - libsqlite3-0
15
+ - libsqlite3-dev
16
+ - sqlite3
17
+ - libxml2-dev
18
+ - libxslt1-dev
19
+ - autoconf
20
+ - libc6-dev
21
+ - libncurses5-dev
22
+ - automake
23
+ - libtool
24
+ - bison
25
+
26
+ #
27
+ # jenv and java-build installation
28
+ #
29
+
30
+ #{{ pillar['homedir'] }}/.jenv:
31
+ # file.directory:
32
+ # - user: {{ pillar['username'] }}
33
+ # - group: {{ pillar['username'] }}
34
+ # - makedirs: True
35
+
36
+ jenv:
37
+ git.latest:
38
+ - name: git://github.com/gcuisinier/jenv
39
+ - runas: {{ pillar['username'] }}
40
+ - group: {{ pillar['username'] }}
41
+ - rev: master
42
+ - target: {{ pillar['homedir'] }}/.jenv
43
+ - force: True
44
+ - require:
45
+ - pkg: jenv_deps
46
+ file.append:
47
+ - name: {{ pillar['homedir'] }}/.profile
48
+ - user: {{ pillar['username'] }}
49
+ - group: {{ pillar['username'] }}
50
+ - text:
51
+ - export PATH="$HOME/.jenv/bin:$PATH"
52
+ - eval "$(jenv init -)"
53
+ - require:
54
+ - git: jenv
55
+
56
+ jenv-rehash:
57
+ cmd.run:
58
+ - name: {{ pillar['homedir'] }}/.jenv/bin/jenv rehash
59
+ - user: {{ pillar['username'] }}
60
+ - group: {{ pillar['username'] }}
61
+ - require:
62
+ - file: jenv
63
+
64
+ # Install java manually at this point!
@@ -30,8 +30,8 @@ group = www-data
30
30
  ; specific port;
31
31
  ; '/path/to/unix/socket' - to listen on a unix socket.
32
32
  ; Note: This value is mandatory.
33
- ; listen = /var/run/php5-fpm.sock
34
- listen = 127.0.0.1:9000
33
+ listen = /var/run/php5-fpm.sock
34
+ ; listen = 127.0.0.1:9000
35
35
 
36
36
  ; Set listen(2) backlog.
37
37
  ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
@@ -0,0 +1,82 @@
1
+ include:
2
+ - scm
3
+
4
+ phpenv_deps:
5
+ pkg.installed:
6
+ - names:
7
+ - build-essential
8
+ - openssl
9
+ - curl
10
+ - zlib1g
11
+ - zlib1g-dev
12
+ - libssl-dev
13
+ - libyaml-dev
14
+ - libsqlite3-0
15
+ - libsqlite3-dev
16
+ - sqlite3
17
+ - libxml2-dev
18
+ - libxslt1-dev
19
+ - autoconf
20
+ - libc6-dev
21
+ - libncurses5-dev
22
+ - automake
23
+ - libtool
24
+ - bison
25
+
26
+ #
27
+ # phpenv and php-build installation
28
+ #
29
+
30
+ #{{ pillar['homedir'] }}/.phpenv:
31
+ # file.directory:
32
+ # - user: {{ pillar['username'] }}
33
+ # - group: {{ pillar['username'] }}
34
+ # - makedirs: True
35
+
36
+ phpenv:
37
+ git.latest:
38
+ - name: git://github.com/phpenv/phpenv.git
39
+ - runas: {{ pillar['username'] }}
40
+ - group: {{ pillar['username'] }}
41
+ - rev: master
42
+ - target: {{ pillar['homedir'] }}/.phpenv
43
+ - force: True
44
+ - require:
45
+ - pkg: phpenv_deps
46
+ file.append:
47
+ - name: {{ pillar['homedir'] }}/.profile
48
+ - user: {{ pillar['username'] }}
49
+ - group: {{ pillar['username'] }}
50
+ - text:
51
+ - export PATH="$HOME/.phpenv/bin:$PATH"
52
+ - eval "$(phpenv init -)"
53
+ - require:
54
+ - git: phpenv
55
+
56
+ phpenv-rehash:
57
+ cmd.run:
58
+ - name: {{ pillar['homedir'] }}/.phpenv/bin/phpenv rehash
59
+ - user: {{ pillar['username'] }}
60
+ - group: {{ pillar['username'] }}
61
+ - require:
62
+ - file: phpenv
63
+ {%- if 'php' in pillar['versions'] %}
64
+ - cmd: phpenv-install-php
65
+
66
+ phpenv-install-php:
67
+ cmd.run:
68
+ - name: {{ pillar['homedir'] }}/.phpenv/bin/phpenv install {{ pillar['versions']['php'] }}
69
+ - user: {{ pillar['username'] }}
70
+ - group: {{ pillar['username'] }}
71
+ - require:
72
+ - git: phpenv
73
+
74
+ phpenv-global:
75
+ cmd.run:
76
+ - name: {{ pillar['homedir'] }}/.phpenv/bin/phpenv global {{ pillar['versions']['php'] }}
77
+ - user: {{ pillar['username'] }}
78
+ - group: {{ pillar['username'] }}
79
+ - require:
80
+ - cmd: phpenv-rehash
81
+
82
+ {%- endif %}
@@ -0,0 +1,115 @@
1
+ include:
2
+ - lang.ruby
3
+
4
+ {%- if ('ruby' in pillar['versions']) %}
5
+
6
+ rbenv:
7
+ rbenv.installed:
8
+ - name: {{ pillar['versions']['ruby'] }}
9
+ - default: True
10
+ - runas: {{ pillar['username'] }}
11
+ - group: {{ pillar['username'] }}
12
+ - require:
13
+ - pkg: ruby-deps
14
+
15
+ file.append:
16
+ - name: {{ pillar['homedir'] }}/.profile
17
+ - user: {{ pillar['username'] }}
18
+ - group: {{ pillar['username'] }}
19
+ - text:
20
+ - export PATH="$HOME/.rbenv/bin:$PATH"
21
+ - eval "$(rbenv init -)"
22
+ - require:
23
+ - rbenv.installed: rbenv
24
+ gem.installed:
25
+ - runas: {{ pillar['username'] }}
26
+ - group: {{ pillar['username'] }}
27
+ - names:
28
+ - bundler
29
+ - require:
30
+ - file: rbenv
31
+ cmd.run:
32
+ - name: {{ pillar['homedir'] }}/.rbenv/bin/rbenv rehash
33
+ - user: {{ pillar['username'] }}
34
+ - group: {{ pillar['username'] }}
35
+ - require:
36
+ - gem: rbenv
37
+
38
+ rbenv-gem-rehash:
39
+ git.latest:
40
+ - name: git://github.com/sstephenson/rbenv-gem-rehash
41
+ - runas: {{ pillar['username'] }}
42
+ - group: {{ pillar['username'] }}
43
+ - rev: master
44
+ - target: {{ pillar['homedir'] }}/.rbenv/plugins/rbenv-gem-rehash
45
+ - force: True
46
+ - require:
47
+ - rbenv: rbenv
48
+
49
+ rbenv-update:
50
+ git.latest:
51
+ - name: git://github.com/rkh/rbenv-update
52
+ - runas: {{ pillar['username'] }}
53
+ - group: {{ pillar['username'] }}
54
+ - rev: master
55
+ - target: {{ pillar['homedir'] }}/.rbenv/plugins/rbenv-update
56
+ - force: True
57
+ - require:
58
+ - rbenv: rbenv
59
+
60
+ rbenv-which-ext:
61
+ git.latest:
62
+ - name: git://github.com/yyuu/rbenv-which-ext
63
+ - runas: {{ pillar['username'] }}
64
+ - group: {{ pillar['username'] }}
65
+ - rev: master
66
+ - target: {{ pillar['homedir'] }}/.rbenv/plugins/rbenv-which-ext
67
+ - force: True
68
+ - require:
69
+ - rbenv: rbenv
70
+
71
+ rbenv-binstubs:
72
+ git.latest:
73
+ - name: git://github.com/ianheggie/rbenv-binstubs
74
+ - runas: {{ pillar['username'] }}
75
+ - group: {{ pillar['username'] }}
76
+ - rev: master
77
+ - target: {{ pillar['homedir'] }}/.rbenv/plugins/rbenv-binstubs
78
+ - force: True
79
+ - require:
80
+ - rbenv: rbenv
81
+
82
+ rbenv-env:
83
+ git.latest:
84
+ - name: git://github.com/ianheggie/rbenv-env
85
+ - runas: {{ pillar['username'] }}
86
+ - group: {{ pillar['username'] }}
87
+ - rev: master
88
+ - target: {{ pillar['homedir'] }}/.rbenv/plugins/rbenv-env
89
+ - force: True
90
+ - require:
91
+ - rbenv: rbenv
92
+
93
+ rbenv-whatis:
94
+ git.latest:
95
+ - name: git://github.com/rkh/rbenv-whatis
96
+ - runas: {{ pillar['username'] }}
97
+ - group: {{ pillar['username'] }}
98
+ - rev: master
99
+ - target: {{ pillar['homedir'] }}/.rbenv/plugins/rbenv-whatis
100
+ - force: True
101
+ - require:
102
+ - rbenv: rbenv
103
+
104
+ rbenv-use:
105
+ git.latest:
106
+ - name: git://github.com/rkh/rbenv-use
107
+ - runas: {{ pillar['username'] }}
108
+ - group: {{ pillar['username'] }}
109
+ - rev: master
110
+ - target: {{ pillar['homedir'] }}/.rbenv/plugins/rbenv-use
111
+ - force: True
112
+ - require:
113
+ - rbenv: rbenv
114
+
115
+ {%- endif %}
@@ -1,60 +1,47 @@
1
- #
2
- # ruby deps
3
- #
1
+ include:
2
+ - scm
3
+ - databases.packages
4
4
 
5
- rbenv-deps:
5
+ ruby-deps:
6
6
  pkg.installed:
7
7
  - pkgs:
8
- - autoconf
8
+ - autoconf
9
9
  - automake
10
+ - bash
10
11
  - bison
11
12
  - build-essential
12
- - curl
13
- - git
13
+ - curl
14
14
  - libc6-dev
15
15
  - libcurl4-openssl-dev
16
16
  - libfreeimage3
17
17
  - libfreeimage-dev
18
- - libmysqlclient-dev
19
18
  - libncurses5-dev
19
+ - libreadline6
20
+ - libreadline6-dev
20
21
  - libreadline-dev
21
- - libsqlite3-0
22
- - libsqlite3-dev
23
- - sqlite3
24
- - libssl-dev
22
+ - libssl-dev
25
23
  - libtool
26
- - libxml2-dev
27
- - libxslt1-dev
24
+ - libxml2-dev
25
+ - libxslt1-dev
28
26
  - libyaml-dev
29
27
  - openssl
30
- - python-software-properties
31
- - subversion
28
+ - python-software-properties
32
29
  - zlib1g
33
- - zlib1g-dev
34
-
35
- ruby:
36
- rbenv.installed:
37
- - name: {{ pillar['ruby_version'] }}
38
- - default: True
39
- - runas: {{ pillar['username'] }}
30
+ - zlib1g-dev
40
31
  - require:
41
- - pkg: rbenv-deps
32
+ - pkg: databases-packages
42
33
 
43
- rbenv-adjust_profile:
44
- file.append:
45
- - name: {{ pillar['homedir'] }}/.profile
46
- - user: {{ pillar['username'] }}
47
- - group: {{ pillar['username'] }}
48
- - text:
49
- - export PATH="$HOME/.rbenv/bin:$PATH"
50
- - eval "$(rbenv init -)"
34
+ ruby:
35
+ pkg.installed:
36
+ - pkgs:
37
+ - ruby
38
+ - rubygems
51
39
  - require:
52
- - rbenv.installed: ruby
53
-
54
- base_gems:
40
+ - pkg: ruby-deps
55
41
  gem.installed:
56
- - runas: {{ pillar['username'] }}
57
42
  - names:
58
43
  - bundler
44
+ - rake
59
45
  - require:
60
- - file: rbenv-adjust_profile
46
+ - pkg: ruby
47
+
@@ -4,10 +4,12 @@ munin-nginx-plugins:
4
4
  - source: salt://munin/files/nginx/plugins
5
5
  - name: /etc/munin/plugins
6
6
  - mode: 755
7
+ - exclude_pat: '.*swp'
7
8
 
8
9
  munin-nginx-plugin-conf:
9
10
  file:
10
11
  - recurse
11
12
  - source: salt://munin/files/nginx/plugin-conf.d
12
13
  - name: /etc/munin/plugin-conf.d
13
- - mode: 755
14
+ - mode: 755
15
+ - exclude_pat: '.*swp'
@@ -24,6 +24,7 @@ munin-node-conf:
24
24
  - recurse
25
25
  - source: salt://munin/files/node
26
26
  - name: /etc/munin
27
+ - exclude_pat: '.*swp'
27
28
 
28
29
  # Check Permissions of Plugins to Ensure They Are Executible
29
30
  chmod -R 755 /etc/munin/plugins/:
@@ -31,4 +32,4 @@ chmod -R 755 /etc/munin/plugins/:
31
32
  - run
32
33
  - unless: bash /etc/munin/checkPermissions.sh
33
34
  - require:
34
- - file: core-munin-conf
35
+ - file: core-munin-conf
@@ -4,10 +4,12 @@ munin-php5-fpm-plugins:
4
4
  - source: salt://munin/files/php5-fpm/plugins
5
5
  - name: /etc/munin/plugins
6
6
  - mode: 755
7
+ - exclude_pat: '.*swp'
7
8
 
8
9
  munin-php5-fpm-plugin-conf:
9
10
  file:
10
11
  - recurse
11
12
  - source: salt://munin/files/php5-fpm/plugin-conf.d
12
13
  - name: /etc/munin/plugin-conf.d
13
- - mode: 755
14
+ - mode: 755
15
+ - exclude_pat: '.*swp'
@@ -0,0 +1,9 @@
1
+ # Handle firefox changing localhost to localhost.com then www.localhost.com if it can't connect to a port
2
+ # localhost.localdomain for those used to other systems
3
+
4
+ /etc/hosts:
5
+ file.append:
6
+ - user: root
7
+ - group: root
8
+ - text:
9
+ - 127.0.0.1 localhost localhost.com www.localhost.com localhost.localdomain