Skip to content

Commit

Permalink
Merge pull request #63 from enix/haproxy_migration_dry_run_fix
Browse files Browse the repository at this point in the history
Fix dry-run of haproxy migration path
  • Loading branch information
Zempashi authored Dec 13, 2023
2 parents 24093b6 + dd0becd commit 01bc83b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/apiserver_haproxy_upgrade/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
service:
name: haproxy
state: reloaded
when: not(_haproxy_repo_just_added is changed and ansible_check_mode)

rescue:
- name: "Restart compose stack if error occured"
Expand Down
1 change: 1 addition & 0 deletions tests/features/haproxy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Feature: Haproxy
When With those group_vars on group all:
apiserver_proxy_use_docker: false
When I reset tasks counters
When I dry-run the playbooks 00_apiserver_proxy.yml
When I run the playbooks 00_apiserver_proxy.yml
01_site.yml
Then I should have a working cluster
2 changes: 2 additions & 0 deletions tests/helpers/ansible.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import itertools
import os
import re

import ansible_runner

Expand Down Expand Up @@ -56,5 +57,6 @@ def run_ansible_playbook(

def assert_ansible_error(run):
assert run.status == "successful"
assert len(re.findall(r".*fatal: .*", run.stdout.read())) == 0
for host_failed, number_failed in run.stats.get("failures", {}).items():
assert number_failed == 0

0 comments on commit 01bc83b

Please sign in to comment.