Skip to content

Instantly share code, notes, and snippets.

@ikuwow
Last active August 29, 2015 14:17
Show Gist options
  • Save ikuwow/a8d30da399ba635cf692 to your computer and use it in GitHub Desktop.
Save ikuwow/a8d30da399ba635cf692 to your computer and use it in GitHub Desktop.
Ansibleでvagrant plugin install ref: http://qiita.com/ikuwow/items/207ccc862b7a9f8858dc
ASK: [List Installed Vagrant Plugins] ****************************************
ok: [localhost]
TASK: [Install Vagrant Plugins] ***********************************************
skipping: [localhost] => (item=vagrant-omnibus)
skipping: [localhost] => (item=vagrant-vbguest)
skipping: [localhost] => (item=vagrant-cachier)
skipping: [localhost] => (item=vagrant-vbox-snapshot)
skipping: [localhost] => (item=vagrant-aws)
skipping: [localhost] => (item=vagrant-digitalocean)
---
- hosts: localhost
connection: local
gather_facts: no
tasks:
- name: List Installed Vagrant Plugins
shell: "vagrant plugin list | awk '{ print $1 }'"
changed_when: false
register: vagrant_plugin_list
- name: Install Vagrant Plugins
shell: "vagrant plugin install {{item}}"
with_items:
- vagrant-omnibus
- vagrant-vbguest
- vagrant-cachier
- vagrant-vbox-snapshot
- vagrant-aws
- vagrant-digitalocean
when: item not in vagrant_plugin_list.stdout_lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment