Debugging PyODBC Install

I had some problems installing ODCB, FreeTDS and PyODBC. I was connecting to a remote MS SQL server using an SSH tunnel. After roughly following these notes, things were not working. These commands worked:

TDSVER=8.0 tsql -H 127.0.0.1 -p 1433 -U my_username -P my_password
SELECT * FROM INFORMATION_SCHEMA.TABLES
GO

If I replace TDSVER=7.0 things stop working. Turns out that was the version in

/etc/freetds/freetds.conf

Nasty Ansible Bug

Lets say you are using the Ansible “template” function. Like this:

- name: setup my_conf.conf
  template: src= "templates/my_conf.conf.j2" dest="/etc/my_conf.conf"

Seems pretty straight forward. But it will give you fatal error:

fatal: [127.0.0.1] => {'msg': 'AnsibleError: unable to read /my_path/ansible', 'failed': True}

What’s the problem? See that space after “src=”? Get rid of that and the command works. This is frustrating because PEP 8, has given me the habit of putting spaces around =.