Skip to content

Instantly share code, notes, and snippets.

@gnarf
Last active February 7, 2023 15:39
Show Gist options
  • Select an option

  • Save gnarf/b103e77f37236ca72d8e to your computer and use it in GitHub Desktop.

Select an option

Save gnarf/b103e77f37236ca72d8e to your computer and use it in GitHub Desktop.

Revisions

  1. gnarf revised this gist Oct 23, 2015. 2 changed files with 15 additions and 15 deletions.
    2 changes: 1 addition & 1 deletion Vagrantfile
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ Vagrant.configure(2) do |config|
    end

    vm_config.vm.provision :ansible do |ansible|
    ansible.playbook = "setup.yml"
    ansible.playbook = "playbook.yml"
    ansible.groups = config_yml[:groups]
    ansible.extra_vars = {
    deploy_env: "vagrant"
    28 changes: 14 additions & 14 deletions vagrant-config.yml
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,3 @@
    :groups:
    builder:
    - vagrant.builder.jquery.net
    control:
    - vagrant.control.jquery.net
    znc:
    - vagrant.znc.jquery.net
    simple-sites:
    - vagrant.simple-sites.jquery.net
    php-sites:
    - vagrant.php-sites.jquery.net
    wp-content:
    - vagrant.wp-content.jquery.net

    :vms:
    control:
    :hostname: "vagrant.control.jquery.net"
    @@ -40,3 +26,17 @@
    wp-content:
    :hostname: "vagrant.wp-content.jquery.net"
    :ip: "172.27.72.27"

    :groups:
    builder:
    - builder
    control:
    - control
    znc:
    - znc
    simple-sites:
    - simple-sites
    php-sites:
    - php-sites
    wp-content:
    - wp-content
  2. gnarf revised this gist Oct 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Vagrantfile
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ Vagrant.configure(2) do |config|
    end

    vm_config.vm.provision :ansible do |ansible|
    ansible.playbook = "playbook.yml"
    ansible.playbook = "setup.yml"
    ansible.groups = config_yml[:groups]
    ansible.extra_vars = {
    deploy_env: "vagrant"
  3. gnarf created this gist Oct 21, 2015.
    52 changes: 52 additions & 0 deletions Vagrantfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    # -*- mode: ruby -*-
    # vi: set ft=ruby :

    require 'yaml'
    config_yml = YAML.load_file(File.open(File.expand_path(File.dirname(__FILE__)) + "/vagrant-config.yml"))


    # All Vagrant configuration is done below. The "2" in Vagrant.configure
    # configures the configuration version (we support older styles for
    # backwards compatibility). Please don't change it unless you know what
    # you're doing.
    Vagrant.configure(2) do |config|
    config_yml[:vms].each do |name, settings|
    # use the config key as the vm identifier
    config.vm.define(name) do |vm_config|

    # Debian 8 (jessie), currently the default case
    vm_config.vm.box = "ARTACK/debian-jessie"
    vm_config.vm.box_url = "https://atlas.hashicorp.com/ARTACK/boxes/debian-jessie"

    # Example of overriding, we don't support wheezy anymore though
    # if settings[:distro] == "wheezy"
    # vm_config.vm.box = "jquery-wheezy-amd64"
    # vm_config.vm.box_url = "http://boxes.jquery.com/jquery-wheezy-amd64.box"
    # end

    # NOTE right place to store the project files? Overwrite /etc/puppet?
    vm_config.vm.synced_folder "./", "/vagrant"

    # assign an ip address in the hosts network
    vm_config.vm.network "private_network", ip: settings[:ip]

    vm_config.vm.hostname = settings[:hostname]

    config.vm.provider "virtualbox" do |v|
    # make sure that the name makes sense when seen in the vbox GUI
    v.name = settings[:hostname]

    # Be nice to our users.
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
    end

    vm_config.vm.provision :ansible do |ansible|
    ansible.playbook = "playbook.yml"
    ansible.groups = config_yml[:groups]
    ansible.extra_vars = {
    deploy_env: "vagrant"
    }
    end
    end
    end
    end
    42 changes: 42 additions & 0 deletions vagrant-config.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    :groups:
    builder:
    - vagrant.builder.jquery.net
    control:
    - vagrant.control.jquery.net
    znc:
    - vagrant.znc.jquery.net
    simple-sites:
    - vagrant.simple-sites.jquery.net
    php-sites:
    - vagrant.php-sites.jquery.net
    wp-content:
    - vagrant.wp-content.jquery.net

    :vms:
    control:
    :hostname: "vagrant.control.jquery.net"
    :ip: "33.33.33.10"

    znc:
    :hostname: "vagrant.znc.jquery.net"
    :ip: "33.33.33.11"

    simple-sites:
    :hostname: "vagrant.simple-sites.jquery.net"
    :ip: "33.33.33.12"

    splunk:
    :hostname: "vagrant.splunk.jquery.net"
    :ip: "33.33.33.14"

    php-sites:
    :hostname: "vagrant.php-sites.ops.jquery.net"
    :ip: "33.33.33.13"

    builder:
    :hostname: "vagrant.builder.jquery.net"
    :ip: "172.27.72.28"

    wp-content:
    :hostname: "vagrant.wp-content.jquery.net"
    :ip: "172.27.72.27"
    20 changes: 20 additions & 0 deletions vagrant-hosts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # this just lets you run playbooks directly on vagrant once you bring a machine up, super useful if you have your
    # users installed with a sudoers_nopassword group in your deploy_env=vagrant

    [control]
    vagrant.control.jquery.net ansible_ssh_host=33.33.33.10 deploy_env=vagrant

    [php-sites]
    vagrant.php-sites.jquery.net ansible_ssh_host=33.33.33.13 deploy_env=vagrant

    [simple-sites]
    vagrant.simple-sites.jquery.net ansible_ssh_host=33.33.33.12 deploy_env=vagrant

    [builder]
    vagrant.builder.jquery.net ansible_ssh_host=172.27.72.28 deploy_env=vagrant

    [wp-content]
    vagrant.wp-content.jquery.net ansible_ssh_host=172.27.72.27 deploy_env=vagrant

    [znc]
    vagrant.znc.jquery.net ansible_ssh_host=33.33.33.13 deploy_env=vagrant