Skip to content

Instantly share code, notes, and snippets.

@EntropyWorks
Last active August 29, 2015 14:15
Show Gist options
  • Save EntropyWorks/bf4ea89b5aceb7b206b2 to your computer and use it in GitHub Desktop.
Save EntropyWorks/bf4ea89b5aceb7b206b2 to your computer and use it in GitHub Desktop.
Looping into vagrant vm's
$ vagrant-loop "lsb_release -a"
#--- minion-01
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy
Connection to 127.0.0.1 closed.
#--- minion-02
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
Connection to 127.0.0.1 closed.
#--- minion-03
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
Connection to 127.0.0.1 closed.
#--- gatekeeper
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy
Connection to 127.0.0.1 closed.
---
shared: &shared # Have some common items that all boxes need
shell: "scripts/setup-minion.sh"
ansible: "provisioning/main.yml"
ram: "512"
debian_stable: &debian_stable
<<: *shared
box_url: "https://atlas.hashicorp.com/cargomedia/boxes/debian-7-amd64-cm"
box: "cargomedia/debian-7-amd64-cm"
debian_testing: &debian_testing
<<: *shared
box_url: "https://atlas.hashicorp.com/binarydata/boxes/debian-jessie"
box: "binarydata/debian-jessie"
ubuntu_stable: &ubuntu_stable
<<: *shared
box_url: "https://vagrantcloud.com/ubuntu/boxes/trusty64"
box: "ubuntu/trusty64"
default: &default # I set this to what I want most times
<<: *debian_stable
servers:
- name: minion-01
<<: *default
ip: "172.17.8.101"
- name: minion-02
<<: *ubuntu_stable
ip: "172.17.8.102"
- name: minion-03
<<: *debian_testing
ip: "172.17.8.103"
- name: gatekeeper
<<: *default
ram: "1024"
ansible: "provisioning/gatekeeper.yml"
shell: "scripts/setup-gatekeeper.sh"
ip: "172.17.8.100"
# working on some ideas for IPv6 settings
ipv6:
ipv6_range: "fd32:1891:ba93:481b::/64"
ipv6_start: "fd32:1891:ba93:481b::10"
#!/bin/bash
# Yazz D. Atlas <yazz.atlas@hp.com>
for i in $(vagrant status | grep running | awk '{ print $1}'); do
echo "#--- ${i} "
vagrant ssh ${i} -c "$1"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment