diff --git a/README.md b/README.md index 76636b617..4b317d70a 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,7 @@ [![CI][badge-gh-actions]][link-gh-actions] -This playbook installs and configures most of the software I use on my Mac for web and software development. Some things in macOS are slightly difficult to automate, so I still have some manual installation steps, but at least it's all documented here. - -This is a work in progress, and is mostly a means for me to document my current Mac's setup. I'll be evolving this playbook over time. - -*See also*: - - - [Boxen](https://github.com/boxen) - - [Battleschool](http://spencer.gibb.us/blog/2014/02/03/introducing-battleschool) - - [osxc](https://github.com/osxc) - - [MWGriffin/ansible-playbooks](https://github.com/MWGriffin/ansible-playbooks) (the original inspiration for this project) +This playbook installs and configures most of the software I use on my Mac for web and software development. Some things in macOS are slightly difficult to automate, so I still have a few manual installation steps, but at least it's all documented here. ## Installation diff --git a/main.yml b/main.yml index 130a98f95..6d55fe841 100644 --- a/main.yml +++ b/main.yml @@ -12,14 +12,18 @@ tags: ['always'] roles: - - role: geerlingguy.homebrew + - role: elliotweiser.osx-command-line-tools + - role: geerlingguy.mac.homebrew tags: ['homebrew'] - role: geerlingguy.dotfiles when: configure_dotfiles tags: ['dotfiles'] - - role: geerlingguy.mas + - role: geerlingguy.mac.mas when: mas_installed_apps or mas_installed_app_ids tags: ['mas'] + - role: geerlingguy.mac.dock + when: configure_dock + tags: ['dock'] tasks: - import_tasks: tasks/ansible-setup.yml @@ -40,10 +44,6 @@ - import_tasks: tasks/extra-packages.yml tags: ['extra-packages'] - - import_tasks: tasks/dock.yml - when: configure_dock - tags: ['dock'] - - import_tasks: tasks/sublime-text.yml when: configure_sublime tags: ['sublime-text'] diff --git a/requirements.yml b/requirements.yml index 859e6952a..f5815ad80 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,5 +1,7 @@ --- roles: + - name: elliotweiser.osx-command-line-tools - name: geerlingguy.dotfiles - - name: geerlingguy.homebrew - - name: geerlingguy.mas + +collections: + - name: geerlingguy.mac diff --git a/tasks/dock-add.yml b/tasks/dock-add.yml deleted file mode 100644 index 8a4349c9a..000000000 --- a/tasks/dock-add.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: See if Dock item {{ item.name | default(item) }} exists. - ansible.builtin.command: "dockutil --find '{{ item.name }}'" - register: dockitem_exists - failed_when: > - "No such file or directory" in dockitem_exists.stdout - or "command not found" in dockitem_exists.stdout - changed_when: false - tags: ['dock'] - -- name: Ensure Dock item {{ item.name | default(item) }} exists. - ansible.builtin.command: "dockutil --add '{{ item.path }}'" - when: dockitem_exists.rc >0 - tags: ['dock'] diff --git a/tasks/dock-remove.yml b/tasks/dock-remove.yml deleted file mode 100644 index 32d99e3e9..000000000 --- a/tasks/dock-remove.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: See if dock item {{ 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 - or "command not found" in dockitem_exists.stdout - tags: ['dock'] - -- name: Ensure Dock item {{ item }} is removed. - ansible.builtin.command: - cmd: dockutil --remove '{{ item }}' - when: dockitem_exists.rc == 0 - tags: ['dock'] diff --git a/tasks/dock.yml b/tasks/dock.yml deleted file mode 100644 index 560d517f4..000000000 --- a/tasks/dock.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- 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 > 0 - loop: "{{ dockitems_persist }}"