Skip to content
Snippets Groups Projects
Commit 67e457eb authored by ale's avatar ale
Browse files

Add checks to verify that the plugin has been loaded

Provides a nice error message to the user: otherwise the only
sign that something went wrong is a series of warnings from
Ansible about the inventory, and then presumably some undefined
variable errors later on...
parent fbb1e767
Branches
No related tags found
1 merge request!68Add checks to verify that the plugin has been loaded
Pipeline #5043 failed
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
gather_facts: no gather_facts: no
become: no become: no
tasks: tasks:
# Check that "float" is properly set up.
- include_role: float-plugin-check
# Create the paths below credentials_dir that we're going to use. # Create the paths below credentials_dir that we're going to use.
- name: "Create paths below {{ credentials_dir }}" - name: "Create paths below {{ credentials_dir }}"
file: file:
......
...@@ -530,6 +530,7 @@ def run_scheduler(config): ...@@ -530,6 +530,7 @@ def run_scheduler(config):
all_vars = inventory.setdefault('group_vars', {}).setdefault('all', {}) all_vars = inventory.setdefault('group_vars', {}).setdefault('all', {})
all_vars.update(config['vars']) all_vars.update(config['vars'])
all_vars.update({ all_vars.update({
'float_plugin_loaded': True,
'services': services, 'services': services,
'default_service_credentials': DEFAULT_SERVICE_CREDENTIALS, 'default_service_credentials': DEFAULT_SERVICE_CREDENTIALS,
'float_global_dns_map': _global_dns_map(inventory), 'float_global_dns_map': _global_dns_map(inventory),
......
---
dependencies:
- { role: float-plugin-check }
---
- fail:
msg: "The 'float' plugin was not loaded! This could be due to multiple reasons: wrong paths in ansible.cfg, problems with the Python version used by Ansible, etc..."
when: "not float_plugin_loaded | default(False)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment