collection 교체

This commit is contained in:
정훈 변
2024-02-23 16:37:40 +09:00
parent b494779b5b
commit 3fd554eee9
38862 changed files with 220204 additions and 6600073 deletions

View File

@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2018, Arigato Machine Inc.
# (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Copyright (c) 2018, Arigato Machine Inc.
# Copyright (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -19,24 +20,24 @@ DOCUMENTATION = '''
matched resources will be returned.
type: list
elements: string
required: False
required: false
api_token:
description:
- manifold API token
type: string
required: True
required: true
env:
- name: MANIFOLD_API_TOKEN
project:
description:
- The project label you want to get the resource for.
type: string
required: False
required: false
team:
description:
- The team label you want to get the resource for.
type: string
required: False
required: false
'''
EXAMPLES = '''
@@ -68,7 +69,6 @@ from ansible.utils.display import Display
from traceback import format_exception
import json
import sys
import os
display = Display()
@@ -206,7 +206,7 @@ class ManifoldApiClient(object):
class LookupModule(LookupBase):
def run(self, terms, variables=None, api_token=None, project=None, team=None):
def run(self, terms, variables=None, **kwargs):
"""
:param terms: a list of resources lookups to run.
:param variables: ansible variables active at the time of the lookup
@@ -216,10 +216,11 @@ class LookupModule(LookupBase):
:return: a dictionary of resources credentials
"""
if not api_token:
api_token = os.getenv('MANIFOLD_API_TOKEN')
if not api_token:
raise AnsibleError('API token is required. Please set api_token parameter or MANIFOLD_API_TOKEN env var')
self.set_options(var_options=variables, direct=kwargs)
api_token = self.get_option('api_token')
project = self.get_option('project')
team = self.get_option('team')
try:
labels = terms