@@ -507,41 +507,46 @@ def default_env(self):
507
507
list (map (util .abs_path , os .environ ["ANSIBLE_ROLES_PATH" ].split (":" ))),
508
508
)
509
509
510
+ filter_plugins_path_list = [
511
+ self ._get_filter_plugin_directory (),
512
+ util .abs_path (
513
+ os .path .join (
514
+ self ._config .scenario .ephemeral_directory ,
515
+ "plugins" ,
516
+ "filter" ,
517
+ ),
518
+ ),
519
+ util .abs_path (
520
+ os .path .join (
521
+ self ._config .project_directory ,
522
+ "plugins" ,
523
+ "filter" ,
524
+ ),
525
+ ),
526
+ util .abs_path (
527
+ os .path .join (
528
+ os .path .expanduser ("~" ),
529
+ ".ansible" ,
530
+ "plugins" ,
531
+ "filter" ,
532
+ ),
533
+ ),
534
+ "/usr/share/ansible/plugins/filter" ,
535
+ ]
536
+ if os .environ .get ("ANSIBLE_FILTER_PLUGINS" , "" ):
537
+ filter_plugins_path_list .extend (
538
+ list (map (util .abs_path , os .environ ["ANSIBLE_FILTER_PLUGINS" ].split (":" ))),
539
+ )
540
+
541
+
510
542
env = util .merge_dicts (
511
543
os .environ ,
512
544
{
513
545
"ANSIBLE_CONFIG" : self ._config .provisioner .config_file ,
514
546
"ANSIBLE_ROLES_PATH" : ":" .join (roles_path_list ),
515
547
self ._config .ansible_collections_path : ":" .join (collections_path_list ),
516
548
"ANSIBLE_LIBRARY" : ":" .join (self ._get_modules_directories ()),
517
- "ANSIBLE_FILTER_PLUGINS" : ":" .join (
518
- [
519
- self ._get_filter_plugin_directory (),
520
- util .abs_path (
521
- os .path .join (
522
- self ._config .scenario .ephemeral_directory ,
523
- "plugins" ,
524
- "filter" ,
525
- ),
526
- ),
527
- util .abs_path (
528
- os .path .join (
529
- self ._config .project_directory ,
530
- "plugins" ,
531
- "filter" ,
532
- ),
533
- ),
534
- util .abs_path (
535
- os .path .join (
536
- os .path .expanduser ("~" ),
537
- ".ansible" ,
538
- "plugins" ,
539
- "filter" ,
540
- ),
541
- ),
542
- "/usr/share/ansible/plugins/filter" ,
543
- ],
544
- ),
549
+ "ANSIBLE_FILTER_PLUGINS" : ":" .join (filter_plugins_path_list ),
545
550
},
546
551
)
547
552
env = util .merge_dicts (env , self ._config .env )
0 commit comments