made certain flags part of base to make them universally settable
This commit is contained in:
parent
1f7d23fc18
commit
92c8275f94
3 changed files with 10 additions and 12 deletions
|
@ -41,6 +41,16 @@ from ansible.template import template
|
||||||
|
|
||||||
class Base:
|
class Base:
|
||||||
|
|
||||||
|
# connection/transport
|
||||||
|
_connection = FieldAttribute(isa='string')
|
||||||
|
_port = FieldAttribute(isa='int')
|
||||||
|
_remote_user = FieldAttribute(isa='string')
|
||||||
|
|
||||||
|
# vars and flags
|
||||||
|
_vars = FieldAttribute(isa='dict', default=dict())
|
||||||
|
_environment = FieldAttribute(isa='dict', default=dict())
|
||||||
|
_no_log = FieldAttribute(isa='bool', default=False)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
# initialize the data loader and variable manager, which will be provided
|
# initialize the data loader and variable manager, which will be provided
|
||||||
|
|
|
@ -56,15 +56,11 @@ class Play(Base, Taggable, Become):
|
||||||
_accelerate_port = FieldAttribute(isa='int', default=5099) # should be alias of port
|
_accelerate_port = FieldAttribute(isa='int', default=5099) # should be alias of port
|
||||||
|
|
||||||
# Connection
|
# Connection
|
||||||
_connection = FieldAttribute(isa='string', default='smart')
|
|
||||||
_gather_facts = FieldAttribute(isa='string', default='smart')
|
_gather_facts = FieldAttribute(isa='string', default='smart')
|
||||||
_hosts = FieldAttribute(isa='list', default=[], required=True)
|
_hosts = FieldAttribute(isa='list', default=[], required=True)
|
||||||
_name = FieldAttribute(isa='string', default='<no name specified>')
|
_name = FieldAttribute(isa='string', default='<no name specified>')
|
||||||
_port = FieldAttribute(isa='int', default=22)
|
|
||||||
_remote_user = FieldAttribute(isa='string')
|
|
||||||
|
|
||||||
# Variable Attributes
|
# Variable Attributes
|
||||||
_vars = FieldAttribute(isa='dict', default=dict())
|
|
||||||
_vars_files = FieldAttribute(isa='list', default=[])
|
_vars_files = FieldAttribute(isa='list', default=[])
|
||||||
_vars_prompt = FieldAttribute(isa='dict', default=dict())
|
_vars_prompt = FieldAttribute(isa='dict', default=dict())
|
||||||
_vault_password = FieldAttribute(isa='string')
|
_vault_password = FieldAttribute(isa='string')
|
||||||
|
@ -80,9 +76,7 @@ class Play(Base, Taggable, Become):
|
||||||
|
|
||||||
# Flag/Setting Attributes
|
# Flag/Setting Attributes
|
||||||
_any_errors_fatal = FieldAttribute(isa='bool', default=False)
|
_any_errors_fatal = FieldAttribute(isa='bool', default=False)
|
||||||
_environment = FieldAttribute(isa='dict', default=dict())
|
|
||||||
_max_fail_percentage = FieldAttribute(isa='string', default='0')
|
_max_fail_percentage = FieldAttribute(isa='string', default='0')
|
||||||
_no_log = FieldAttribute(isa='bool', default=False)
|
|
||||||
_serial = FieldAttribute(isa='int', default=0)
|
_serial = FieldAttribute(isa='int', default=0)
|
||||||
_strategy = FieldAttribute(isa='string', default='linear')
|
_strategy = FieldAttribute(isa='string', default='linear')
|
||||||
|
|
||||||
|
|
|
@ -63,10 +63,8 @@ class Task(Base, Conditional, Taggable, Become):
|
||||||
_any_errors_fatal = FieldAttribute(isa='bool')
|
_any_errors_fatal = FieldAttribute(isa='bool')
|
||||||
_async = FieldAttribute(isa='int', default=0)
|
_async = FieldAttribute(isa='int', default=0)
|
||||||
_changed_when = FieldAttribute(isa='string')
|
_changed_when = FieldAttribute(isa='string')
|
||||||
_connection = FieldAttribute(isa='string')
|
|
||||||
_delay = FieldAttribute(isa='int', default=5)
|
_delay = FieldAttribute(isa='int', default=5)
|
||||||
_delegate_to = FieldAttribute(isa='string')
|
_delegate_to = FieldAttribute(isa='string')
|
||||||
_environment = FieldAttribute(isa='dict')
|
|
||||||
_failed_when = FieldAttribute(isa='string')
|
_failed_when = FieldAttribute(isa='string')
|
||||||
_first_available_file = FieldAttribute(isa='list')
|
_first_available_file = FieldAttribute(isa='list')
|
||||||
_ignore_errors = FieldAttribute(isa='bool')
|
_ignore_errors = FieldAttribute(isa='bool')
|
||||||
|
@ -80,16 +78,12 @@ class Task(Base, Conditional, Taggable, Become):
|
||||||
|
|
||||||
_name = FieldAttribute(isa='string', default='')
|
_name = FieldAttribute(isa='string', default='')
|
||||||
|
|
||||||
_no_log = FieldAttribute(isa='bool')
|
|
||||||
_notify = FieldAttribute(isa='list')
|
_notify = FieldAttribute(isa='list')
|
||||||
_poll = FieldAttribute(isa='int')
|
_poll = FieldAttribute(isa='int')
|
||||||
_register = FieldAttribute(isa='string')
|
_register = FieldAttribute(isa='string')
|
||||||
_remote_user = FieldAttribute(isa='string')
|
|
||||||
_retries = FieldAttribute(isa='int', default=1)
|
_retries = FieldAttribute(isa='int', default=1)
|
||||||
_run_once = FieldAttribute(isa='bool')
|
_run_once = FieldAttribute(isa='bool')
|
||||||
_transport = FieldAttribute(isa='string')
|
|
||||||
_until = FieldAttribute(isa='list') # ?
|
_until = FieldAttribute(isa='list') # ?
|
||||||
_vars = FieldAttribute(isa='dict', default=dict())
|
|
||||||
|
|
||||||
def __init__(self, block=None, role=None, task_include=None):
|
def __init__(self, block=None, role=None, task_include=None):
|
||||||
''' constructors a task, without the Task.load classmethod, it will be pretty blank '''
|
''' constructors a task, without the Task.load classmethod, it will be pretty blank '''
|
||||||
|
|
Loading…
Reference in a new issue