I use ansible scripts to set up my environment (Ubuntu) in Amazon EC2 and a vagrant box. Then I try to set up the same environment at GermanVPS (Ubuntu Minimal). Installing packages with Apt doesn't seem to work.
I run
ansible-playbook -i ansible/live -u priidu ansible/caselaw.yml -s -vvvv --start-at-task="install"
which gives the following error.
failed: [master] => (item=postgresql-9.4,postgresql-contrib-9.4,postgresql-server-dev-9.4,python-psycopg2) => {"failed": true, "item": "postgresql-9.4,postgresql-contrib-9.4,postgresql-server-dev-9.4,python-psycopg2"}
stderr: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
msg: '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" install 'postgresql-server-dev-9.4' 'python-psycopg2'' failed: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
FATAL: all hosts have already failed -- aborting
Then I try
ansible-playbook -i ansible/live -u priidu ansible/caselaw.yml -s -vvvv --start-at-task="dpkg configure"
and I get the following error message
failed: [master] => (item=postgresql-9.4,postgresql-contrib-9.4,postgresql-server-dev-9.4,python-psycopg2) => {"failed": true, "item": "postgresql-9.4,postgresql-contrib-9.4,postgresql-server-dev-9.4,python-psycopg2", "parsed": false}
BECOME-SUCCESS-grensagvuewehoylwpjytnkzpwwqgsre
Killed
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/priidukull/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 51: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 54431
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 0
Shared connection to <<hostname>> closed.
FATAL: all hosts have already failed -- aborting
What is going on there and how can I start solving the puzzle?
Edit: The relevant part of my playbook
- name: dpkg configure
shell: dpkg --configure -a
- name: install
apt: name={{ item }} update_cache=yes
with_items:
- postgresql-9.4
- postgresql-contrib-9.4
- postgresql-server-dev-9.4
- python-psycopg2
Edit 2: Added the playbook commands.
Edit 3: The issue vanished when I increased RAM from 64MB to 512MB.
I met this issue when i try to install docker via ansible-playbook.
I'v try to increase the RAM from 512Mb to 1024Mb. But it didn't work.
And then I found the solution as below:
Anyway it works for me!