Skip to content

Add verbosity levels to configure command #363

@josecelano

Description

@josecelano

Overview

Add graduated verbosity levels (-v, -vv, -vvv) to the configure command following the same pattern established by the provision command (task 8.1, PR #361).

This will show configuration steps, Ansible operations, and system changes at different detail levels, giving users control over progress visibility during infrastructure configuration.

Specification

See detailed specification: docs/issues/363-add-verbosity-levels-to-configure-command.md

Implementation Plan

Phase 1: Handler Integration (1-2 hours)

  • Update ConfigureCommandHandler::execute() to accept Option<&dyn CommandProgressListener>
  • Add on_step_started() calls for each configuration step
  • Pass listener through to individual configuration steps
  • Update controller to pass listener from UserOutput to handler

Phase 2: Step-Level Progress (2-3 hours)

  • Update configuration step execute() methods to accept listener parameter
  • Add on_detail() calls in each step for context (versions, ports, status)
  • Add on_debug() calls for Ansible execution details (commands, playbooks, paths)
  • Manual test with -vv and -vvv flags

Phase 3: Testing and Documentation (1-2 hours)

  • Manual testing with all verbosity levels
  • Verify output readability at all levels
  • Update user guide documentation
  • Verify help text includes verbosity examples

Total Estimated Time: 4-7 hours

Example Output

Normal (default)

⏳ [2/3] Configuring provisioned infrastructure...
⏳   ✓ Infrastructure configured (took 18.3s)

Verbose (-v)

⏳ [2/3] Configuring provisioned infrastructure...
📋   [Step 1/7] Rendering Ansible templates...
📋   [Step 2/7] Installing Docker...
📋   [Step 3/7] Installing Docker Compose...
📋   [Step 4/7] Configuring firewall (UFW)...
📋   [Step 5/7] Setting up automatic security updates...
📋   [Step 6/7] Creating application directory structure...
📋   [Step 7/7] Setting directory permissions...
⏳   ✓ Infrastructure configured (took 18.3s)

VeryVerbose (-vv)

📋   [Step 2/7] Installing Docker...
      → Installing Docker Engine from official repository
      → Docker version: 24.0.7
📋   [Step 4/7] Configuring firewall (UFW)...
      → Allowing SSH port 22
      → Allowing HTTP port 80, HTTPS port 443
      → Firewall status: active

Debug (-vvv)

📋   [Step 2/7] Installing Docker...
🔍      → Ansible working directory: ./build/my-env/ansible
🔍      → Executing playbook: ansible-playbook install-docker.yml -i inventory.ini
🔍      → Playbook completed successfully
      → Docker version: 24.0.7

Acceptance Criteria

Quality Checks:

  • Pre-commit checks pass: ./scripts/pre-commit.sh
  • All existing tests pass
  • No clippy warnings

Task-Specific:

  • Configure command accepts -v, -vv, -vvv flags
  • Default behavior unchanged (backward compatible)
  • Verbose level shows all configuration steps
  • VeryVerbose level shows Ansible task details
  • Debug level shows Ansible commands and paths
  • Output clean and readable at all levels
  • Pattern matches provision command (consistency)

Related

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions