Skip to content

Commit 948c6fd

Browse files
committed
feat: add comprehensive progress tracking for Ansible playbooks
Improve visibility during long-running operations in GitHub Actions: - Enable timer and profile_tasks callbacks in ansible.cfg - Add -v verbose flag to ansible-playbook commands - Add progress messages at key Docker installation stages - Show retry/timeout configuration and fallback strategy - Increase GitHub Actions timeout from 30 to 45 minutes - Add workflow timing with start/end timestamps This helps identify bottlenecks and shows real-time progress during Docker installation, especially useful for debugging CI timeouts.
1 parent 00366ab commit 948c6fd

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

.github/workflows/test-e2e.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
jobs:
1919
e2e-tests:
2020
runs-on: ubuntu-latest
21-
timeout-minutes: 30 # Increased timeout for better network reliability in CI
21+
timeout-minutes: 45 # Increased timeout to account for slower GitHub runners
2222

2323
steps:
2424
- name: Checkout repository
@@ -59,7 +59,9 @@ jobs:
5959
run: |
6060
# Run the E2E test with verbose output for better debugging
6161
# Use sudo -E and preserve PATH to ensure cargo is accessible
62+
echo "🚀 Starting E2E test at $(date)"
6263
sudo -E env "PATH=$PATH" cargo run --bin e2e-tests -- --verbose
64+
echo "✅ E2E test completed at $(date)"
6365
env:
6466
# Preserve environment variables for the E2E test
6567
RUST_LOG: debug

src/command_wrappers/ansible.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ impl AnsibleClient {
5757

5858
let playbook_file = format!("{playbook}.yml");
5959

60+
// Use -v flag for verbose output showing task progress
61+
// This helps track progress during long-running operations like Docker installation
6062
self.command_executor.run_command(
6163
"ansible-playbook",
62-
&[&playbook_file],
64+
&["-v", &playbook_file],
6365
Some(&self.working_dir),
6466
)
6567
}

templates/ansible/ansible.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ host_key_checking = False
2424
stdout_callback = debug
2525
stderr_callback = debug
2626

27+
# Enable progress display for long-running tasks
28+
# Shows task progress and timing information
29+
callback_enabled = timer, profile_tasks
30+
31+
# Display task timing information
32+
show_task_path_on_failure = True
33+
2734
# Set connection timeout in seconds
2835
# How long to wait for SSH connections before giving up
2936
timeout = 30

templates/ansible/install-docker.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,16 @@
3737
# NOTE: APT cache update logic has been moved to update-apt-cache.yml
3838
# Run that playbook first if you need to update the package cache
3939

40-
# Task 0: Set robust retry/timeout defaults for all environments
40+
# Task 0a: Display progress message
41+
- name: 🐳 Starting Docker installation with robust network handling
42+
ansible.builtin.debug:
43+
msg:
44+
- "🚀 Starting Docker CE installation on {{ inventory_hostname }}"
45+
- "📋 This playbook includes 6 fallback mechanisms for network issues"
46+
- "⏱️ Configured with {{ network_retries | default(8) }} retries, {{ network_delay | default(45) }}s delays, {{ network_timeout | default(120) }}s timeouts"
47+
- "🔗 Will attempt: get_url → curl → aria2 → embedded key → apt repos → snap"
48+
49+
# Task 0b: Set robust retry/timeout defaults for all environments
4150
- name: Set network operation defaults
4251
ansible.builtin.set_fact:
4352
network_timeout: 120 # 2 minutes timeout for individual operations
@@ -75,6 +84,13 @@
7584
ignore_errors: true # Don't fail if aria2 is not available
7685

7786
# Task 2: Add Docker's official GPG key with retries and better error handling
87+
- name: 🔑 Starting Docker GPG key installation with fallbacks
88+
ansible.builtin.debug:
89+
msg:
90+
- "🔑 Attempting to download Docker GPG key from download.docker.com"
91+
- "🔄 Will try {{ network_retries }} times with {{ network_delay }}s delays if needed"
92+
- "⚠️ If download fails, will use embedded GPG key as fallback"
93+
7894
- name: Create keyrings directory
7995
ansible.builtin.file:
8096
path: /etc/apt/keyrings
@@ -248,6 +264,16 @@
248264
register: docker_repo_added
249265

250266
# Task 4: Install Docker packages with retries (only if repository was added)
267+
- name: 🐳 Installing Docker packages from official repository
268+
ansible.builtin.debug:
269+
msg:
270+
- "🐳 Installing Docker CE packages from official repository"
271+
- "📦 Package: {{ docker_package }}"
272+
- "🔄 Will retry up to 3 times if installation fails"
273+
when:
274+
- ansible_os_family == "Debian"
275+
- docker_gpg_final_check.stat.exists
276+
251277
- name: Install Docker packages
252278
ansible.builtin.apt:
253279
name:

0 commit comments

Comments
 (0)