Just moozing

Before you can check your notes, you must make them…

Ansible and network manager wireless configuration

leave a comment »

I have WPA2/PSK wifi network at home and I want to use ansible to roll out wireless configurations to workstations.

This is done on Debian workstations, but something very similar should work on any Linux machine that uses network-manager.

I found the manual solution here. The idea is to create a file in /etc/NetworkManager/system-configurations. You need one file per connection. Actually, this is the same system as with VPN, cabled and the other connection types that network-manager can manage.

The basic strategy was to set it up in network-manager, look at the resulting file, replace values with variables and make ansible roll it out.

We need to generate a UUID, and there are discussions about that on e.g. stackoverflow (like here and here). I wanted ansible to generate the UUID at deploy time, and add it to the structure. I didn’t succeed, so I just added a UUID next to the SSID and the PSK. It was generated using the uuigen tool.

The resulting template and ansible playbook is in gist (shown below). I use vagrant, so I put it in a Vagrantfile as provisioner and do vagrant up.

Advertisements

Written by moozing

September 4, 2015 at 12:00

Posted in Tech

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: