How to enable an addon on startup via script? Our renderfarm is running Blender from the network. How can I enable addons on startup without saving user preferences for each node?

The following works when I run it from Blender REPL during a regular Blender session. I thought I would easily add a script in script/startup and run:

import addon_utils
addon_utils.enable("animation_nodes")


But it doesn't find the addon. Maybe the startup script is run before the addons are scanned? Any ideas?

What would be the best way then to enable it for all the rendernodes?
You can enable a comma-separated list of addons through the command line/terminal, so you're able to do that through a script. That functionality is described in the blender terminal help (./blender --help). 

An example would be ./blender -b --addons animation_nodes,meshlint [file] to enable animation nodes and meshlint, then load your file.

If you need to load a single python script, such as a set of operations you want to use on a mesh object, you can use the --python flag. ./blender -b --addons animation_nodes,meshlint [file] --python [myscript.py] loads blender in the background, loads specified addons, loads the file, then executes the python script.

Unfortunately, the wiki is not helpful here; it only goes over basic rendering functionality. Simply call the help flag to see everything the executable can do from the terminal. A specific thing to remember is that flags are order-sensitive. Those flags listed first will be interpreted first, sequentially until the end of the command.