diff --git a/Berksfile b/Berksfile index f101b72..7b6f1af 100644 --- a/Berksfile +++ b/Berksfile @@ -1,5 +1,6 @@ metadata cookbook 'hostsfile', '= 1.0.1' -cookbook 'kafka', git: 'https://git.hpcloud.net/mon/cookbooks-kafka' -cookbook 'vertica', git: 'https://git.hpcloud.net/mon/cookbooks-vertica' -cookbook 'zookeeper', git: 'https://git.hpcloud.net/mon/cookbooks-zookeeper' +cookbook 'kafka', git: 'git@git.hpcloud.net:mon/cookbooks-kafka' +cookbook 'percona', git: 'https://github.com/tkuhlman/chef-percona' +cookbook 'vertica', git: 'git@git.hpcloud.net:mon/cookbooks-vertica' +cookbook 'zookeeper', git: 'git@git.hpcloud.net:mon/cookbooks-zookeeper' diff --git a/README.md b/README.md index 1896861..fb23e45 100644 --- a/README.md +++ b/README.md @@ -39,5 +39,6 @@ vagrant up - Your home dir is synced to the vm in /vagrant_home on each vm - Vms created - `kafka` at `192.168.10.10` + - `mysql` at `192.168.10.6` - `vertica` at `192.168.10.8` - Run `vagrant help` for more info diff --git a/Vagrantfile b/Vagrantfile index df9ddfd..c5c16f7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -33,6 +33,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end end + config.vm.define "mysql" do |mysql| + mysql.vm.hostname = 'mysql' + mysql.vm.network :private_network, ip: "192.168.10.6" + mysql.vm.provision :chef_solo do |chef| + chef.roles_path = "roles" + chef.data_bags_path = "data_bags" + chef.add_role "MySQL" + end + end + config.vm.define "vertica" do |vertica| vertica.vm.hostname = 'vertica' vertica.vm.network :private_network, ip: "192.168.10.8" diff --git a/recipes/default.rb b/recipes/default.rb index 334ee8f..7942904 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,5 +1,8 @@ # Common setup for all vagrant boxes + +## Todo - This apt setup is specific to HP Cloud and should be moved to an optional recipe. + # This move the default apt sources which are the standard ubuntu apt ones aside, so we are forced to deal with what hpcloud has mirrored bash 'move dist sources.list' do action :run diff --git a/roles/MySQL.json b/roles/MySQL.json new file mode 100644 index 0000000..f9e4119 --- /dev/null +++ b/roles/MySQL.json @@ -0,0 +1,32 @@ +{ + "name": "MySQL", + "description": "Sets up MySQL", + "json_class": "Chef::Role", + "default_attributes": { + "percona": { + "backup": { + "password": "password" + }, + "cluster": { + "package": "percona-xtradb-cluster-56" + }, + "server": { + "debain_password": "password", + "replication": { + "password": "password" + }, + "root_password": "password" + }, + "use_percona_apt": false + } + }, + "override_attributes": { + }, + "chef_type": "role", + "run_list": [ + "role[Basenode]", + "recipe[percona::cluster]" + ], + "env_run_lists": { + } +}