Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
4ba17d6d
Commit
4ba17d6d
authored
2 years ago
by
Zuul
Committed by
Gerrit Code Review
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge "loadbalancer: Use assert on checks for readability"
parents
ffa9c307
984612f0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/roles/loadbalancer/tasks/precheck.yml
+14
-12
14 additions, 12 deletions
ansible/roles/loadbalancer/tasks/precheck.yml
ansible/roles/prechecks/tasks/inventory_checks.yml
+6
-5
6 additions, 5 deletions
ansible/roles/prechecks/tasks/inventory_checks.yml
with
20 additions
and
17 deletions
ansible/roles/loadbalancer/tasks/precheck.yml
+
14
−
12
View file @
4ba17d6d
...
...
@@ -65,14 +65,14 @@
-
not kolla_externally_managed_cert | bool
-
kolla_enable_tls_external | bool
-
name
:
Fail if
external haproxy certificate
is absent
-
name
:
Assert that
external haproxy certificate
exists
run_once
:
true
fail
:
msg
:
"
External
haproxy
certificate
file
is
not
found.
It
is
configured
via
'kolla_external_fqdn_cert'"
assert
:
that
:
haproxy_cert_file.stat.exists
fail_msg
:
"
External
haproxy
certificate
file
is
not
found.
It
is
configured
via
'kolla_external_fqdn_cert'"
when
:
-
not kolla_externally_managed_cert | bool
-
kolla_enable_tls_external | bool
-
not haproxy_cert_file.stat.exists
-
name
:
Checking if internal haproxy certificate exists
run_once
:
true
...
...
@@ -85,26 +85,28 @@
-
not kolla_externally_managed_cert | bool
-
kolla_enable_tls_internal | bool
-
name
:
Fail if
internal haproxy certificate
is absent
-
name
:
Assert that
internal haproxy certificate
exists
run_once
:
true
fail
:
msg
:
"
Internal
haproxy
certificate
file
is
not
found.
It
is
configured
via
'kolla_internal_fqdn_cert'"
assert
:
that
:
haproxy_internal_cert_file.stat.exists
fail_msg
:
"
Internal
haproxy
certificate
file
is
not
found.
It
is
configured
via
'kolla_internal_fqdn_cert'"
when
:
-
not kolla_externally_managed_cert | bool
-
kolla_enable_tls_internal | bool
-
not haproxy_internal_cert_file.stat.exists
-
name
:
Checking the kolla_external_vip_interface is present
fail
:
"
msg='Please
check
the
kolla_external_vip_interface
property
-
interface
{{
kolla_external_vip_interface
}}
not
found'"
assert
:
that
:
kolla_external_vip_interface in ansible_facts.interfaces
fail_msg
:
"
Please
check
the
kolla_external_vip_interface
property
-
interface
{{
kolla_external_vip_interface
}}
not
found"
when
:
-
haproxy_enable_external_vip | bool
-
kolla_external_vip_interface not in ansible_facts.interfaces
-
name
:
Checking the kolla_external_vip_interface is active
fail
:
"
msg='Please
check
the
kolla_external_vip_interface
settings
-
interface
{{
kolla_external_vip_interface
}}
is
not
active'"
assert
:
that
:
hostvars[inventory_hostname].ansible_facts[kolla_external_vip_interface]['active']
fail_msg
:
"
Please
check
the
kolla_external_vip_interface
settings
-
interface
{{
kolla_external_vip_interface
}}
is
not
active"
when
:
-
haproxy_enable_external_vip | bool
-
not hostvars[inventory_hostname].ansible_facts[kolla_external_vip_interface]['active']
# NOTE(hrw): let assume that each supported host OS has ping with ipv4/v6 support
-
name
:
Checking if kolla_internal_vip_address and kolla_external_vip_address are not pingable from any node
...
...
This diff is collapsed.
Click to expand it.
ansible/roles/prechecks/tasks/inventory_checks.yml
+
6
−
5
View file @
4ba17d6d
---
-
name
:
Fail if group loadbalancer not exists or it is empty
fail
:
msg
:
>-
-
name
:
Checking loadbalancer group
assert
:
that
:
-
groups['loadbalancer'] is defined
-
groups['loadbalancer'] | length >
0
fail_msg
:
>-
Inventory's group loadbalancer does not exist or it is empty.
Please update inventory, as haproxy group was renamed
to loadbalancer in the Xena release.
when
:
-
enable_loadbalancer | bool
-
groups['loadbalancer'] is not defined or
groups['loadbalancer'] | length <
1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment