Linux Labs

Automation: Git and Ansible / Stage 2 of 6

Config from a repository: pull and conflicts

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 7 · lab · 20 minmedium

The server does not pick up changes

The developers pushed a change to the repository, but the server did not pick it up. Someone edited the settings by hand on the server last night, and that change is needed too. Update the working copy, keep both changes and push yours to the repository.

Situation

The shop settings are the shop.ini file in the shop-config repository. The developers edit it on their machines and push the changes to the /srv/git/shop-config.git repository, and the server picks them up by itself: the lab-shop-deploy service runs git pull in the /srv/shop-config working copy.

Yesterday the developers turned on the new checkout and pushed the change, yet shop.ini on the server still says new_checkout = off. And last night the on-call engineer edited the database settings on the server — the shop could not handle the load. That change is needed.

Task

  1. The /srv/shop-config working copy is at the latest version of the main branch from the repository.
  2. The on-call engineer's change is committed and pushed to the repository: the developers must see it.
  3. The developers' changes stay: do not rewrite the main history, and do not lose their settings in shop.ini.
  4. git status in the working copy is clean.
  5. The server update succeeds again — sudo systemctl start lab-shop-deploy, and the next one will too: the files of the working copy and the repository stay with student.

The working copy and the repository belong to you (student), and the update service runs as student too — run git here without sudo. 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 5
  • The /srv/shop-config working copy is at the latest main from the repository — not done yet
  • The on-call engineer's night-time change is committed and is on main in the repository — not done yet
  • The developers' changes are in place — the main history is not rewritten — not done yet
  • git status in the working copy is clean — not done yet
  • The lab-shop-deploy server update succeeds, and the files of the working copy and the repository belong to student — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 5
  • The /srv/shop-config working copy is at the latest main from the repository — not done yet
  • The on-call engineer's night-time change is committed and is on main in the repository — not done yet
  • The developers' changes are in place — the main history is not rewritten — not done yet
  • git status in the working copy is clean — not done yet
  • The lab-shop-deploy server update succeeds, and the files of the working copy and the repository belong to student — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 5
  • The /srv/shop-config working copy is at the latest main from the repository — not done yet
  • The on-call engineer's night-time change is committed and is on main in the repository — not done yet
  • The developers' changes are in place — the main history is not rewritten — not done yet
  • git status in the working copy is clean — not done yet
  • The lab-shop-deploy server update succeeds, and the files of the working copy and the repository belong to student — not done yet
Loading…