question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HAProxy not found because apt cache not up to date (deployments-balancer)

See original GitHub issue

When running the playbook for the “Deploying to app servers behind a load balancer” in chapter 9, the HAProxy role errors out because it can’t find haproxy package. I had to run ansible deployments -i inventory -a "sudo apt-get update" to update the apt cache and then ran the playbook again. It worked this time around. Might want to update the instructions to add that as a step somehow.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
MacFlurrycommented, Apr 20, 2020

Yeah sure, make sense on using package in that case. no pb 🥰

0reactions
geerlingguycommented, Apr 20, 2020

@searsaw - Are you using this playbook? https://github.com/geerlingguy/ansible-for-devops/blob/master/deployments-balancer/playbooks/provision.yml

Almost every time I build a playbook for Ubuntu or Debian, I add a pre_tasks section with an apt cache update task. But it looks like I didn’t add that in this case. The example’s also using Ubuntu 14.04 currently, which is a bit out of date (I thought I had updated all examples to use at least 16.04!).

I will need to get this example updated to make it work better out of the box.

And @MacFlurry - sometimes I use a different module (like package in this case) to show how it can be done; in this case, I believe the haproxy package is the same across RHEL and Deb/Ubuntu, so using package is a more cross-platform-compatible way instead of specifying apt. (And thus why I usually have a separate task that manages apt caches, like here: https://github.com/geerlingguy/ansible-role-apache/blob/17af52011a07fd218eb740f861b3a70976d8f1cc/molecule/default/converge.yml#L14-L18)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common HAProxy Errors - DigitalOcean
This tutorial series explains how to troubleshoot and fix some of the most common errors that you may encounter when using the HAProxy...
Read more >
Accelerate Your APIs by Using the HAProxy Cache
HAProxy's cache, which is known as a proxy cache, will speed it up for all users because once a resource is cached in...
Read more >
haproxy.service start failed when I set up load balancer on the ...
Since my Apache web server is listening on Port 80, therefore I cannot configure the same for my HAProxy. Changed it to another...
Read more >
HAProxy known bugs for version v2.4.4 (maintenance branch ...
20. If your version is not the last one in the maintenance branch, you are missing fixes for known bugs, and by not...
Read more >
Install haproxy 1.5 without telling apt specific version
installs haproxy 1.4, while 1.5 is in the repository. How can I install haproxy 1.5 (or the newest) without resorting to specific versions?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found