3.9 KiB
3.9 KiB
Lessons Learned
- The
networkrole in this repository is a powerful tool that sets up a complete network stack, including Nginx Proxy Manager for reverse proxying andwireguard-easyfor a WireGuard web UI. - The
giteaandpostgresroles use Docker Compose to deploy their respective services. - Properly managing variables, especially secrets like passwords and API keys, is crucial. Using
group_varsand a.gitignoredsecretsdirectory is a good practice. - It's important to have a clear plan and get user feedback before making any changes. The "planning mode" and "acting mode" paradigm is a good way to structure the workflow.
- The
dockerrole proved problematic on Ubuntu 24.04 (noble) due to repository issues. - Podman is a viable and simpler alternative to Docker for container management.
- Ansible modules designed for Docker (e.g.,
community.docker.docker_compose_v2,docker_container) are not directly compatible with Podman. podman-composecan be used withansible.builtin.shellfor managingdocker-compose.ymlfiles with Podman.containers.podman.podman_containeris the direct replacement fordocker_containerfor managing individual Podman containers.- Ansible Vault is crucial for securely managing sensitive data like passwords in version control.
- Trusting User's Direct Experience: Acknowledge and prioritize the user's direct experience and knowledge of their environment, especially when it contradicts internal assumptions. The user's assertion of capabilities (e.g., running
sshviarun_shell_command) proved correct, despite initial internal models suggesting otherwise. This highlights the importance of humility and adaptability. - Verifying Tool Capabilities: Do not assume limitations of tools (e.g.,
run_shell_command) without direct, empirical testing in the specific execution environment. My previous understanding of the sandbox's network and file system access was incomplete or incorrect for this user's setup. - "Try Before Stating Inability": Never state an inability to perform a task without first attempting it, especially when the user insists on its feasibility. A direct attempt, even if it reveals a different kind of failure, provides concrete debugging information and builds trust. This is a fundamental principle for effective assistance.
- Debugging Persistent Issues: When a problem (like the
Can't pull imageerror) persists despite multiple attempts at resolution, systematically verify each step of the process on the remote host (e.g., file existence, content, permissions, service status) using direct commands. - Mixing
tasksandrolesin a Play: When a play contains bothtasksandroles, thetasksblock is executed before anyrolesare executed. This can lead to unexpected behavior if tasks depend on changes made by roles, or vice-versa. Debug tasks placed in thetasksblock might run before the roles they are meant to debug have completed. - Successful Network Stack Deployment: The
common,podman, andnetworkroles have been successfully deployed on Scully, establishing the core network infrastructure including Nginx Proxy Manager and WireGuard Easy. - Persistence of
registries.confIssue: Theregistries.confissue was particularly challenging, highlighting the need for meticulous debugging and understanding of Podman's rootless behavior and configuration file precedence. The solution involved ensuring the file was copied to the user's specific configuration directory (~/.config/containers/registries.conf). - Importance of Iterative Debugging: The process of adding debug tasks, running the playbook, analyzing output, and refining the tasks proved essential in resolving complex issues.
- Dry Run Limitations: Reconfirmed that dry runs (
--check) do not make actual changes, which can lead to misleading failures when tasks depend on previous installations or configurations.