# Docker and Ansible: Using Utility Containers to replace NERDTools in Unraid

Apparently, there was some disagreement between Lime Tech, the makers of [Unraid](https://unraid.net/), and the maintainers of the beloved Unraid Community plugin [NerdTools](https://github.com/UnRAIDES/unRAID-NerdTools) about a change in the NAS OS company's business model. So, the NerdTools folks abandoned the project.

UPDATE: [un-get](https://raw.githubusercontent.com/ich777/un-get) appears to be the new tool power users from the community have gravitated toward. I still prefer the utility container approach though.

## What is NERDtools

[NerdTools](https://github.com/UnRAIDES/unRAID-NerdTools) is an Unraid OS plugin that allows you to install additional packages. From the looks of it, the plugin is essentially a GUI package manager for Unraid that installs [Slackware](http://www.slackware.com/) packages (with dependencies) to the `/boot/extra/` directory, which is where Unraid looks for additional packages.

## Why move?
First, NERDtools was never an officially supported by Lime Tech.

It was great, but it only had a specific and limited set of utilities, so I found it lacking when I wanted to, for example, use vagrant with libvirt as a provider since Unraid uses libvirt as the backend for VMs. But that would have required going down a Slackware rabbithole, which I wasn't really committed to (although sbopkg looked promising).

Even those who have built tools specifically to install Slackware pkgs on Unraid like [un-get](https://github.com/ich777/un-get) recommend using Docker, LXC, or VMs before installing on bare metal. So I can't argue in terms of the isolation and portability.

So I removed the NERDtools plugins and moved associate scripts run by cron jobs to a local home lab code repository.

## How everything is setup now

Simplest way to run things: containerize the process, then run via host cron.

First, to automate things with Ansible, I had to install Python 3 for Unraid which was essentially a suite of Slackware python tools.

I considered rolling my own Docker container and storing it in a self-hosted container [distribution registry](https://hub.docker.com/_/registry), which would keep the infrastructure internal and less reliant on external services like Dockerhub. But I later decided to build on the work of project maintainers since they tools I used already offered prebuilt images with the binaries baked in and decent documentation. I also considered adding a layer on top of theirs to have the args in the container, but that would make my playbooks less explicit. Although, I still might consider adding it in the future to reduce the number of tasks needed.

Here’s an example of one of the playbooks I now use for router backups:

```yaml
---
- name: Backup router
  hosts: wrt

  tasks:
    - name: Mount backup share
      ansible.posix.mount:
        src: nas:/mnt/user/backup/openwrt
        path: /mnt/backup
        state: ephemeral 
        boot: false
        fstype: nfs

    - name: Generate backup
      ansible.builtin.shell: |
        umask go=
        sysupgrade -b /mnt/backup/backup-FriendlyWrt-{{ ansible_date_time.date }}.tar.gz
```

## Result

This approach makes it so much easier to manage and backup the various services and servers I’ve setup.
