Merge pull request #45 from generoi/tags

Add ansible tags for the commonly ran tasks
This commit is contained in:
Jeff Geerling 2017-05-31 15:24:52 -05:00 committed by GitHub
commit 58e256cb62
2 changed files with 14 additions and 3 deletions

View file

@ -23,6 +23,12 @@ This is a work in progress, and is mostly a means for me to document my current
> Note: If some Homebrew commands fail, you might need to agree to Xcode's license or fix some other Brew issue. Run `brew doctor` to see if this is the case.
### Running a specific set of tagged tasks
You can filter which part of the provisioning process to run by specifying a set of tags using `ansible-playbook`'s `--tags` flag. The tags available are `dotfiles`, `homebrew`, `mas` and `osx`.
ansible-playook main.yml -i inventory -K --tags "dotfiles,homebrew"
## Overriding Defaults
Not everyone's development environment and preferred software configuration is the same.

View file

@ -9,12 +9,16 @@
- include_vars: "{{ item }}"
with_fileglob:
- ../config.yml
tags: ['always']
roles:
- geerlingguy.homebrew
- geerlingguy.dotfiles
- name: geerlingguy.mas
- role: geerlingguy.homebrew
tags: ['homebrew']
- role: geerlingguy.dotfiles
tags: ['dotfiles']
- role: geerlingguy.mas
when: mas_installed_apps
tags: ['mas']
tasks:
- include: tasks/ansible-setup.yml
@ -27,6 +31,7 @@
- include: tasks/osx.yml
when: configure_osx
tags: ['osx']
- name: Run configured post-provision ansible task files.
include: "{{ outer_item }}"