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
@@ -9,18 +9,24 @@ include:
9
9
 
10
10
  cruisecontrolrb-install:
11
11
  git.latest:
12
- - name: https://github.com/thoughtworks/cruisecontrol.rb
12
+ - name: git://github.com/thoughtworks/cruisecontrol.rb
13
13
  - target: {{ pillar['homedir'] }}/local/cruisecontrol.rb
14
14
  - runas: {{ pillar['username'] }}
15
15
  - group: {{ pillar['username'] }}
16
16
  - require:
17
17
  - file.directory: {{ pillar['homedir'] }}/local
18
+ file.managed:
19
+ - name: {{ pillar['homedir'] }}/local/cruisecontrol.rb/.ruby-version
20
+ - user: {{ pillar['username'] }}
21
+ - group: {{ pillar['username'] }}
22
+ - contents: system
18
23
  cmd.run:
19
24
  # Run twice if first fails (weirdness with installing ruby-debug)
20
- - name: {{ pillar['homedir'] }}/.rbenv/shims/bundle install || {{ pillar['homedir'] }}/.rbenv/shims/bundle install
25
+ - name: bundle install --binstubs || bundle install
21
26
  - cwd: {{ pillar['homedir'] }}/local/cruisecontrol.rb
22
- - user: {{ pillar['username'] }}
23
- - group: {{ pillar['username'] }}
27
+ - require:
28
+ - sls: lang.ruby
29
+ - file: cruisecontrolrb-install:
24
30
  - watch:
25
31
  - git: cruisecontrolrb-install
26
32
 
@@ -48,13 +54,13 @@ cruisecontrolrb-fix-home:
48
54
  - watch:
49
55
  - cmd: cruisecontrolrb-create-service
50
56
 
51
- cruisecontrolrb-fix-shebang:
52
- file.sed:
53
- - name: /etc/init.d/cruise
54
- - before: '#!/usr/bin/env.*'
55
- - after: '#!{{ pillar['homedir'] }}/.rbenv/shims/ruby'
56
- - watch:
57
- - cmd: cruisecontrolrb-create-service
57
+ #cruisecontrolrb-fix-shebang:
58
+ # file.sed:
59
+ # - name: /etc/init.d/cruise
60
+ # - before: '#!/usr/bin/env.*'
61
+ # - after: '#!{{ pillar['homedir'] }}/.rbenv/shims/ruby'
62
+ # - watch:
63
+ # - cmd: cruisecontrolrb-create-service
58
64
 
59
65
  cruisecontrolrb-register-service:
60
66
  cmd.run:
@@ -1,15 +1,15 @@
1
1
  #!/bin/sh
2
2
  # /etc/init.d/teamcity - startup script for teamcity
3
- export TEAMCITY_DATA_PATH="/var/TeamCity/.BuildServer"
4
- . /etc/profile.d/java.sh
3
+ export TEAMCITY_DATA_PATH="{{ pillar['homedir'] }}/local/TeamCity-{{ pillar['versions']['teamcity'] }}/.BuildServer"
4
+ /etc/profile.d/java.sh
5
5
 
6
6
  case $1 in
7
7
  start)
8
- start-stop-daemon --start -c www-data --exec /var/TeamCity/bin/runAll.sh start
8
+ start-stop-daemon --start -c {{ pillar['username'] }} --exec {{ pillar['homedir'] }}/local/TeamCity-{{ pillar['versions']['teamcity'] }}/bin/runAll.sh start
9
9
  ;;
10
10
 
11
11
  stop)
12
- start-stop-daemon --start -c www-data --exec /var/TeamCity/bin/runAll.sh stop
12
+ start-stop-daemon --start -c {{ pillar['username'] }} --exec {{ pillar['homedir'] }}/local/TeamCity-{{ pillar['versions']['teamcity'] }}/bin/runAll.sh stop
13
13
  ;;
14
14
 
15
15
  esac
@@ -1,38 +1,37 @@
1
1
  include:
2
2
  - lang.java
3
- - www.users
4
3
 
5
4
  teamcity-download:
6
5
  file.directory:
7
- - name: /tmp/TeamCity
6
+ - name: {{ pillar['homedir'] }}/tmp/teamcity
8
7
  - makedirs: True
9
- - user: www-data
10
- - group: www-data
11
- - require:
12
- - sls: www.users
8
+ - user: {{ pillar['username'] }}
9
+ - group: {{ pillar['username'] }}
13
10
  cmd.run:
14
- - name: wget -c http://download.jetbrains.com/teamcity/TeamCity-{{ pillar['teamcity-version'] }}.tar.gz
15
- - unless: test -d /var/TeamCity/bin
16
- - cwd: /tmp
17
- - user: www-data
18
- - group: www-data
11
+ - name: wget -nv -c http://download.jetbrains.com/teamcity/TeamCity-{{ pillar['versions']['teamcity'] }}.tar.gz
12
+ - unless: test -d {{ pillar['homedir'] }}/local/TeamCity-{{ pillar['versions']['teamcity'] }}/bin
13
+ - cwd: {{ pillar['homedir'] }}/tmp/teampcity
14
+ - user: {{ pillar['username'] }}
15
+ - group: {{ pillar['username'] }}
16
+ - unless: test -d {{ pillar['homedir'] }}/local/TeamCity-{{ pillar['versions']['teamcity'] }}/bin
19
17
  - require:
20
18
  - file.directory: teamcity-download
21
19
 
22
20
  teamcity-extract:
23
21
  cmd.run:
24
- - name: tar xfz /tmp/TeamCity-{{ pillar['teamcity-version'] }}.tar.gz
25
- - cwd: /tmp/TeamCity
26
- - user: www-data
27
- - group: www-data
22
+ - name: tar xfz /tmp/TeamCity-{{ pillar['versions']['teamcity'] }}.tar.gz
23
+ - cwd: {{ pillar['homedir'] }}/tmp/teampcity
24
+ - user: {{ pillar['username'] }}
25
+ - group: {{ pillar['username'] }}
26
+ - unless: test -d {{ pillar['homedir'] }}/local/TeamCity-{{ pillar['versions']['teamcity'] }}/bin
28
27
  - require:
29
28
  - cmd: teamcity-download
30
29
 
31
30
  teamcity-install:
32
31
  cmd.run:
33
- - name: rm -rf /var/TeamCity && mv /tmp/TeamCity/* /var/TeamCity && rm -fr /tmp/TeamCity
34
- - cwd: /tmp
35
- - unless: test -d /var/TeamCity/bin
32
+ - name: mv TeamCity-* ../../TeamCity-{{ pillar['versions']['teamcity'] }}
33
+ - cwd: {{ pillar['homedir'] }}/tmp/teampcity
34
+ - unless: test -d {{ pillar['homedir'] }}/local/TeamCity-{{ pillar['versions']['teamcity'] }}/bin
36
35
  - require:
37
36
  - cmd: teamcity-extract
38
37
 
@@ -55,4 +54,5 @@ teamcity:
55
54
  - file: {{ pillar['etc_dir'] }}/init.d/teamcity
56
55
  require:
57
56
  - file: teamcity-setup-service
57
+ - sls:lang.java
58
58
 
@@ -1,6 +1,6 @@
1
1
  # include
2
- include:
3
- - users
2
+ #include:
3
+ # - users
4
4
 
5
5
  # cron.present
6
6
  date > /tmp/croncheck:
@@ -1,19 +1,50 @@
1
1
 
2
2
  include:
3
- # MySQL
4
- {%- if ('mysql' in pillar['gems']) or ('mysql2' in pillar['gems']) %}
3
+ {%- if ('mysql' in pillar['roles']) %}
5
4
  - databases.mysql
6
5
  - databases.phpmyadmin
7
6
  {%- endif %}
8
- # PostgreSQL - TODO main alternative to mysql
9
- # MongoDB - TODO Document database
10
- # CouchDB - TODO json web distributed db
11
- # Redis - TODO key value store
12
- # Riak - TODO Distributed fault tolerant DB
13
- # RabbitMQ - TODO message broker software
14
- # Memcached - TODO Memory cache
15
- # Cassandra - TODO distributed database management system
16
- # Neo4J - TODO Graph database
17
- # ElasticSearch - TODO search and analytics engine
18
- # Kestrel - TODO light-weight persistent message queue
19
- # SQLite3 - Included by default
7
+ {%- if ('postgresql' in pillar['roles']) %}
8
+ - databases.postgresql
9
+ {%- endif %}
10
+ #{%- if ('sqllite3' in pillar['roles']) %}
11
+ # # SQLite3 - Included by default
12
+ - databases.sqlite3
13
+ {%- if 'gui' in pillar['roles'] %}
14
+ - databases.sqlitebrowser
15
+ {%- endif %}
16
+ #{%- endif %}
17
+
18
+ # TODO: when I need them:
19
+
20
+ #{%- if ('memcached' in pillar['roles']) %}
21
+ # # Memcached - TODO Memory cache
22
+ #{%- endif %}
23
+
24
+ #{%- if ('mongodb' in pillar['roles']) %}
25
+ # # MongoDB - TODO Document database
26
+ #{%- endif %}
27
+ #{%- if ('couchdb' in pillar['roles']) %}
28
+ # # CouchDB - TODO json web distributed db
29
+ #{%- endif %}
30
+ #{%- if ('redis' in pillar['roles']) %}
31
+ # # Redis - TODO key value store
32
+ #{%- endif %}
33
+ #{%- if ('riak' in pillar['roles']) %}
34
+ # # Riak - TODO Distributed fault tolerant DB
35
+ #{%- endif %}
36
+ #{%- if ('rabbitmq' in pillar['roles']) %}
37
+ # # RabbitMQ - TODO message broker software
38
+ #{%- endif %}
39
+ #{%- if ('cassandra' in pillar['roles']) %}
40
+ # # Cassandra - TODO distributed database management system
41
+ #{%- endif %}
42
+ #{%- if ('neo4j' in pillar['roles']) %}
43
+ # # Neo4J - TODO Graph database
44
+ #{%- endif %}
45
+ #{%- if ('elasticsearch' in pillar['roles']) %}
46
+ # # ElasticSearch - TODO search and analytics engine
47
+ #{%- endif %}
48
+ #{%- if ('kestrel' in pillar['roles']) %}
49
+ # # Kestrel - TODO light-weight persistent message queue
50
+ #{%- endif %}
@@ -3,7 +3,7 @@ include :
3
3
 
4
4
  mysql-client:
5
5
  pkg.installed:
6
- - name: {{ "mysql-client" if pillar["mysql-version"] is not defined else "mysql-client-%s" % pillar["mysql-version"] }}
6
+ - name: {{ "mysql-client" if pillar["versions"]["mysql"] is not defined else "mysql-client-%s" % pillar["versions"]["mysql"] }}
7
7
 
8
8
  /etc/mysql/conf.d/client-encoding-and-collation.cnf:
9
9
  file.managed:
@@ -2,21 +2,21 @@ mysql-common:
2
2
  pkg.installed:
3
3
  - name: mysql-common
4
4
 
5
- /etc/mysql:
5
+ /etc/mysql/conf.d:
6
6
  file.directory:
7
7
  - user: root
8
8
  - group: root
9
9
  - mode: 0755
10
10
  - clear: True
11
11
  - require:
12
- - file: /etc/mysql/conf.d
13
12
  - pkg: mysql-common
14
13
 
15
- /etc/mysql/conf.d:
14
+ /etc/mysql:
16
15
  file.directory:
17
16
  - user: root
18
17
  - group: root
19
18
  - mode: 0755
20
19
  - clear: True
21
20
  - require:
21
+ - file: /etc/mysql/conf.d
22
22
  - pkg: mysql-common
@@ -51,7 +51,7 @@ include:
51
51
 
52
52
  mysql-server:
53
53
  pkg.installed:
54
- - name: {{ "mysql-server" if pillar["mysql-version"] is not defined else "mysql-server-%s" % pillar["mysql-version"] }}
54
+ - name: {{ "mysql-server" if pillar["versions"]["mysql"] is not defined else "mysql-server-%s" % pillar["versions"]["mysql"] }}
55
55
  service.running:
56
56
  - name: mysql
57
57
  - require:
@@ -0,0 +1,47 @@
1
+
2
+ databases-packages:
3
+ pkg.installed:
4
+ - pkgs:
5
+ {%- if ('mysql' in pillar['roles']) %}
6
+ - libmysqlclient-dev
7
+ {%- endif %}
8
+ {%- if ('postgresql' in pillar['roles']) %}
9
+ - libpq-dev
10
+ {%- endif %}
11
+
12
+ # TODO: when I need them:
13
+
14
+ #{%- if ('memcached' in pillar['roles']) %}
15
+ # # Memcached - TODO Memory cache
16
+ #{%- endif %}
17
+
18
+ #{%- if ('mongodb' in pillar['roles']) %}
19
+ # # MongoDB - TODO Document database
20
+ #{%- endif %}
21
+ #{%- if ('couchdb' in pillar['roles']) %}
22
+ # # CouchDB - TODO json web distributed db
23
+ #{%- endif %}
24
+ #{%- if ('redis' in pillar['roles']) %}
25
+ # # Redis - TODO key value store
26
+ #{%- endif %}
27
+ #{%- if ('riak' in pillar['roles']) %}
28
+ # # Riak - TODO Distributed fault tolerant DB
29
+ #{%- endif %}
30
+ #{%- if ('rabbitmq' in pillar['roles']) %}
31
+ # # RabbitMQ - TODO message broker software
32
+ #{%- endif %}
33
+ #{%- if ('cassandra' in pillar['roles']) %}
34
+ # # Cassandra - TODO distributed database management system
35
+ #{%- endif %}
36
+ #{%- if ('neo4j' in pillar['roles']) %}
37
+ # # Neo4J - TODO Graph database
38
+ #{%- endif %}
39
+ #{%- if ('elasticsearch' in pillar['roles']) %}
40
+ # # ElasticSearch - TODO search and analytics engine
41
+ #{%- endif %}
42
+ #{%- if ('kestrel' in pillar['roles']) %}
43
+ # # Kestrel - TODO light-weight persistent message queue
44
+ #{%- endif %}
45
+ #{%- if ('sqllite3' in pillar['roles']) %}
46
+ # # SQLite3 - Included by default
47
+ #{%- endif %}
@@ -1,7 +1,3 @@
1
- yerver {
2
- listen 80;
3
- server_name phpmyadmin;
4
- client_max_body_size 20M;
5
1
 
6
2
  location /phpmyadmin {
7
3
  root /usr/share/;
@@ -10,10 +6,18 @@ yerver {
10
6
  location ~ ^/phpmyadmin/(.+\.php)$ {
11
7
  try_files $uri =404;
12
8
  root /usr/share/;
13
- fastcgi_pass 127.0.0.1:9000;
14
- fastcgi_index index.php;
15
9
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
16
10
  include /etc/nginx/fastcgi_params;
11
+
12
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
13
+ # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
14
+ #
15
+ # # With php5-cgi alone:
16
+ # fastcgi_pass 127.0.0.1:9000;
17
+ # # With php5-fpm:
18
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
19
+ fastcgi_index index.php;
20
+ #include fastcgi_params;
17
21
  }
18
22
 
19
23
  location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
@@ -21,4 +25,3 @@ yerver {
21
25
  }
22
26
  }
23
27
 
24
- }
@@ -0,0 +1,5 @@
1
+ postgresql-client:
2
+ pkg.installed:
3
+ - pkgs:
4
+ - libpq-dev
5
+
@@ -0,0 +1,10 @@
1
+ include:
2
+ - databases.postgresql.client
3
+
4
+ postgresql:
5
+ pkg.installed:
6
+ - pkgs:
7
+ - postgresql
8
+ - require:
9
+ - sls: databases.postgresql.client
10
+
@@ -0,0 +1,6 @@
1
+ sqlite3:
2
+ pkg.installed:
3
+ - pkgs:
4
+ - sqlite3
5
+ - libsqlite3-0
6
+ - libsqlite3-dev
@@ -0,0 +1,4 @@
1
+ sqlitebrowser:
2
+ pkg.installed:
3
+ - pkgs:
4
+ - sqlitebrowser
@@ -1,5 +1,9 @@
1
+ include:
2
+ - gui.desktop
3
+ - editors.vim
1
4
 
2
5
  gvim:
3
6
  pkg.installed:
4
7
  - name: vim-gtk
5
-
8
+ - require:
9
+ - sls: gui.desktop
@@ -1,41 +1,41 @@
1
1
  include:
2
2
  - lang.java
3
3
 
4
- {{ pillar['homedir'] }}/local/tmp:
4
+
5
+ rubymine-download:
5
6
  file.directory:
7
+ - name: {{ pillar['homedir'] }}/local/tmp/rubymine
6
8
  - makedirs: True
7
9
  - clean: True
8
10
  - user: {{ pillar['username'] }}
9
11
  - group: {{ pillar['username'] }}
10
-
11
- rubymine-download:
12
12
  cmd.run:
13
- - name: wget -c http://download.jetbrains.com/ruby/RubyMine-{{ pillar['rubymine-version'] }}.tar.gz
13
+ - name: wget -nv -c http://download.jetbrains.com/ruby/RubyMine-{{ pillar['versions']['rubymine'] }}.tar.gz
14
14
  - cwd: {{ pillar['homedir'] }}/local
15
15
  - user: {{ pillar['username'] }}
16
16
  - group: {{ pillar['username'] }}
17
- - unless: [ -d {{ pillar['homedir'] }}/local/RubyMine-{{ pillar['rubymine-version'] }} ]
17
+ - unless: test -d {{ pillar['homedir'] }}/local/RubyMine-{{ pillar['versions']['rubymine'] }}/bin
18
18
  - require:
19
- - file.directory: {{ pillar['homedir'] }}/local/tmp
19
+ - file.directory: rubymine-download
20
20
 
21
21
  rubymine-extract:
22
22
  cmd.run:
23
- - name: tar xfz ../RubyMine-{{ pillar['rubymine-version'] }}.tar.gz
24
- - cwd: {{ pillar['homedir'] }}/local/tmp
23
+ - name: tar xfz ../RubyMine-{{ pillar['versions']['rubymine'] }}.tar.gz
24
+ - cwd: {{ pillar['homedir'] }}/local/tmp/rubymine
25
25
  - user: {{ pillar['username'] }}
26
26
  - group: {{ pillar['username'] }}
27
- - unless: [ -d ../RubyMine-{{ pillar['rubymine-version'] }} ]
27
+ - unless: test -d {{ pillar['homedir'] }}/local/RubyMine-{{ pillar['versions']['rubymine'] }}/bin
28
28
  - require:
29
29
  - cmd: rubymine-download
30
30
 
31
31
  # The tar file contains extra version numbers in its top directory
32
- rubymine-rename:
32
+ rubymine-install:
33
33
  cmd.run:
34
- - name: mv RubyMine-* ../RubyMine-{{ pillar['rubymine-version'] }}
35
- - cwd: {{ pillar['homedir'] }}/local/tmp
34
+ - name: mv RubyMine-* ../../RubyMine-{{ pillar['versions']['rubymine'] }}
35
+ - cwd: {{ pillar['homedir'] }}/local/tmp/rubymine
36
36
  - user: {{ pillar['username'] }}
37
37
  - group: {{ pillar['username'] }}
38
- - unless: [ -d ../RubyMine-{{ pillar['rubymine-version'] }} ]
38
+ - unless: test -d {{ pillar['homedir'] }}/local/RubyMine-{{ pillar['versions']['rubymine'] }}/bin
39
39
  - require:
40
40
  - cmd: rubymine-extract
41
41
 
@@ -45,7 +45,7 @@ rubymine-adjust_profile:
45
45
  - user: {{ pillar['username'] }}
46
46
  - group: {{ pillar['username'] }}
47
47
  - text:
48
- - export PATH="{{ pillar['homedir'] }}/RubyMine-{{ pillar['rubymine-version'] }}/bin:$PATH"
49
- - require:
50
- - cmd: rubymine-rename
48
+ - export PATH="{{ pillar['homedir'] }}/RubyMine-{{ pillar['versions']['rubymine'] }}/bin:$PATH"
49
+ #- require:
50
+ # - cmd: rubymine-rename
51
51
 
@@ -1,8 +1,6 @@
1
1
  vim:
2
2
  pkg.installed:
3
3
  - name: vim
4
-
5
- vim_alternatives:
6
4
  cmd.wait:
7
5
  - names:
8
6
  - update-alternatives --set editor vim
@@ -10,3 +8,74 @@ vim_alternatives:
10
8
  - pkg: vim
11
9
  - watch:
12
10
  - pkg: vim
11
+ file.managed:
12
+ - source: salt://editors/vim/vimrc
13
+ - name: {{ pillar['homedir'] }}/.vimrc
14
+ - user: {{ pillar['username'] }}
15
+ - group: {{ pillar['username'] }}
16
+ - template: jinja
17
+ - replace: false
18
+ - mode: 644
19
+ - require:
20
+ - pkg: vim
21
+
22
+ vim-pathogen:
23
+ file.directory:
24
+ - name: {{ pillar['homedir'] }}/.vim/autoload
25
+ - user: {{ pillar['username'] }}
26
+ - group: {{ pillar['username'] }}
27
+ - mode: 775
28
+ - makedirs: True
29
+ - require:
30
+ - pkg: vim
31
+ cmd.run:
32
+ - name: curl -Sso {{ pillar['homedir'] }}/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
33
+ - user: {{ pillar['username'] }}
34
+ - group: {{ pillar['username'] }}
35
+ - require:
36
+ - file.directory: vim-pathogen
37
+
38
+ vim-bundle:
39
+ file.directory:
40
+ - name: {{ pillar['homedir'] }}/.vim/bundle
41
+ - user: {{ pillar['username'] }}
42
+ - group: {{ pillar['username'] }}
43
+ - mode: 775
44
+ - makedirs: True
45
+ - require:
46
+ - pkg: vim
47
+
48
+ vim-rails:
49
+ git.latest:
50
+ - name: git://github.com/tpope/vim-rails.git
51
+ - runas: {{ pillar['username'] }}
52
+ - group: {{ pillar['username'] }}
53
+ - rev: master
54
+ - target: {{ pillar['homedir'] }}/.vim/bundle/vim-rails
55
+ - force: True
56
+ - require:
57
+ - file.directory: vim-bundle
58
+
59
+ vim-bundler:
60
+ git.latest:
61
+ - name: git://github.com/tpope/vim-bundler.git
62
+ - runas: {{ pillar['username'] }}
63
+ - group: {{ pillar['username'] }}
64
+ - rev: master
65
+ - target: {{ pillar['homedir'] }}/.vim/bundle/vim-bundler
66
+ - force: True
67
+ - require:
68
+ - file.directory: vim-bundle
69
+
70
+ vim-NERDtree:
71
+ git.latest:
72
+ - name: git://github.com/scrooloose/nerdtree.git
73
+ - runas: {{ pillar['username'] }}
74
+ - group: {{ pillar['username'] }}
75
+ - rev: master
76
+ - target: {{ pillar['homedir'] }}/.vim/bundle/nerdtree
77
+ - force: True
78
+ - require:
79
+ - file.directory: vim-bundle
80
+
81
+