Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
w3irdrobot opened this issue Apr 14, 2020 · 7 comments
Closed

Comments

@w3irdrobot
Copy link

w3irdrobot commented Apr 14, 2020

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.

@MacFlurry
Copy link

MacFlurry commented Apr 17, 2020

didn't find any issue with it.
can you post your ansible output with -vvvv?

@w3irdrobot
Copy link
Author

w3irdrobot commented Apr 18, 2020

TASK [geerlingguy.haproxy : Ensure HAProxy is installed.] ******************************************************************************************************************************************************
task path: /Users/myname/.ansible/roles/geerlingguy.haproxy/tasks/main.yml:2
Running apt
<192.168.4.2> ESTABLISH SSH CONNECTION FOR USER: vagrant
<192.168.4.2> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/myname/.vagrant.d/insecure_private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="vagrant"' -o ConnectTimeout=10 -o ControlPath=/Users/myname/.ansible/cp/7a9acab775 192.168.4.2 '/bin/sh -c '"'"'echo ~vagrant && sleep 0'"'"''
<192.168.4.2> (0, '/home/vagrant\n', 'OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /Users/myname/.ssh/config\r\ndebug1: /Users/myname/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /usr/local/etc/ssh/ssh_config\r\ndebug2: resolve_canonicalize: hostname 192.168.4.2 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 77457\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<192.168.4.2> ESTABLISH SSH CONNECTION FOR USER: vagrant
<192.168.4.2> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/myname/.vagrant.d/insecure_private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="vagrant"' -o ConnectTimeout=10 -o ControlPath=/Users/myname/.ansible/cp/7a9acab775 192.168.4.2 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679 `" && echo ansible-tmp-1587231876.76-223526646995679="` echo /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679 `" ) && sleep 0'"'"''
<192.168.4.2> (0, 'ansible-tmp-1587231876.76-223526646995679=/home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679\n', 'OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /Users/myname/.ssh/config\r\ndebug1: /Users/myname/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /usr/local/etc/ssh/ssh_config\r\ndebug2: resolve_canonicalize: hostname 192.168.4.2 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 77457\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
Using module file /usr/local/lib/python2.7/site-packages/ansible/modules/packaging/os/apt.py
<192.168.4.2> PUT /Users/myname/.ansible/tmp/ansible-local-77567hSAQqz/tmpp2MIua TO /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679/AnsiballZ_apt.py
<192.168.4.2> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/myname/.vagrant.d/insecure_private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="vagrant"' -o ConnectTimeout=10 -o ControlPath=/Users/myname/.ansible/cp/7a9acab775 '[192.168.4.2]'
<192.168.4.2> (0, 'sftp> put /Users/myname/.ansible/tmp/ansible-local-77567hSAQqz/tmpp2MIua /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679/AnsiballZ_apt.py\n', 'OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /Users/myname/.ssh/config\r\ndebug1: /Users/myname/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /usr/local/etc/ssh/ssh_config\r\ndebug2: resolve_canonicalize: hostname 192.168.4.2 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 77457\r\ndebug3: mux_client_request_session: session request sent\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "posix-rename@openssh.com" revision 1\r\ndebug2: Server supports extension "statvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "fstatvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "hardlink@openssh.com" revision 1\r\ndebug2: Server supports extension "fsync@openssh.com" revision 1\r\ndebug3: Sent message fd 8 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -> /home/vagrant size 0\r\ndebug3: Looking up /Users/myname/.ansible/tmp/ansible-local-77567hSAQqz/tmpp2MIua\r\ndebug3: Sent message fd 8 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679/AnsiballZ_apt.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:7 O:98304 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:8 O:131072 S:11877\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 32768 bytes at 65536\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 7 32768 bytes at 98304\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 8 11877 bytes at 131072\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<192.168.4.2> ESTABLISH SSH CONNECTION FOR USER: vagrant
<192.168.4.2> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/myname/.vagrant.d/insecure_private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="vagrant"' -o ConnectTimeout=10 -o ControlPath=/Users/myname/.ansible/cp/7a9acab775 192.168.4.2 '/bin/sh -c '"'"'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679/ /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679/AnsiballZ_apt.py && sleep 0'"'"''
<192.168.4.2> (0, '', 'OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /Users/myname/.ssh/config\r\ndebug1: /Users/myname/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /usr/local/etc/ssh/ssh_config\r\ndebug2: resolve_canonicalize: hostname 192.168.4.2 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 77457\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<192.168.4.2> ESTABLISH SSH CONNECTION FOR USER: vagrant
<192.168.4.2> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/myname/.vagrant.d/insecure_private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="vagrant"' -o ConnectTimeout=10 -o ControlPath=/Users/myname/.ansible/cp/7a9acab775 -tt 192.168.4.2 '/bin/sh -c '"'"'sudo -H -S -n  -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-zsjtidifeqsebamfwrwfntdzpgbavqgk ; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679/AnsiballZ_apt.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
<192.168.4.2> (1, '\r\n{"cache_updated": false, "stdout": "Reading package lists...\\nBuilding dependency tree...\\nReading state information...\\nThe following packages were automatically installed and are no longer required:\\n  python-asn1crypto python-cffi-backend python-crypto python-cryptography\\n  python-enum34 python-httplib2 python-idna python-ipaddress python-jinja2\\n  python-markupsafe python-paramiko python-pkg-resources python-pyasn1\\n  python-setuptools python-six python-yaml sshpass\\nUse \'sudo apt autoremove\' to remove them.\\nThe following additional packages will be installed:\\n  liblua5.3-0\\nSuggested packages:\\n  vim-haproxy haproxy-doc\\nThe following NEW packages will be installed:\\n  haproxy liblua5.3-0\\n0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.\\nNeed to get 1117 kB/1231 kB of archives.\\nAfter this operation, 2842 kB of additional disk space will be used.\\nIgn:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 haproxy amd64 1.8.8-1ubuntu0.9\\nErr:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 haproxy amd64 1.8.8-1ubuntu0.9\\n  404  Not Found [IP: 91.189.91.38 80]\\n", "failed": true, "stderr": "E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/h/haproxy/haproxy_1.8.8-1ubuntu0.9_amd64.deb  404  Not Found [IP: 91.189.91.38 80]\\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\\n", "rc": 100, "invocation": {"module_args": {"dpkg_options": "force-confdef,force-confold", "autoremove": false, "force": false, "force_apt_get": false, "policy_rc_d": null, "package": ["haproxy"], "autoclean": false, "install_recommends": null, "name": "haproxy", "purge": false, "allow_unauthenticated": false, "state": "present", "upgrade": null, "update_cache": null, "default_release": null, "only_upgrade": false, "deb": null, "cache_valid_time": 0}}, "cache_update_time": 1584982268, "msg": "\'/usr/bin/apt-get -y -o \\"Dpkg::Options::=--force-confdef\\" -o \\"Dpkg::Options::=--force-confold\\"      install \'haproxy\'\' failed: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/h/haproxy/haproxy_1.8.8-1ubuntu0.9_amd64.deb  404  Not Found [IP: 91.189.91.38 80]\\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\\n"}\r\n', 'OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /Users/myname/.ssh/config\r\ndebug1: /Users/myname/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /usr/local/etc/ssh/ssh_config\r\ndebug2: resolve_canonicalize: hostname 192.168.4.2 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 77457\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to 192.168.4.2 closed.\r\n')
<192.168.4.2> Failed to connect to the host via ssh: OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /Users/myname/.ssh/config
debug1: /Users/myname/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname 192.168.4.2 is address
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 = 77457
debug3: mux_client_request_session: session request sent
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
Shared connection to 192.168.4.2 closed.
<192.168.4.2> ESTABLISH SSH CONNECTION FOR USER: vagrant
<192.168.4.2> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/myname/.vagrant.d/insecure_private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="vagrant"' -o ConnectTimeout=10 -o ControlPath=/Users/myname/.ansible/cp/7a9acab775 192.168.4.2 '/bin/sh -c '"'"'rm -f -r /home/vagrant/.ansible/tmp/ansible-tmp-1587231876.76-223526646995679/ > /dev/null 2>&1 && sleep 0'"'"''
<192.168.4.2> (0, '', 'OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /Users/myname/.ssh/config\r\ndebug1: /Users/myname/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /usr/local/etc/ssh/ssh_config\r\ndebug2: resolve_canonicalize: hostname 192.168.4.2 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 77457\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
fatal: [192.168.4.2]: FAILED! => {
    "cache_update_time": 1584982268,
    "cache_updated": false,
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "force": false,
            "force_apt_get": false,
            "install_recommends": null,
            "name": "haproxy",
            "only_upgrade": false,
            "package": [
                "haproxy"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": null,
            "upgrade": null
        }
    },
    "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"      install 'haproxy'' failed: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/h/haproxy/haproxy_1.8.8-1ubuntu0.9_amd64.deb  404  Not Found [IP: 91.189.91.38 80]\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n",
    "rc": 100,
    "stderr": "E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/h/haproxy/haproxy_1.8.8-1ubuntu0.9_amd64.deb  404  Not Found [IP: 91.189.91.38 80]\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n",
    "stderr_lines": [
        "E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/h/haproxy/haproxy_1.8.8-1ubuntu0.9_amd64.deb  404  Not Found [IP: 91.189.91.38 80]",
        "E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?"
    ],
    "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following packages were automatically installed and are no longer required:\n  python-asn1crypto python-cffi-backend python-crypto python-cryptography\n  python-enum34 python-httplib2 python-idna python-ipaddress python-jinja2\n  python-markupsafe python-paramiko python-pkg-resources python-pyasn1\n  python-setuptools python-six python-yaml sshpass\nUse 'sudo apt autoremove' to remove them.\nThe following additional packages will be installed:\n  liblua5.3-0\nSuggested packages:\n  vim-haproxy haproxy-doc\nThe following NEW packages will be installed:\n  haproxy liblua5.3-0\n0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.\nNeed to get 1117 kB/1231 kB of archives.\nAfter this operation, 2842 kB of additional disk space will be used.\nIgn:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 haproxy amd64 1.8.8-1ubuntu0.9\nErr:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 haproxy amd64 1.8.8-1ubuntu0.9\n  404  Not Found [IP: 91.189.91.38 80]\n",
    "stdout_lines": [
        "Reading package lists...",
        "Building dependency tree...",
        "Reading state information...",
        "The following packages were automatically installed and are no longer required:",
        "  python-asn1crypto python-cffi-backend python-crypto python-cryptography",
        "  python-enum34 python-httplib2 python-idna python-ipaddress python-jinja2",
        "  python-markupsafe python-paramiko python-pkg-resources python-pyasn1",
        "  python-setuptools python-six python-yaml sshpass",
        "Use 'sudo apt autoremove' to remove them.",
        "The following additional packages will be installed:",
        "  liblua5.3-0",
        "Suggested packages:",
        "  vim-haproxy haproxy-doc",
        "The following NEW packages will be installed:",
        "  haproxy liblua5.3-0",
        "0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.",
        "Need to get 1117 kB/1231 kB of archives.",
        "After this operation, 2842 kB of additional disk space will be used.",
        "Ign:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 haproxy amd64 1.8.8-1ubuntu0.9",
        "Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 haproxy amd64 1.8.8-1ubuntu0.9",
        "  404  Not Found [IP: 91.189.91.38 80]"
    ]
}

@MacFlurry
Copy link

MacFlurry commented Apr 18, 2020

weird, seems like the package is updated from :
http://security.ubuntu.com/ubuntu/pool/main/h/haproxy/haproxy_1.8.8-1ubuntu0.9_amd64.deb
to
http://security.ubuntu.com/ubuntu/pool/main/h/haproxy/haproxy_1.8.8-1ubuntu0.10_amd64.deb

@w3irdrobot
Copy link
Author

w3irdrobot commented Apr 18, 2020

Could that be caused by an update in the underlying Vagrant image?

@MacFlurry
Copy link

MacFlurry commented Apr 18, 2020

probably :
@geerlingguy
Wouldn't it be better to use the module dedicated to OS package managers and update the cache for Ubuntu?
In the tasks/main.yml of the haproxy role, the generic package is used:

- name: Ensure HAProxy is installed.
  package: name=haproxy state=present

@geerlingguy
Copy link
Owner

geerlingguy commented 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)

@geerlingguy geerlingguy changed the title HAProxy not found HAProxy not found because apt cache not up to date (deployments-balancer) Apr 20, 2020
@MacFlurry
Copy link

MacFlurry commented Apr 20, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants