mirror of
https://github.com/ansible/awx.git
synced 2026-03-16 08:27:29 -02:30
Optional tower cli (#3)
* Allow running tests without tower_cli * patch up test mutability * Fix test import error, warning mock * flake8 error Update documentation for non-converted modules
This commit is contained in:
@@ -36,9 +36,6 @@ options:
|
||||
- Path to the Tower or AWX config file.
|
||||
type: path
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
notes:
|
||||
- If no I(config_file) is provided we will attempt to use the tower-cli library
|
||||
defaults to find your Tower host information.
|
||||
|
||||
@@ -33,7 +33,7 @@ class ItemNotDefined(Exception):
|
||||
|
||||
class TowerModule(AnsibleModule):
|
||||
url = None
|
||||
honorred_settings = ['host', 'username', 'password', 'verify_ssl', 'oauth_token']
|
||||
honorred_settings = ('host', 'username', 'password', 'verify_ssl', 'oauth_token')
|
||||
host = '127.0.0.1'
|
||||
username = None
|
||||
password = None
|
||||
@@ -43,7 +43,6 @@ class TowerModule(AnsibleModule):
|
||||
session = None
|
||||
cookie_jar = CookieJar()
|
||||
authenticated = False
|
||||
json_output = {'changed': False}
|
||||
config_name = 'tower_cli.cfg'
|
||||
|
||||
def __init__(self, argument_spec, **kwargs):
|
||||
@@ -58,6 +57,8 @@ class TowerModule(AnsibleModule):
|
||||
args.update(argument_spec)
|
||||
kwargs['supports_check_mode'] = True
|
||||
|
||||
self.json_output = {'changed': False}
|
||||
|
||||
# We have to take off mutually_exclusive_if in order to init with Ansible
|
||||
mutually_exclusive_if = kwargs.pop('mutually_exclusive_if', None)
|
||||
|
||||
@@ -136,7 +137,7 @@ class TowerModule(AnsibleModule):
|
||||
raise ConfigFileException('The specified config file does not exist')
|
||||
|
||||
if not access(config_path, R_OK):
|
||||
raise ConfigFileException("The specified config file can not be read")
|
||||
raise ConfigFileException("The specified config file cannot be read")
|
||||
|
||||
# Read in the file contents:
|
||||
with open(config_path, 'r') as f:
|
||||
|
||||
@@ -160,6 +160,10 @@ options:
|
||||
choices: ["present", "absent"]
|
||||
default: "present"
|
||||
type: str
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
@@ -219,7 +219,12 @@ options:
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
type: str
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
|
||||
notes:
|
||||
- JSON for survey_spec can be found in Tower API Documentation. See
|
||||
U(https://docs.ansible.com/ansible-tower/latest/html/towerapi/api_ref.html#/Job_Templates/Job_Templates_job_templates_survey_spec_create)
|
||||
|
||||
@@ -42,6 +42,10 @@ options:
|
||||
description:
|
||||
- Maximum time in seconds to wait for a job to finish.
|
||||
type: int
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ options:
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
type: str
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
@@ -191,6 +191,10 @@ options:
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
type: str
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
@@ -68,6 +68,10 @@ options:
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
type: str
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ options:
|
||||
|
||||
requirements:
|
||||
- "python >= 2.6"
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
@@ -81,6 +81,10 @@ options:
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
type: str
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user