Skip to content

Commit

Permalink
Added experimental macOS implementation (#141)
Browse files Browse the repository at this point in the history
This implementation is experimental and not supported at this time.
  • Loading branch information
Eric Miller authored and freemanjp committed Nov 12, 2018
1 parent e17ecd5 commit e61c3da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions tasks/install-homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: install VS Code (brew-cask)
homebrew_cask:
name: visual-studio-code
state: present
2 changes: 1 addition & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: assert supported distribution
assert:
that:
- "ansible_pkg_mgr in ('apt', 'yum', 'dnf', 'zypper')"
- "ansible_pkg_mgr in ('apt', 'yum', 'dnf', 'zypper', 'homebrew')"

- name: 'install ({{ ansible_pkg_mgr }})'
include_tasks: 'install-{{ ansible_pkg_mgr }}.yml'
6 changes: 3 additions & 3 deletions tasks/write-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
become: yes
become_user: '{{ item.0.username }}'
file:
path: '~{{ item.0.username }}/.config'
path: '~{{ item.0.username }}/{{ visual_studio_code_config_path }}'
state: directory
mode: 'u=rwx,go=r'
with_subelements:
Expand All @@ -15,7 +15,7 @@
become: yes
become_user: '{{ item.username }}'
file:
path: '~{{ item.username }}/.config/Code/User'
path: '~{{ item.username }}/{{ visual_studio_code_config_path }}/User'
state: directory
mode: 'u=rwx,go='
with_items: '{{ users }}'
Expand All @@ -25,7 +25,7 @@
become_user: '{{ item.username }}'
template:
src: settings.json.j2
dest: '~{{ item.username }}/.config/Code/User/settings.json'
dest: '~{{ item.username }}/{{ visual_studio_code_config_path }}/User/settings.json'
force: no
mode: 'u=rw,go='
with_items: '{{ users }}'
Expand Down
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
# vars file for visual-studio-code
visual_studio_code_config_path: "{{ 'Library/Application Support' if ansible_distribution == 'MacOSX' else '.config' }}/Code"

0 comments on commit e61c3da

Please sign in to comment.