Skip to content
ohsudo, Home

Articles

Infrastructure as Code

Terraform and Ansible errors explained: stuck state locks and unreachable hosts, how to find the cause and fix it safely.

Missing sudo password
Infrastructure as Code

Ansible "Missing sudo password": give it the password safely, or allow the user properly

Fix Ansible "Missing sudo password": use --ask-become-pass, ansible-vault for the become password, or NOPASSWD in sudoers, plus "Incorrect sudo password" and timeouts.

Beginner · 4 min read

Inconsistent dependency lock file
Infrastructure as Code

Terraform "Inconsistent dependency lock file": what to run, and what to commit

Fix Terraform "Inconsistent dependency lock file": run init or init -upgrade, resolve version constraints and checksum errors across platforms, and lock it down in CI.

Beginner · 4 min read

UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh
Infrastructure as Code

Ansible "UNREACHABLE! Failed to connect to the host via ssh": find the real SSH error

Fix Ansible UNREACHABLE: read the SSH error in the message, check the inventory, reproduce with -vvv and plain ssh, then fix keys, users or host keys.

Beginner · 4 min read

Error: Error acquiring the state lock
Infrastructure as Code

Terraform "Error acquiring the state lock": who holds it, and when force-unlock is safe

Fix Terraform and OpenTofu "Error acquiring the state lock": read the lock info, wait or find the running job, and use force-unlock only on a stale lock.

Intermediate · 4 min read