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

feat(ansible): optimize HAProxy service management in playbook #91

Draft
wants to merge 1 commit into
base: feat/v1.29.3-rev.2
Choose a base branch
from

Conversation

smerlos
Copy link

@smerlos smerlos commented Jul 31, 2024

This PR introduces optimized tasks for managing the HAProxy service in the Ansible playbook.

Changes:

  1. Check HAProxy installation

    • Verified the existence of /etc/haproxy/haproxy.cfg.
    • Registered the result to determine if HAProxy is installed.
  2. Check current state of HAProxy service

    • Used the systemd module to check if the HAProxy service is started.
    • Registered the service status for conditional operations.
  3. Ensure HAProxy is enabled and running

    • Added a task to enable and start HAProxy if it is installed but not currently running.
  4. Restart HAProxy if not previously installed

    • Implemented a task to restart HAProxy with daemon reload if it was not previously installed.
  5. Reload HAProxy if already installed and running

    • Added a task to reload HAProxy to apply configuration changes if it is already installed and running.

Rationale:

These changes improve the robustness and reliability of the HAProxy service management by:

  • Ensuring that the service is properly enabled and started when required.
  • Reducing redundancy in task execution.
  • Handling different states of the HAProxy service more accurately to prevent potential downtimes and inconsistencies.

Closing the Issue with PR

Closing Issue:

Closes #90

@smerlos smerlos marked this pull request as draft July 31, 2024 14:33
@nutellinoit nutellinoit changed the base branch from main to feat/v1.29.3-rev.2 August 5, 2024 16:40
Copy link
Member

@nutellinoit nutellinoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this PR ready? I changed the target base to feat/v1.29.3-rev.2

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

Successfully merging this pull request may close these issues.

Optimize HAProxy Service Management in Ansible Playbook
2 participants