Skip to content

lab7: Ansible playbook deploying QuickNotes to Vagrant VM#1335

Open
1r444444 wants to merge 7 commits into
inno-devops-labs:mainfrom
1r444444:feature/lab7
Open

lab7: Ansible playbook deploying QuickNotes to Vagrant VM#1335
1r444444 wants to merge 7 commits into
inno-devops-labs:mainfrom
1r444444:feature/lab7

Conversation

@1r444444

@1r444444 1r444444 commented Jul 5, 2026

Copy link
Copy Markdown

Summary

  • Idempotent Ansible playbook (ansible/playbook.yaml) deploys QuickNotes to the Lab 5 Vagrant VM via become: true
  • Creates system user quicknotes, data directory /var/lib/quicknotes, copies static binary and seed.json, renders systemd unit from Jinja2 template, enables and starts the service
  • Handler restart quicknotes fires only when the binary or unit file changes
  • gather_facts: false — no facts needed since all values come from explicit variables

Test plan

  • First run: changed=7, service active (running), curl :18080/health{"notes":4,"status":"ok"}
  • Second run: changed=0 (full idempotency confirmed)
  • Variable tweak (listen_addr=:9090): only template task + handler changed (changed=2)
  • --check --diff with listen_addr=:7070: exact diff shown, no changes applied
  • All 7 design questions answered in submissions/lab7.md

1r444444 added 7 commits June 9, 2026 09:25
Signed-off-by: Irina <irina.bychkova06@mail.ru>
Signed-off-by: Irina <irina.bychkova06@mail.ru>
Ubuntu 22.04 (jammy64), Go 1.24.5 via shell provisioner, port forward
127.0.0.1:18080 -> guest:8080, VirtualBox shared folder for ./app,
2 vCPU / 1024 MB RAM.
Task 1 and Task 2 design questions answered; terminal output placeholders
left for VM execution; bonus comparison table scaffold included.
Switch provider to qemu (perk/ubuntu-2204-arm64) for Apple Silicon host.
Fill submission with actual vagrant up, curl, snapshot lifecycle outputs.
- ansible/playbook.yaml: idempotent deploy — system user, data dir,
  binary, seed.json, systemd unit via Jinja2 template, handler-driven restart
- ansible/inventory.ini: targets Lab 5 Vagrant VM (127.0.0.1:50022)
- ansible/templates/quicknotes.service.j2: unit template with env vars
- ansible/files/: static arm64 binary (CGO_ENABLED=0) + seed.json
- submissions/lab7.md: PLAY RECAPs, curl proof, all 7 design questions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant