Linux Labs

Automation: Git and Ansible / Stage 1 of 6

The history of configuration changes

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 6 · lab · 20 minmedium

The pricing service is down

After a night-time restart the pricing service does not start. Its settings live under git, and several people have edited them. Bring back the working settings without losing yesterday's needed change and without rewriting the history.

Situation

The lab-pricing service gives the shop front its prices and the list of warehouses. After a night-time restart it did not come back, and the shop front says "prices unavailable". The service settings live in /etc/pricing. That directory is a git repository: whoever edits the settings commits the change right there.

Yesterday Oleg added the Kazan warehouse to the settings. The shop front already shows it to customers, so this change is needed.

Task

  1. The lab-pricing service is running and answers: curl http://127.0.0.1:8180/health.
  2. pricing.ini holds the settings the service was running with before the restart, and the Kazan warehouse is in them.
  3. The history is not rewritten: the fix is a new commit on the main branch, and your colleagues' commits stay on it. In the end git status is clean.
  4. Do not change the service code or its unit.

The /etc/pricing directory belongs to root, so run git in it with sudo: sudo git -C /etc/pricing log. There is no internet on the machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 4
  • The lab-pricing service is running and answers http://127.0.0.1:8180/health — not done yet
  • The pricing.ini settings are the ones the service ran with before the restart — not done yet
  • The Kazan warehouse from yesterday's change is still in the settings — not done yet
  • The history is not rewritten — the fix is a new commit on main, git status is clean — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 4
  • The lab-pricing service is running and answers http://127.0.0.1:8180/health — not done yet
  • The pricing.ini settings are the ones the service ran with before the restart — not done yet
  • The Kazan warehouse from yesterday's change is still in the settings — not done yet
  • The history is not rewritten — the fix is a new commit on main, git status is clean — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 4
  • The lab-pricing service is running and answers http://127.0.0.1:8180/health — not done yet
  • The pricing.ini settings are the ones the service ran with before the restart — not done yet
  • The Kazan warehouse from yesterday's change is still in the settings — not done yet
  • The history is not rewritten — the fix is a new commit on main, git status is clean — not done yet
Loading…