Access problem when re-provisioning a remote server


I previously provisioned a remote server with some previous release of bedrock-ansible. I’ve now fetched the latest changes from the bedrock-ansible repository, and tried to re-provision my environments.

The Vagrant machine was provisoned successfully, while

ansible-playbook -i hosts/staging server.yml

does not go beyond “Gathering facts”, and errors out with

msg: Failed to lock apt for exclusive operation

My remote server root user is admin (and not root), so I adjusted remote_user parameter in server.yml accordingly.

The same ssh key forwarded to the Vagrant VM is also loaded on the remote for the admin user.

I will be grateful for a hint on what might be causing the issue.

Now that I have run the SUDO ansible-playbook -i hosts/staging server.yml -vvvv , I got these messages:

fatal: [] => SSH encountered an unknown error. The output was:
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket “/home/ltarasiewicz/.ansible/cp/ansible-ssh-” does not exist
debug2: ssh_connect: needpriv 0
debug1: Connecting to [] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address port 22: Connection timed out
ssh: connect to host port 22: Connection timed out

How can I configure my ssh to use with remote servers with bedrock-ansible (I guess this is the problem).

You’re on the right track.

You just need to add sudo: True to server.yml.

Thanks @swalkinshaw, such a trivial thing to miss :wink: