|
| 1 | +# Mac Collection for Ansible |
| 2 | + |
| 3 | +[![Apache-2.0 licensed][badge-license]][link-license] |
| 4 | +[![Galaxy Collection][badge-collection]][link-galaxy] |
| 5 | +[![CI][badge-gh-actions]][link-gh-actions] |
| 6 | + |
| 7 | +This collection includes helpful Ansible roles and content to help with macOS automation. For a good example of the collection's usage, see the [Mac Dev Playbook](https://github.com/buluma/mac-dev-playbook). |
| 8 | + |
| 9 | +Roles included in this collection (click on the link to see the role's README and documentation): |
| 10 | + |
| 11 | + - `buluma.mac.homebrew` ([documentation](https://github.com/buluma/ansible-collection-mac/blob/master/roles/homebrew/README.md)) |
| 12 | + - `buluma.mac.mas` ([documentation](https://github.com/buluma/ansible-collection-mac/blob/master/roles/mas/README.md)) |
| 13 | + - `buluma.mac.dock` ([documentation](https://github.com/buluma/ansible-collection-mac/blob/master/roles/dock/README.md)) |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +Install via Ansible Galaxy: |
| 18 | + |
| 19 | +``` |
| 20 | +ansible-galaxy collection install buluma.mac |
| 21 | +``` |
| 22 | + |
| 23 | +Or include this collection in your playbook's `requirements.yml` file: |
| 24 | + |
| 25 | +``` |
| 26 | +--- |
| 27 | +collections: |
| 28 | + - name: buluma.mac |
| 29 | +``` |
| 30 | + |
| 31 | +For a real-world example, see my [Mac Dev Playbook's requirements file](https://github.com/buluma/mac-dev-playbook/blob/master/requirements.yml). |
| 32 | + |
| 33 | +### Role Requirements |
| 34 | + |
| 35 | +Requires separate installation of the `elliotweiser.osx-command-line-tools` role. Because Ansible collections are not able to depend on roles, you will need to make sure that role is installed either by manually installing it with the `ansible-galaxy` command, or adding it under the `roles` section of your `requirements.yml` file: |
| 36 | + |
| 37 | +```yaml |
| 38 | +--- |
| 39 | +roles: |
| 40 | + - name: elliotweiser.osx-command-line-tools |
| 41 | + |
| 42 | +collections: |
| 43 | + - name: buluma.mac |
| 44 | +``` |
| 45 | +
|
| 46 | +## Usage |
| 47 | +
|
| 48 | +Here's an example playbook which installs some Mac Apps (assuming you are signed into the App Store), CLI tools via Homebrew, and Cask Apps using Homebrew: |
| 49 | +
|
| 50 | +```yaml |
| 51 | +- hosts: localhost |
| 52 | + connection: local |
| 53 | + gather_facts: false |
| 54 | + |
| 55 | + vars: |
| 56 | + mas_installed_app_ids: |
| 57 | + - 424389933 # Final Cut Pro |
| 58 | + - 497799835 # Xcode |
| 59 | + |
| 60 | + homebrew_installed_packages: |
| 61 | + - node |
| 62 | + - nvm |
| 63 | + - redis |
| 64 | + - ssh-copy-id |
| 65 | + - pv |
| 66 | + |
| 67 | + homebrew_cask_apps: |
| 68 | + - docker |
| 69 | + - firefox |
| 70 | + - google-chrome |
| 71 | + - vlc |
| 72 | + |
| 73 | + roles: |
| 74 | + - buluma.mac.homebrew |
| 75 | + - buluma.mac.mas |
| 76 | +``` |
| 77 | +
|
| 78 | +For a real-world usage example, see my [Mac Dev Playbook](https://github.com/buluma/mac-dev-playbook). |
| 79 | +
|
| 80 | +See the full documentation for each role in the role's README, linked above. |
| 81 | +
|
| 82 | +## License |
| 83 | +
|
| 84 | +Apache-2.0 |
| 85 | +
|
| 86 | +## Author |
| 87 | +
|
| 88 | +This collection was created by [Michael Buluma](https://buluma.github.io). |
| 89 | +
|
| 90 | +[badge-gh-actions]: https://github.com/buluma/ansible-collection-mac/workflows/CI/badge.svg?event=push |
| 91 | +[link-gh-actions]: https://github.com/buluma/ansible-collection-mac/actions?query=workflow%3ACI |
| 92 | +[badge-collection]: https://img.shields.io/badge/collection-buluma.mac-blue |
| 93 | +[link-galaxy]: https://galaxy.ansible.com/buluma/mac |
| 94 | +[badge-license]: https://img.shields.io/github/license/buluma/ansible-collection-mac.svg |
| 95 | +[link-license]: https://github.com/buluma/ansible-collection-mac/blob/master/LICENSE |
| 96 | +[badge-gh-actions]: https://github.com/buluma/ansible-role-homebrew/workflows/CI/badge.svg?event=push |
0 commit comments