It's been a while since the 0.13 release of python-gitlab. For the 0.14 release I spent some time writing code examples to make the first steps of using the API easier. All the objects are not yet documented, but since there's been a lot of new features and some bug fixes I wanted to get things out there.

python-gitlab is a python package and a gitlab CLI to interact with the Gitlab API.

To install the 0.14 version using pip:

pip install --upgrade python-gitlab

Download the tarballs on pypi:

Documentation is available on read the docs:

Report bugs and send pull request on github, contributions are very welcome:

The problem

Ansible playbooks that can deploy applications in multiple contexts (for example a 1-node setup for tests, and multi-node setup with HA for production) might have to deal with rather complex variable definitions. The templating system provided by Ansible is a great help, but it can be difficult and very verbose to use it sometimes.

I recently had to solve a simple problem. Depending on the installation node of the HAProxy load balancer, the 15 balanced services had to listen on different ports to avoid conflicts.

One solution

Instead of computing the selected port using the template system, I chose to develop a module that would set the chosen ports as a fact on every target. The module is called once at the beginning of the playbook, and the ports are available as a variable in all the tasks.

The module

The module takes one mandatory boolean argument, with_haproxy.

The implementation looks like this (library/

    'service1': 11001,
    'service2': 11002
    'service1': 1001,
    'service2': 1002

def main():
    module = AnsibleModule(
        argument_spec = dict(
            with_haproxy = dict(type='bool', required=True)

    with_haproxy = module.params['with_haproxy']
    ports = {'public': PUBLIC}
    ports['internal'] = INTERNAL if with_haproxy else PUBLIC

    module.exit_json(changed=False, result="success",
                     ansible_facts={'ports': ports})

    from ansible.module_utils.basic import *

The ansible_facts argument name is important, it will tell ansible to register this variable as a fact, so you don't need to use the register attribute in your task.

The ports dict holds the ports information for public and internal access. The ports.internal dict is used to configure the services ports. If HAProxy is used, they have custom (INTERNAL) ports to avoid conflicting with HAProxy. Otherwise they use the official (PUBLIC) port.

The playbook

To register the facts, the first task of the playbook looks like this:

- name: Register ports
    module: get_ports
    with_haproxy: true|false

- debug: var=ports.internal.service1
- debug: var=ports.internal.service2

The local_action module avoids a useless connection to the targets.


If you have not written modules for Ansible yet, have a look at the tutorial. They can be written in any language, although using Python makes things a lot easier.

After several years of dealing with Drupal 6 I made the switch to a static site generator for this web space. Several reasons:

  • Updating Drupal is a pain
  • Switching to Drupal 7 didn't work out of the box, and I didn't want to spend days on this
  • The content editor is web/html/wiki-style based, I prefer a simple text-based editor

There's a lot of static site generators out there, I had a few criteria to help me decide which one to used:

  • Open Source
  • Possibility to write articles in RST rather than MD
  • Written in python so I can easily modify the behovior if needed
  • Theming support, and multiple themes available - HTML/CSS is not my strong suit

The tool that seemed to best fit my needs was pelican so I gave it a go, and it worked very well for what I wanted to do.

I use a couple plugins to handle the documentation pages and the sitemap.xml generation, and the theme is based on new-bootstrap2 with some simple modifications.

I now edit this web space with vim and publish with ansible, I feel at home!

Medibuntu is going down.

The project is not really needed nowadays, except for one package: libdvdcss. This package is now maintained by Jonathan Riddell at Blue Systems. It is available in a repository hosted by VideoLAN.

To disable the Medibuntu repository and enable the libdvdcss one, use these commands:

sudo rm /etc/apt/sources.list.d/medibuntu.list
curl | sudo apt-key add -
echo "deb ./" | sudo tee /etc/apt/sources.list.d/libdvdcss.list
sudo apt-get update

If you are using Ubuntu saucy, you can also install libdvdcss using an alternative method (make sure to install/upgrade the libdvdread4 package first).

I'll keep the repository online for now, at least until the Ubuntu 13.10 release. Expect the repository to be down after that. An iso image of the current state of the repository is available <>.

I recommend to disable the repository if you are currently using it.

Thanks to all the persons who contributed to the project (package maintainers, servers admins, ...).