mirror of
https://github.com/geerlingguy/mac-dev-playbook
synced 2024-11-22 03:43:06 +00:00
Merge branch 'master' into mytags
This commit is contained in:
commit
6044cd3160
8 changed files with 74 additions and 8 deletions
16
README.md
16
README.md
|
@ -81,6 +81,10 @@ You can override any of the defaults configured in `default.config.yml` by creat
|
|||
|
||||
pip_packages:
|
||||
- name: mkdocs
|
||||
|
||||
configure_dock: true
|
||||
dockitems_remove: []
|
||||
dockitems_persist: []
|
||||
|
||||
Any variable can be overridden in `config.yml`; see the supporting roles' documentation for a complete list of available variables.
|
||||
|
||||
|
@ -144,13 +148,11 @@ Finally, there are a few other preferences and settings added on for various app
|
|||
|
||||
It's my hope that I can get the rest of these things wrapped up into Ansible playbooks soon, but for now, these steps need to be completed manually (assuming you already have Xcode and Ansible installed, and have run this playbook).
|
||||
|
||||
1. Set JJG-Term as the default Terminal theme (it's installed, but not set as default automatically).
|
||||
2. Install [Sublime Package Manager](http://sublime.wbond.net/installation).
|
||||
3. Install all the apps that aren't yet in this setup (see below).
|
||||
4. Remap Caps Lock to Escape (requires macOS Sierra 10.12.1+).
|
||||
5. Set trackpad tracking rate.
|
||||
6. Set mouse tracking rate.
|
||||
7. Configure extra Mail and/or Calendar accounts (e.g. Google, Exchange, etc.).
|
||||
1. Install [Sublime Package Manager](http://sublime.wbond.net/installation).
|
||||
2. Remap Caps Lock to Escape (requires macOS Sierra 10.12.1+).
|
||||
3. Set trackpad tracking rate.
|
||||
4. Set mouse tracking rate.
|
||||
5. Configure extra Mail and/or Calendar accounts (e.g. Google, Exchange, etc.).
|
||||
|
||||
### Configuration to be added:
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
[defaults]
|
||||
nocows = True
|
||||
roles_path = ./roles:/etc/ansible/roles
|
||||
stdout_callback = yaml
|
||||
|
|
|
@ -5,6 +5,17 @@ configure_dotfiles: true
|
|||
configure_terminal: true
|
||||
configure_osx: true
|
||||
|
||||
# Set to 'true' to configure the Dock via dockutil.
|
||||
configure_dock: false
|
||||
dockitems_remove: []
|
||||
# - Launchpad
|
||||
# - TV
|
||||
# - Podcasts
|
||||
# - 'App Store'
|
||||
dockitems_persist: []
|
||||
# - name: "Sublime Text"
|
||||
# path: "/Applications/Sublime Text.app/"
|
||||
|
||||
configure_sudoers: false
|
||||
sudoers_custom_config: ''
|
||||
# Example:
|
||||
|
|
4
main.yml
4
main.yml
|
@ -40,6 +40,10 @@
|
|||
- import_tasks: tasks/extra-packages.yml
|
||||
tags: ['extra-packages']
|
||||
|
||||
- import_tasks: tasks/dock.yml
|
||||
when: configure_dock
|
||||
tags: ['dock']
|
||||
|
||||
- name: Run configured post-provision ansible task files.
|
||||
include_tasks: "{{ outer_item }}"
|
||||
loop_control:
|
||||
|
|
12
tasks/dock-add.yml
Normal file
12
tasks/dock-add.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
- name: See if Dock item {{ item }} exists.
|
||||
ansible.builtin.command: "dockutil --find '{{ item.name }}'"
|
||||
register: dockitem_exists
|
||||
failed_when: '"No such file or directory" in dockitem_exists.stdout'
|
||||
changed_when: false
|
||||
tags: ['dock']
|
||||
|
||||
- name: Ensure Dock item {{ item }} exists.
|
||||
ansible.builtin.command: "dockutil --add '{{ item.path }}'"
|
||||
when: dockitem_exists.rc >0
|
||||
tags: ['dock']
|
14
tasks/dock-remove.yml
Normal file
14
tasks/dock-remove.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
- name: find if dock item exists
|
||||
ansible.builtin.command:
|
||||
cmd: dockutil --find '{{ item }}'
|
||||
register: dockitem_exists
|
||||
changed_when: false
|
||||
failed_when: '"No such file or directory" in dockitem_exists.stdout'
|
||||
tags: ['dock']
|
||||
|
||||
- name: Ensure unwanted dock items removed.
|
||||
ansible.builtin.command:
|
||||
cmd: dockutil --remove '{{ item }}'
|
||||
when: dockitem_exists.rc == 0
|
||||
tags: ['dock']
|
23
tasks/dock.yml
Normal file
23
tasks/dock.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
- name: Install dockutil.
|
||||
homebrew:
|
||||
name: dockutil
|
||||
state: present
|
||||
notify:
|
||||
- Clear homebrew cache
|
||||
|
||||
- name: Remove configured Dock items.
|
||||
ansible.builtin.include_tasks: tasks/dock-remove.yml
|
||||
loop: "{{ dockitems_remove }}"
|
||||
|
||||
- name: Ensure required dock items exist.
|
||||
ansible.builtin.include_tasks: tasks/dock-add.yml
|
||||
loop: "{{ dockitems_persist }}"
|
||||
|
||||
- name: Ensure correct Dock order.
|
||||
ansible.builtin.command:
|
||||
cmd: dockutil --move '{{ item.name }}' --position '{{ item.pos }}'
|
||||
when:
|
||||
- item.pos is defined
|
||||
- item.pos length >0
|
||||
loop: "{{ dockitems_persist }}"
|
|
@ -3,4 +3,3 @@
|
|||
- name: Run .osx dotfiles.
|
||||
command: "{{ osx_script }}"
|
||||
changed_when: false
|
||||
tags: ['osx']
|
||||
|
|
Loading…
Reference in a new issue