From 5ff3fdb9e46a2a5e76baf6c8610c2aa88fc52695 Mon Sep 17 00:00:00 2001 From: Greg Allen Date: Fri, 23 Sep 2022 15:07:14 -0400 Subject: [PATCH] Fix ordering mechanism. --- filter_plugins/k8s_filter.py | 3 ++- tasks/order_configs.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/filter_plugins/k8s_filter.py b/filter_plugins/k8s_filter.py index 624790a..b853342 100644 --- a/filter_plugins/k8s_filter.py +++ b/filter_plugins/k8s_filter.py @@ -2,6 +2,7 @@ from ansible.utils.display import Display from ansible import constants as C +from collections import OrderedDict import os display = Display() @@ -20,7 +21,7 @@ def k8s_filter(k8s_objects): ] no_log_true = ['Secret'] - resource_files = {} + resource_files = OrderedDict() # order the resources according to what's in resource_order for res in resource_order: for k8s_res in k8s_objects: diff --git a/tasks/order_configs.yml b/tasks/order_configs.yml index 8aa6e81..fae03e8 100644 --- a/tasks/order_configs.yml +++ b/tasks/order_configs.yml @@ -28,8 +28,8 @@ - name: set k8s_secrets with set files set_fact: - k8s_secrets: "{{ k8s_secret_files | k8s_filter }}" + k8s_secrets: "{{ k8s_secret_files | k8s_filter | list }}" - name: set k8s_resources with set files set_fact: - k8s_resources: "{{ k8s_res_files | k8s_filter }}" + k8s_resources: "{{ k8s_res_files | k8s_filter | list }}"