Turn a CSV Inventory into JSON

medium 20 XP ~8 minHands-on lab Pro

An automation tool needs the server inventory /srv/lab/inventory/hosts.csv as JSON.

Task

Write /home/student/hosts.json: a JSON array with one object per data row (skip the header), in the original order. Each object has:

  • name: text
  • ip: text
  • port: a number, not text
  • tags: an array of texts, from the tags column, which separates them with ; (an empty column gives [])
  • env: always "staging"

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

TerminalNot started

Your machine is ready to start

Create a free account to open a machine and get graded.