From af1433f6d685e4f2745204cf7afea639fe18e2c5 Mon Sep 17 00:00:00 2001 From: Kevin Velarde Date: Mon, 27 Jul 2026 16:26:43 -0600 Subject: [PATCH] Fix issue with setting mongodb node type facts --- roles/mongodb/tasks/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 7325b11e..5672be83 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -1,11 +1,6 @@ # Copyright (c) 2024, Itential, Inc # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) --- -- name: Include tasks to validate variables - ansible.builtin.include_tasks: - file: validate-vars.yml - tags: always - # Set node type facts based on inventory group membership. # mongodb_primary group hosts get the primary role with higher priority. # mongodb_replica group hosts get the secondary role with lower priority. @@ -16,6 +11,11 @@ mongodb_data_nodes: "{{ groups['mongodb_primary'] | default([]) + groups['mongodb_replica'] | default([]) }}" mongodb_has_replicas: "{{ groups['mongodb_replica'] is defined and groups['mongodb_replica'] | length > 0 }}" +- name: Include tasks to validate variables + ansible.builtin.include_tasks: + file: validate-vars.yml + tags: always + # Installs all the necessary components and dependencies for MongoDB. # This will start the server with the simplest config. - name: Install MongoDB and all necessary components