forked from geerlingguy/mac-dev-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request geerlingguy#106 from dspolleke/mydock
dockutil
- Loading branch information
Showing
8 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[defaults] | ||
nocows = True | ||
roles_path = ./roles:/etc/ansible/roles | ||
stdout_callback = yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: find if dock {{ item }} exists | ||
ansible.builtin.command: | ||
cmd: 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 }} exists | ||
ansible.builtin.command: | ||
cmd: dockutil --add '{{ item.path }}' | ||
when: dockitem_exists.rc >0 | ||
tags: ['dock'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Install dockutil | ||
homebrew: | ||
name: dockutil | ||
state: present | ||
notify: | ||
- Clear homebrew cache | ||
- name: remove dockitems | ||
ansible.builtin.include_tasks: tasks/remdock.yml | ||
loop: "{{ dockitems_to_remove }}" | ||
|
||
- name: Ensure required dock items exist. | ||
ansible.builtin.include_tasks: tasks/adddock.yml | ||
with_items: "{{ dockitems_to_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_to_persist }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
- name: Run .osx dotfiles. | ||
command: "{{ osx_script }}" | ||
changed_when: false | ||
tags: ['osx'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'] |