Skip to content

Instantly share code, notes, and snippets.

@hkumarmk
hkumarmk / consule_role_profile
Created September 25, 2014 16:07
consul role/profile
This is what I did to test consul puppet module
### In consul, any node whether it is agent or server, (other than initial node) need an agent address which is in the cluster in order to join the cluster. This is different from etcd where it allow for autodiscovery.
I Faced couple of issues with consul module.
1. Consul service configuration json is not correct when port parameter specified in consul::service. consul expect that parameter to be integer, but module write it as string. This need to be fixed.
2. If initial server is not up while starting other servers or agent, the cluster join will be failed, and unless there is any (new) service definition, that node will not be joining to the consul cluster, as cluster join code in the module is only called when service restart. I submitted a patch in jiocloud/puppet-consul to fix this.
Added initial server IP in hiera in my env as testing for now.
@hkumarmk
hkumarmk / gist:d40769d34db875743922
Created October 16, 2014 06:00
error on easy_host
It seems rspec is not getting functions from stdlib :(. I am getting the error saying puppet parser doesnt see function_ensure_resource. But If I use create_resources in the function easy_host, the below test works.
Here is my test code
require 'spec_helper'
require 'rspec-puppet'
describe 'easy_host' do
before :all do
Puppet::Parser::Functions.autoloader.loadall
type/contrail_provisioner.rb
==================================
Puppet::Type.newtype(:contrail_provisioner) do
@doc = <<-'EOD'
Provision contrail BGP peers (contrail control, edge routers),
xmpp peers (Vrouters) and linklocal services.
EOD
diff --git a/hiera/data/common.yaml b/hiera/data/common.yaml
index 3bf5e67..7e4f77b 100644
--- a/hiera/data/common.yaml
+++ b/hiera/data/common.yaml
@@ -3,7 +3,7 @@
###################################
##
-# Idea is to enable jumbo frames after complete initial setup.
+# Idea is to enable jumbo frames after completing initial setup.
#!/bin/bash
base_path=$1
mkdir -p /etc/puppet/{modules,manifests}
mount --bind ${base_path}/modules/rjil/hiera /etc/puppet/hiera
ln -s /etc/puppet/hiera/hiera.yaml /etc/puppet/hiera.yaml
mount --bind ${base_path}/modules /etc/puppet/modules
mount --bind ${base_path}/modules/rjil/site.pp /etc/puppet/manifests/site.pp
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability
Puppet::Type.type(:contrail_vgw).provide(
:provisioner
) do
# commands :provision_vgw => setCommand
# commands :provision_vgw => 'export PYTHONPATH=/usr/lib/python2.7/dist-packages/contrail_vrouter_api/gen_py/instance_service;/usr/sbin/contrail-provision-vgw-interface'
# commands :provision_vgw => '/usr/sbin/contrail-provision-vgw-interface'
def provision_vgw(*args)
# path=`find /usr/lib/python2.7/ -name instance_service -type d| grep contrail | head -1`.chomp.strip
@hkumarmk
hkumarmk / gist:efc0a660376af96457ac
Created November 27, 2014 06:11
swift client errors on downloading
radosgw just works (tested for swift as of now), I am able to create containers and objects. But I see a weird issue on object download using swift client just fails complaining on content length vs readlength mismatch, but at the same time curl just works and I see right content in the downloaded file.
Here is the details
root@ocdb1-testjenkins-puppet-rjil-gate-265:/tmp# swift stat container openrc
Account: v1
Container: container
########## Type
##################
Puppet::Type.newtype(:rjil_tempest_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from tempest.conf'
newvalues(/\S+\/\S+/)
@hkumarmk
hkumarmk / gist:fc5289aa606fa6302327
Created December 11, 2014 09:18
vagrant parallel provision
#!/bin/bash
#
# Parallel provisioning for vagrant
#
up() {
vagrant up --no-provision
}
provision() {
sleep 5