Skip to content

Commit 3a04a5b

Browse files
author
Roderik van der Veer
committed
Install Sublime and packages
1 parent dc18e96 commit 3a04a5b

File tree

7 files changed

+131
-47
lines changed

7 files changed

+131
-47
lines changed

README.md

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,71 @@
1-
Role Name
2-
=========
1+
# superlumic-sublimetext
32

4-
A brief description of the role goes here.
3+
Ansible role to install and configure Sublime Text 3 on OSX. This role is part of the Superlumic project that aims to simplify repeat computer setups on OSX, 10.10 and up.
54

6-
Requirements
7-
------------
5+
## Requirements
86

9-
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
7+
* OSX 10.10 or 10.11
108

11-
Role Variables
12-
--------------
9+
## Role variables
1310

14-
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
11+
Minimal set:
1512

16-
Dependencies
17-
------------
13+
```yaml
14+
sublime_packages:
15+
- dest: "Theme - Soda"
16+
repo: "https://github.com/buymeasoda/soda-theme.git"
17+
version: "master"
18+
- dest: "Base16"
19+
repo: "https://github.com/chriskempson/base16-textmate.git"
20+
version: "master"
21+
sublime_text_color_scheme: "Packages/Base16/base16-eighties.dark.tmTheme"
22+
sublime_text_theme: "Soda Dark 3.sublime-theme"
23+
```
1824
19-
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
25+
More extensive set:
2026
21-
Example Playbook
22-
----------------
27+
```yaml
28+
- sublime_packages:
29+
- dest: "SideBarEnhancements"
30+
repo: "https://github.com/titoBouzout/SideBarEnhancements"
31+
version: "st3"
32+
- dest: "GitGutter"
33+
repo: "https://github.com/jisaacks/GitGutter.git"
34+
version: "master"
35+
- dest: "BracketHighlighter"
36+
repo: "https://github.com/facelessuser/BracketHighlighter.git"
37+
version: "master"
38+
- dest: "Theme - Soda"
39+
repo: "https://github.com/buymeasoda/soda-theme.git"
40+
version: "master"
41+
- dest: "Base16"
42+
repo: "https://github.com/chriskempson/base16-textmate.git"
43+
version: "master"
44+
- dest: "ApplySyntax"
45+
repo: "https://github.com/facelessuser/ApplySyntax.git"
46+
version: "master"
47+
- dest: "SublimeAllAutocomplete"
48+
repo: "https://github.com/alienhard/SublimeAllAutocomplete"
49+
version: "master"
50+
- dest: "Ansible"
51+
repo: "https://github.com/clifford-github/sublime-ansible.git"
52+
version: "master"
53+
- sublime_text_color_scheme: "Packages/Base16/base16-eighties.dark.tmTheme"
54+
- sublime_text_theme: "Soda Dark 3.sublime-theme"
55+
```
2356
24-
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
57+
## Dependencies
2558
26-
- hosts: servers
27-
roles:
28-
- { role: username.rolename, x: 42 }
59+
* [roderik.superlumic-homebrew](https://github.com/superlumic/ansible-role-homebrew)
2960
30-
License
31-
-------
61+
# Usage
3262
33-
BSD
63+
Check [Superlumic](https://github.com/superlumic/superlumic) for documentation
3464
35-
Author Information
36-
------------------
65+
# License
3766
38-
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
67+
MIT
68+
69+
# Author
70+
71+
[Roderik van der Veer](mailto:roderik@superlumic.com) - [@r0derik](https://twitter.com/r0derik)

defaults/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
---
22
# defaults file for ansible-role-sublimetext
33

4-
sublime_packages: []
4+
sublime_packages:
5+
- dest: "Theme - Soda"
6+
repo: "https://github.com/buymeasoda/soda-theme.git"
7+
version: "master"
8+
- dest: "Base16"
9+
repo: "https://github.com/chriskempson/base16-textmate.git"
10+
version: "master"
11+
sublime_text_color_scheme: "Packages/Base16/base16-eighties.dark.tmTheme"
12+
sublime_text_theme: "Soda Dark 3.sublime-theme"

handlers/main.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

meta/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
galaxy_info:
33
author: Roderik van der Veer
4-
description: Ansible role to setup Sublime Text 3
4+
description: Ansible role to install and configure Sublime Text 3 on OSX. This role is part of the Superlumic project that aims to simplify repeat computer setups on OSX, 10.10 and up.
55
license: MIT
66
min_ansible_version: 1.2
77
platforms:
@@ -11,4 +11,4 @@ galaxy_info:
1111
categories:
1212
- system
1313
dependencies:
14-
- homebrew
14+
- roderik.superlumic-homebrew

tasks/main.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22

3+
- name: tap caskroom/versions
4+
homebrew_tap: tap=caskroom/versions state=present
5+
36
- name: install sublime text 3
47
homebrew_cask: name=sublime-text3 state=present
58

@@ -9,25 +12,19 @@
912
state: directory
1013
recurse: yes
1114
with_items:
12-
- /Users/{{ lookup('env','USER') }}/Library/Application Support/Sublime Text 3
13-
- /Users/{{ lookup('env','USER') }}/Library/Application Support/Sublime Text 3/Packages
14-
- /Users/{{ lookup('env','USER') }}/Library/Application Support/Sublime Text 3/Packages/User
15-
- /Users/{{ lookup('env','USER') }}/Library/Application Support/Sublime Text 3/Installed Packages
15+
- ~/Library/Application Support/Sublime Text 3
16+
- ~/Library/Application Support/Sublime Text 3/Packages
17+
- ~/Library/Application Support/Sublime Text 3/Packages/User
18+
- ~/Library/Application Support/Sublime Text 3/Installed Packages
1619

1720
- name: download package control
18-
become: yes
1921
get_url:
20-
url: "{{ item.url }}"
21-
dest: "{{ item.dest }}"
22-
owner: root
23-
group: wheel
24-
mode: 0644
25-
with_items:
26-
- {
27-
url: 'http://sublime.wbond.net/Package%20Control.sublime-package',
28-
dest: /Users/{{ lookup('env','USER') }}/Library/Application Support/Sublime Text 3/Installed Packages/Package Control.sublime-package
29-
}
22+
url: "http://sublime.wbond.net/Package%20Control.sublime-package"
23+
dest: "~/Library/Application Support/Sublime Text 3/Installed Packages/Package Control.sublime-package"
3024

31-
- git: update=yes version={{item.version}} repo={{item.repo}} dest=/Users/{{ lookup('env','USER') }}/Library/Application Support/Sublime Text 3/Packages/{{item.dest}}
25+
- name: get and update all sublime plugins
26+
git: update=yes version="{{item.version}}" repo="{{item.repo}}" dest="~/Library/Application Support/Sublime Text 3/Packages/{{item.dest}}"
3227
with_items: sublime_packages
3328

29+
- name: render the sublime config file
30+
template: src=config.j2 dest="~/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings"

templates/config.j2

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"auto_complete": true,
3+
"auto_complete_commit_on_tab": true,
4+
"auto_complete_with_fields": true,
5+
"bold_folder_labels": true,
6+
"caret_style": "phase",
7+
"color_scheme": "{{ sublime_text_color_scheme }}",
8+
"detect_indentation": true,
9+
"draw_white_space": "all",
10+
"ensure_newline_at_eof_on_save": true,
11+
"fade_fold_buttons": false,
12+
"file_exclude_patterns":
13+
[
14+
".DS_Store",
15+
".gitkeep",
16+
"dump.rdb"
17+
],
18+
"folder_exclude_patterns":
19+
[
20+
".svn",
21+
".git",
22+
".hg",
23+
"CVS",
24+
"tmp",
25+
".bundle",
26+
".sass-cache",
27+
"log",
28+
"cache"
29+
],
30+
"font_options":
31+
[
32+
"gray_antialias"
33+
],
34+
"highlight_line": true,
35+
"highlight_modified_tabs": true,
36+
"hot_exit": false,
37+
"ignored_packages":
38+
[
39+
"Vintage"
40+
],
41+
"line_padding_bottom": 1,
42+
"line_padding_top": 1,
43+
"remember_open_files": false,
44+
"save_on_focus_lost": true,
45+
"scroll_past_end": true,
46+
"tab_size": 4,
47+
"theme": "{{ sublime_text_theme }}",
48+
"translate_tabs_to_spaces": true,
49+
"trim_trailing_white_space_on_save": true
50+
}

vars/main.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)