Stanley

Hi, I am Victor Castell, Ruby on Rails Consultant & DevOps Engineer.

Expert professional with +13 years of experience in software development and systems architecture. I help companies, applying technology to business problems. Co-Founded Alkiloo, former CTO and Partner at Season.

Recent Posts

Ansible tip 2

When developing a role to do a task, you often need to declare some variables to parametrize aspects of the role. It’s not a good idea to name a role variable like: http_port host_name path As a general rule, namespace those variables based on the role name. People can find collisions with their own defined group/host variables in their infrastructure. Using the same mongodb role example of my previous post #file roles/mongodb/defaults/main.yml mongodb_version: '2.6.1' mongodb_data_path: '/var/lib/mongodb' mongodb_rs_hosts: ['mongo1', 'mongo2'] Naming this way it’s less probably that you will find any unintended interaction with variables defined by the user using your role, not impossible though.

Ansible tip 1

As a general rule always tag your roles. Tagging individual role tasks, allows you to selectively apply just one part of the configuration when you need it. While the advantatges of this may not seem clear at the beginning, you have to take into account that ansible is not the fastest kid on the block. Doing this always, allows great flexibility and high level of granularity when running your playbooks. This is an example of a mongodb setup role: - apt_key: url=http://docs.mongodb.org/10gen-gpg-key.asc state=present tags: mongodb - apt_repository: repo='deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' state=present tags: mongodb - apt: pkg={{ item }}={{ mongodb_version }} update-cache=yes with_items: - mongodb-org - mongodb-org-server - mongodb-org-shell - mongodb-org-mongos - mongodb-org-tools tags: mongodb - service: name=mongod state=started tags: mongodb - template: src=etc/mongod.conf dest=/etc/mongod.conf owner=root group=root mode=0644 notify: restart mongod tags: mongodb As a best practice I always tag the role with the role name.

heka-redis plugin

I’ve written a simple Redis PubSub heka plugin capable of listening to a queue/s by name or by pattern Decode it if necessary and forward it to the heka pipeline. https://github.com/victorcoder/heka-redis

Lists of values

If you are into building applications of any kind, probably you sometime had the need of a list of countries for a dropdown box or a select list with states. This is why we created LOVs https://github.com/seasonlabs/lovs a repository to store this kind of datasets, in a plain, machine readable format that can be used to create DB tables or other kind of automated datastore. With firsts commits I tried to contribute some common use datasets.