diff --git a/README.md b/README.md index 3768f4a..76a1be3 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/main.yml b/main.yml index 6986392..1998870 100644 --- a/main.yml +++ b/main.yml @@ -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 }}"