diff --git a/playbooks/init-credentials.yml b/playbooks/init-credentials.yml index 817f8ad193081731f671cc4f2d6913bfdacc8aed..3d9ce94dc1d7d68193e2f6f93a8fb8329e99215c 100644 --- a/playbooks/init-credentials.yml +++ b/playbooks/init-credentials.yml @@ -14,6 +14,9 @@ gather_facts: no become: no 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. - name: "Create paths below {{ credentials_dir }}" file: diff --git a/plugins/inventory/float.py b/plugins/inventory/float.py index 04346f6d894192b6d04753121138d155d24b7ecc..01884794c865fe61b1c1add70c548db461b1e8f1 100644 --- a/plugins/inventory/float.py +++ b/plugins/inventory/float.py @@ -530,6 +530,7 @@ def run_scheduler(config): all_vars = inventory.setdefault('group_vars', {}).setdefault('all', {}) all_vars.update(config['vars']) all_vars.update({ + 'float_plugin_loaded': True, 'services': services, 'default_service_credentials': DEFAULT_SERVICE_CREDENTIALS, 'float_global_dns_map': _global_dns_map(inventory), diff --git a/roles/base/meta/main.yml b/roles/base/meta/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..c62444d5d89ea0a13c61729463005cc7c3ba3c2e --- /dev/null +++ b/roles/base/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - { role: float-plugin-check } diff --git a/roles/float-plugin-check/tasks/main.yml b/roles/float-plugin-check/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..166ab4baa2dbf43c3401db48ba110f36f43786cf --- /dev/null +++ b/roles/float-plugin-check/tasks/main.yml @@ -0,0 +1,6 @@ +--- + +- 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)" +