Skip to content

Taskfile - The Modern Makefile

Task is a modern version of make written in go. They allow you to use yaml & jinja to define your actions and have the system build things for you. I use them to build an OPs environment and do on boarding. It's a quick and easy way to make sure you have the tools needed to do your job.


version: "3"

      - echo 'Hello World from Task!'
    silent: true

Here's an example of getting a HPC python and ansible ops environment going


version: "3"
    desc: Install Ops stuff
      - pips_needed
      - radssh_install
      - galaxy_needed
   desc: Installs python packages needed
   dir: "{{.USER_WORKING_DIR}}"
   cmds: [pip install -U --user -r requirements.txt]
   desc: Installs Radssh
     - pip install -U --user paramiko
     - pip install -U --user --use-pep517 git+
   desc: Installs galaxy collections and roles
   dir: "{{.USER_WORKING_DIR}}"
   cmds: [ansible-galaxy install -r requirements.yml]

While it may look complicated, it's pretty simple. From the top to the bottom it says. When run go-task Taskfile.yml install the default task. The default task depends on the following tasks, pips_needed, radssh_install, galaxy_needed. So it will run those in order to make sure it has everything it needs. The pips_needed task says use the current working directory and run these commands. In this case it's just a single command to pip install the requirements.txt file. The next section uses pip to make sure that paramiko and radssh is installed from github. Lastly the final task, galaxy_needed does the same thing as the first task but with ansible-galaxy rather than pip.

I have Taskfiles created for all of my most commonly used systems from RHEL to MacOS and everything in-between. If you need or want to use them let me know!