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

Installing haproxy again after teardown fails #60

Open
samuelallan72 opened this issue Dec 12, 2022 · 3 comments
Open

Installing haproxy again after teardown fails #60

samuelallan72 opened this issue Dec 12, 2022 · 3 comments
Labels
bug Something isn't working question Further information is requested triaged Triaged to be addressed in a given cycle

Comments

@samuelallan72
Copy link

Running the sequence of site.yaml, teardown.yaml, site.yaml playbooks results in:

er", "     Loaded: loaded (\u001b]8;;file://maas2/lib/systemd/system/haproxy.service\u0007/lib/systemd/system/haproxy.service\u001b]8;;\u0007; enabled; vendor preset: enabled
)", "     Active: activating (auto-restart) (Result: exit-code) since Mon 2022-12-12 02:06:11 UTC; 3ms ago", "       Docs: \u001b]8;;man:haproxy(1)\u0007man:haproxy(1)\u001b]
8;;\u0007", "             \u001b]8;;file:/usr/share/doc/haproxy/configuration.txt.gz\u0007file:/usr/share/doc/haproxy/configuration.txt.gz\u001b]8;;\u0007", "    Process: 284
95 ExecStartPre=/usr/sbin/haproxy -Ws -f $CONFIG -c -q $EXTRAOPTS \u001b[0;1;31m(code=exited, status=1/FAILURE)\u001b[0m", "dpkg: error processing package haproxy (--configur
e):", " installed haproxy package post-installation script subprocess returned error exit status 1", "Errors were encountered while processing:", " haproxy"]}

This seems to be because when haproxy is re-installed, it will be started immediately, and then fails with an error because the configuration file isn't found.

Suggested fix: move Write HAProxy Config task to before Install HAProxy task. This fixed the issue for me.

Or perhaps disable the haproxy service before tearing it down? Or some other way to prevent it from auto-starting on install?

@samuelallan72
Copy link
Author

Suggested fix: move Write HAProxy Config task to before Install HAProxy task. This fixed the issue for me.

Actually this may not be the best solution - this fails on a clean install:

TASK [maas_proxy : Write HAProxy Config] ***************************************
fatal: [192.168.122.217]: FAILED! => {"changed": false, "checksum": "8bca484491bcf78d8f07d00a8841ccb797b0391a", "msg": "Destination directory /etc/haproxy does not exist"}
fatal: [192.168.122.177]: FAILED! => {"changed": false, "checksum": "8bca484491bcf78d8f07d00a8841ccb797b0391a", "msg": "Destination directory /etc/haproxy does not exist"}
fatal: [192.168.122.139]: FAILED! => {"changed": false, "checksum": "8bca484491bcf78d8f07d00a8841ccb797b0391a", "msg": "Destination directory /etc/haproxy does not exist"}

@SK1Y101 SK1Y101 added the bug Something isn't working label Feb 3, 2023
@SK1Y101
Copy link
Member

SK1Y101 commented Aug 22, 2023

Hey @samuelengineer
Is this still an issue for you on the latest playbook version? We've had internal testing that deploys HA using these playbooks, so if there's something else we need to look into that would be great to know!

@SK1Y101 SK1Y101 added question Further information is requested triaged Triaged to be addressed in a given cycle labels Aug 22, 2023
@samuelallan72
Copy link
Author

@SK1Y101 sorry not sure, I haven't looked at this since last year. And I won't have time/resources to test again now I'm sorry. Feel free to close the bug. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested triaged Triaged to be addressed in a given cycle
Projects
None yet
Development

No branches or pull requests

2 participants