mirror of https://github.com/ansible/ansible.git
Support vars plugins in collections (#61078)
* Move var plugins handling to a separate file * Allow var plugins to require whitelisting * Add global configuration ('demand', 'start') for users to control when they execute * Add 'stage' configuration ('all', 'task', 'inventory') for users to control on a per-plugin basis when they execute * Update ansible-inventory and InventoryManager to the global and stage configuration * Update host_group_vars to use stage configuration and whitelisting * Add documentation for using new options and to the developer's guide * Add integration tests to exercise whitelisting and the new configuration options, using vars plugins in collections, and maintain backward compatibility * Changelog Co-Authored-By: Brian Coca <brian.coca+git@gmail.com> Co-Authored-By: Sandra McCann <samccann@redhat.com>pull/60365/head
parent
39bf09517a
commit
c1f1b2029c
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- vars plugins - Support vars plugins in collections by adding the ability to whitelist plugins.
|
||||||
|
- host_group_vars plugin - Require whitelisting and whitelist by default.
|
||||||
|
- Add a global toggle to control when vars plugins are executed (per task by default for backward compatibility or after importing inventory).
|
||||||
|
- Add a per-plugin stage option to override the global toggle to control the execution of individual vars plugins (per task, after inventory, or both).
|
@ -0,0 +1,24 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright: (c) 2019, Ansible Project
|
||||||
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
|
class ModuleDocFragment(object):
|
||||||
|
|
||||||
|
DOCUMENTATION = r'''
|
||||||
|
options:
|
||||||
|
stage:
|
||||||
|
description:
|
||||||
|
- Control when this vars plugin may be executed.
|
||||||
|
- Setting this option to C(all) will run the vars plugin after importing inventory and whenever it is demanded by a task.
|
||||||
|
- Setting this option to C(task) will only run the vars plugin whenever it is demanded by a task.
|
||||||
|
- Setting this option to C(inventory) will only run the vars plugin after parsing inventory.
|
||||||
|
- If this option is omitted, the global I(RUN_VARS_PLUGINS) configuration is used to determine when to execute the vars plugin.
|
||||||
|
choices: ['all', 'task', 'inventory']
|
||||||
|
version_added: "2.10"
|
||||||
|
type: str
|
||||||
|
'''
|
@ -0,0 +1,95 @@
|
|||||||
|
# Copyright (c) 2018 Ansible Project
|
||||||
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
|
||||||
|
# Make coding more python3-ish
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from ansible import constants as C
|
||||||
|
from ansible.errors import AnsibleError
|
||||||
|
from ansible.inventory.host import Host
|
||||||
|
from ansible.module_utils._text import to_bytes
|
||||||
|
from ansible.plugins.loader import vars_loader
|
||||||
|
from ansible.utils.collection_loader import AnsibleCollectionRef
|
||||||
|
from ansible.utils.display import Display
|
||||||
|
from ansible.utils.vars import combine_vars
|
||||||
|
|
||||||
|
display = Display()
|
||||||
|
|
||||||
|
|
||||||
|
def get_plugin_vars(loader, plugin, path, entities):
|
||||||
|
|
||||||
|
data = {}
|
||||||
|
try:
|
||||||
|
data = plugin.get_vars(loader, path, entities)
|
||||||
|
except AttributeError:
|
||||||
|
try:
|
||||||
|
for entity in entities:
|
||||||
|
if isinstance(entity, Host):
|
||||||
|
data.update(plugin.get_host_vars(entity.name))
|
||||||
|
else:
|
||||||
|
data.update(plugin.get_group_vars(entity.name))
|
||||||
|
except AttributeError:
|
||||||
|
if hasattr(plugin, 'run'):
|
||||||
|
raise AnsibleError("Cannot use v1 type vars plugin %s from %s" % (plugin._load_name, plugin._original_path))
|
||||||
|
else:
|
||||||
|
raise AnsibleError("Invalid vars plugin %s from %s" % (plugin._load_name, plugin._original_path))
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def get_vars_from_path(loader, path, entities, stage):
|
||||||
|
|
||||||
|
data = {}
|
||||||
|
|
||||||
|
vars_plugin_list = list(vars_loader.all())
|
||||||
|
for plugin_name in C.VARIABLE_PLUGINS_ENABLED:
|
||||||
|
if AnsibleCollectionRef.is_valid_fqcr(plugin_name):
|
||||||
|
vars_plugin = vars_loader.get(plugin_name)
|
||||||
|
if vars_plugin is None:
|
||||||
|
# Error if there's no play directory or the name is wrong?
|
||||||
|
continue
|
||||||
|
if vars_plugin not in vars_plugin_list:
|
||||||
|
vars_plugin_list.append(vars_plugin)
|
||||||
|
|
||||||
|
for plugin in vars_plugin_list:
|
||||||
|
if plugin._load_name not in C.VARIABLE_PLUGINS_ENABLED and getattr(plugin, 'REQUIRES_WHITELIST', False):
|
||||||
|
# 2.x plugins shipped with ansible should require whitelisting, older or non shipped should load automatically
|
||||||
|
continue
|
||||||
|
|
||||||
|
has_stage = hasattr(plugin, 'get_option') and plugin.has_option('stage')
|
||||||
|
|
||||||
|
# if a plugin-specific setting has not been provided, use the global setting
|
||||||
|
# older/non shipped plugins that don't support the plugin-specific setting should also use the global setting
|
||||||
|
use_global = (has_stage and plugin.get_option('stage') is None) or not has_stage
|
||||||
|
|
||||||
|
if use_global:
|
||||||
|
if C.RUN_VARS_PLUGINS == 'demand' and stage == 'inventory':
|
||||||
|
continue
|
||||||
|
elif C.RUN_VARS_PLUGINS == 'start' and stage == 'task':
|
||||||
|
continue
|
||||||
|
elif has_stage and plugin.get_option('stage') not in ('all', stage):
|
||||||
|
continue
|
||||||
|
|
||||||
|
data = combine_vars(data, get_plugin_vars(loader, plugin, path, entities))
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def get_vars_from_inventory_sources(loader, sources, entities, stage):
|
||||||
|
|
||||||
|
data = {}
|
||||||
|
for path in sources:
|
||||||
|
|
||||||
|
if path is None:
|
||||||
|
continue
|
||||||
|
if ',' in path and not os.path.exists(path): # skip host lists
|
||||||
|
continue
|
||||||
|
elif not os.path.isdir(to_bytes(path)):
|
||||||
|
# always pass the directory of the inventory source file
|
||||||
|
path = os.path.dirname(path)
|
||||||
|
|
||||||
|
data = combine_vars(data, get_vars_from_path(loader, path, entities, stage))
|
||||||
|
|
||||||
|
return data
|
@ -0,0 +1,44 @@
|
|||||||
|
# Copyright 2019 RedHat, inc
|
||||||
|
#
|
||||||
|
# This file is part of Ansible
|
||||||
|
#
|
||||||
|
# Ansible is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Ansible is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#############################################
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
vars: custom_vars
|
||||||
|
version_added: "2.10"
|
||||||
|
short_description: load host and group vars
|
||||||
|
description: test loading host and group vars from a collection
|
||||||
|
options:
|
||||||
|
stage:
|
||||||
|
choices: ['all', 'inventory', 'task']
|
||||||
|
type: str
|
||||||
|
ini:
|
||||||
|
- key: stage
|
||||||
|
section: custom_vars
|
||||||
|
env:
|
||||||
|
- name: ANSIBLE_VARS_PLUGIN_STAGE
|
||||||
|
'''
|
||||||
|
|
||||||
|
from ansible.plugins.vars import BaseVarsPlugin
|
||||||
|
|
||||||
|
|
||||||
|
class VarsModule(BaseVarsPlugin):
|
||||||
|
|
||||||
|
def get_vars(self, loader, path, entities, cache=True):
|
||||||
|
super(VarsModule, self).get_vars(loader, path, entities)
|
||||||
|
return {'collection': 'collection_root_user'}
|
@ -0,0 +1,45 @@
|
|||||||
|
# Copyright 2019 RedHat, inc
|
||||||
|
#
|
||||||
|
# This file is part of Ansible
|
||||||
|
#
|
||||||
|
# Ansible is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Ansible is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#############################################
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
vars: custom_adj_vars
|
||||||
|
version_added: "2.10"
|
||||||
|
short_description: load host and group vars
|
||||||
|
description: test loading host and group vars from a collection
|
||||||
|
options:
|
||||||
|
stage:
|
||||||
|
default: all
|
||||||
|
choices: ['all', 'inventory', 'task']
|
||||||
|
type: str
|
||||||
|
ini:
|
||||||
|
- key: stage
|
||||||
|
section: custom_adj_vars
|
||||||
|
env:
|
||||||
|
- name: ANSIBLE_VARS_PLUGIN_STAGE
|
||||||
|
'''
|
||||||
|
|
||||||
|
from ansible.plugins.vars import BaseVarsPlugin
|
||||||
|
|
||||||
|
|
||||||
|
class VarsModule(BaseVarsPlugin):
|
||||||
|
|
||||||
|
def get_vars(self, loader, path, entities, cache=True):
|
||||||
|
super(VarsModule, self).get_vars(loader, path, entities)
|
||||||
|
return {'collection': 'adjacent', 'adj_var': 'value'}
|
@ -0,0 +1,37 @@
|
|||||||
|
# Copyright 2019 RedHat, inc
|
||||||
|
#
|
||||||
|
# This file is part of Ansible
|
||||||
|
#
|
||||||
|
# Ansible is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Ansible is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#############################################
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
vars: v1_vars_plugin
|
||||||
|
version_added: "2.10"
|
||||||
|
short_description: load host and group vars
|
||||||
|
description:
|
||||||
|
- 3rd party vars plugin to test loading host and group vars without requiring whitelisting and without a plugin-specific stage option
|
||||||
|
options:
|
||||||
|
'''
|
||||||
|
|
||||||
|
from ansible.plugins.vars import BaseVarsPlugin
|
||||||
|
|
||||||
|
|
||||||
|
class VarsModule(BaseVarsPlugin):
|
||||||
|
|
||||||
|
def get_vars(self, loader, path, entities, cache=True):
|
||||||
|
super(VarsModule, self).get_vars(loader, path, entities)
|
||||||
|
return {'collection': False, 'name': 'v1_vars_plugin', 'v1_vars_plugin': True}
|
@ -0,0 +1,45 @@
|
|||||||
|
# Copyright 2019 RedHat, inc
|
||||||
|
#
|
||||||
|
# This file is part of Ansible
|
||||||
|
#
|
||||||
|
# Ansible is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Ansible is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#############################################
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
vars: v2_vars_plugin
|
||||||
|
version_added: "2.10"
|
||||||
|
short_description: load host and group vars
|
||||||
|
description:
|
||||||
|
- 3rd party vars plugin to test loading host and group vars without requiring whitelisting and with a plugin-specific stage option
|
||||||
|
options:
|
||||||
|
stage:
|
||||||
|
choices: ['all', 'inventory', 'task']
|
||||||
|
type: str
|
||||||
|
ini:
|
||||||
|
- key: stage
|
||||||
|
section: other_vars_plugin
|
||||||
|
env:
|
||||||
|
- name: ANSIBLE_VARS_PLUGIN_STAGE
|
||||||
|
'''
|
||||||
|
|
||||||
|
from ansible.plugins.vars import BaseVarsPlugin
|
||||||
|
|
||||||
|
|
||||||
|
class VarsModule(BaseVarsPlugin):
|
||||||
|
|
||||||
|
def get_vars(self, loader, path, entities, cache=True):
|
||||||
|
super(VarsModule, self).get_vars(loader, path, entities)
|
||||||
|
return {'collection': False, 'name': 'v2_vars_plugin', 'v2_vars_plugin': True}
|
@ -0,0 +1,46 @@
|
|||||||
|
# Copyright 2019 RedHat, inc
|
||||||
|
#
|
||||||
|
# This file is part of Ansible
|
||||||
|
#
|
||||||
|
# Ansible is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Ansible is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#############################################
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
vars: vars_req_whitelist
|
||||||
|
version_added: "2.10"
|
||||||
|
short_description: load host and group vars
|
||||||
|
description: test loading host and group vars from a collection
|
||||||
|
options:
|
||||||
|
stage:
|
||||||
|
choices: ['all', 'inventory', 'task']
|
||||||
|
type: str
|
||||||
|
ini:
|
||||||
|
- key: stage
|
||||||
|
section: vars_req_whitelist
|
||||||
|
env:
|
||||||
|
- name: ANSIBLE_VARS_PLUGIN_STAGE
|
||||||
|
'''
|
||||||
|
|
||||||
|
from ansible.plugins.vars import BaseVarsPlugin
|
||||||
|
|
||||||
|
|
||||||
|
class VarsModule(BaseVarsPlugin):
|
||||||
|
|
||||||
|
REQUIRES_WHITELIST = True
|
||||||
|
|
||||||
|
def get_vars(self, loader, path, entities, cache=True):
|
||||||
|
super(VarsModule, self).get_vars(loader, path, entities)
|
||||||
|
return {'whitelisted': True, 'collection': False}
|
@ -0,0 +1,99 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# Collections vars plugins must be whitelisted with FQCN because PluginLoader.all() does not search collections
|
||||||
|
|
||||||
|
# Let vars plugins run for inventory by using the global setting
|
||||||
|
export ANSIBLE_RUN_VARS_PLUGINS=start
|
||||||
|
|
||||||
|
# Test vars plugin in a playbook-adjacent collection
|
||||||
|
export ANSIBLE_VARS_ENABLED=testns.content_adj.custom_adj_vars
|
||||||
|
|
||||||
|
ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep '"collection": "adjacent"' out.txt
|
||||||
|
grep '"adj_var": "value"' out.txt
|
||||||
|
|
||||||
|
# Test vars plugin in a collection path
|
||||||
|
export ANSIBLE_VARS_ENABLED=testns.testcoll.custom_vars
|
||||||
|
export ANSIBLE_COLLECTIONS_PATHS=$PWD/collection_root_user:$PWD/collection_root_sys
|
||||||
|
|
||||||
|
ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep '"collection": "collection_root_user"' out.txt
|
||||||
|
grep -v '"adj_var": "value"' out.txt
|
||||||
|
|
||||||
|
# Test enabled vars plugins order reflects the order in which variables are merged
|
||||||
|
export ANSIBLE_VARS_ENABLED=testns.content_adj.custom_adj_vars,testns.testcoll.custom_vars
|
||||||
|
|
||||||
|
ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep '"collection": "collection_root_user"' out.txt
|
||||||
|
grep '"adj_var": "value"' out.txt
|
||||||
|
grep -v '"collection": "adjacent"' out.txt
|
||||||
|
|
||||||
|
# Test that 3rd party plugins in plugin_path do not need to require whitelisting by default
|
||||||
|
# Plugins shipped with Ansible and in the custom plugin dir should be used first
|
||||||
|
export ANSIBLE_VARS_PLUGINS=./custom_vars_plugins
|
||||||
|
|
||||||
|
ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep '"name": "v2_vars_plugin"' out.txt
|
||||||
|
grep '"collection": "collection_root_user"' out.txt
|
||||||
|
grep '"adj_var": "value"' out.txt
|
||||||
|
grep -v '"whitelisted": true' out.txt
|
||||||
|
|
||||||
|
# Test plugins in plugin paths that opt-in to require whitelisting
|
||||||
|
unset ANSIBLE_VARS_ENABLED
|
||||||
|
unset ANSIBLE_COLLECTIONS_PATHS
|
||||||
|
|
||||||
|
ANSIBLE_VARS_ENABLED=vars_req_whitelist ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep '"whitelisted": true' out.txt
|
||||||
|
|
||||||
|
# Test vars plugins that support the stage setting don't run for inventory when stage is set to 'task'
|
||||||
|
# and that the vars plugins that don't support the stage setting don't run for inventory when the global setting is 'demand'
|
||||||
|
ANSIBLE_VARS_PLUGIN_STAGE=task ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep -v '"v1_vars_plugin": true' out.txt
|
||||||
|
grep -v '"v2_vars_plugin": true' out.txt
|
||||||
|
grep -v '"vars_req_whitelist": true' out.txt
|
||||||
|
grep -v '"collection": "adjacent"' out.txt
|
||||||
|
grep -v '"collection": "collection_root_user"' out.txt
|
||||||
|
grep -v '"adj_var": "value"' out.txt
|
||||||
|
|
||||||
|
# Test vars plugins that support the stage setting run for inventory when stage is set to 'inventory'
|
||||||
|
ANSIBLE_VARS_PLUGIN_STAGE=inventory ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep -v '"v1_vars_plugin": true' out.txt
|
||||||
|
grep -v '"vars_req_whitelist": true' out.txt
|
||||||
|
grep '"v2_vars_plugin": true' out.txt
|
||||||
|
grep '"name": "v2_vars_plugin"' out.txt
|
||||||
|
|
||||||
|
# Test that the global setting allows v1 and v2 plugins to run after importing inventory
|
||||||
|
ANSIBLE_RUN_VARS_PLUGINS=start ansible-inventory -i a.statichost.yml --list --playbook-dir=./ | tee out.txt
|
||||||
|
|
||||||
|
grep -v '"vars_req_whitelist": true' out.txt
|
||||||
|
grep '"v1_vars_plugin": true' out.txt
|
||||||
|
grep '"v2_vars_plugin": true' out.txt
|
||||||
|
grep '"name": "v2_vars_plugin"' out.txt
|
||||||
|
|
||||||
|
# Test that vars plugins in collections and in the vars plugin path are available for tasks
|
||||||
|
cat << EOF > "test_task_vars.yml"
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
connection: local
|
||||||
|
gather_facts: no
|
||||||
|
tasks:
|
||||||
|
- debug: msg="{{ name }}"
|
||||||
|
- debug: msg="{{ collection }}"
|
||||||
|
- debug: msg="{{ adj_var }}"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
export ANSIBLE_VARS_ENABLED=testns.content_adj.custom_adj_vars
|
||||||
|
|
||||||
|
ANSIBLE_VARS_PLUGIN_STAGE=task ANSIBLE_VARS_PLUGINS=./custom_vars_plugins ansible-playbook test_task_vars.yml | grep "ok=3"
|
||||||
|
ANSIBLE_RUN_VARS_PLUGINS=start ANSIBLE_VARS_PLUGIN_STAGE=inventory ANSIBLE_VARS_PLUGINS=./custom_vars_plugins ansible-playbook test_task_vars.yml | grep "ok=3"
|
||||||
|
ANSIBLE_RUN_VARS_PLUGINS=demand ANSIBLE_VARS_PLUGIN_STAGE=inventory ANSIBLE_VARS_PLUGINS=./custom_vars_plugins ansible-playbook test_task_vars.yml | grep "ok=3"
|
||||||
|
ANSIBLE_VARS_PLUGINS=./custom_vars_plugins ansible-playbook test_task_vars.yml | grep "ok=3"
|
Loading…
Reference in New Issue