|
|
@ -251,35 +251,23 @@ class PlayContext(Base):
|
|
|
|
options specified by the user on the command line. These have a
|
|
|
|
options specified by the user on the command line. These have a
|
|
|
|
lower precedence than those set on the play or host.
|
|
|
|
lower precedence than those set on the play or host.
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
if options.connection:
|
|
|
|
|
|
|
|
self.connection = options.connection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.remote_user = options.remote_user
|
|
|
|
|
|
|
|
self.private_key_file = options.private_key_file
|
|
|
|
|
|
|
|
self.ssh_common_args = options.ssh_common_args
|
|
|
|
|
|
|
|
self.sftp_extra_args = options.sftp_extra_args
|
|
|
|
|
|
|
|
self.scp_extra_args = options.scp_extra_args
|
|
|
|
|
|
|
|
self.ssh_extra_args = options.ssh_extra_args
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# privilege escalation
|
|
|
|
# privilege escalation
|
|
|
|
self.become = options.become
|
|
|
|
self.become = options.become
|
|
|
|
self.become_method = options.become_method
|
|
|
|
self.become_method = options.become_method
|
|
|
|
self.become_user = options.become_user
|
|
|
|
self.become_user = options.become_user
|
|
|
|
|
|
|
|
|
|
|
|
# general flags (should we move out?)
|
|
|
|
|
|
|
|
if options.verbosity:
|
|
|
|
|
|
|
|
self.verbosity = options.verbosity
|
|
|
|
|
|
|
|
if options.check:
|
|
|
|
|
|
|
|
self.check_mode = boolean(options.check)
|
|
|
|
self.check_mode = boolean(options.check)
|
|
|
|
if hasattr(options, 'force_handlers') and options.force_handlers:
|
|
|
|
|
|
|
|
self.force_handlers = boolean(options.force_handlers)
|
|
|
|
# get ssh options FIXME: make these common to all connections
|
|
|
|
if hasattr(options, 'step') and options.step:
|
|
|
|
for flag in ['ssh_common_args', 'sftp_extra_args', 'scp_extra_args', 'ssh_extra_args']:
|
|
|
|
self.step = boolean(options.step)
|
|
|
|
setattr(self, flag, getattr(options,flag, ''))
|
|
|
|
if hasattr(options, 'start_at_task') and options.start_at_task:
|
|
|
|
|
|
|
|
self.start_at_task = to_unicode(options.start_at_task)
|
|
|
|
# general flags (should we move out?)
|
|
|
|
if hasattr(options, 'diff') and options.diff:
|
|
|
|
for flag in ['connection','remote_user', 'private_key_file', 'verbosity', 'force_handlers', 'step', 'start_at_task', 'diff']:
|
|
|
|
self.diff = boolean(options.diff)
|
|
|
|
attribute = getattr(options, flag, False)
|
|
|
|
|
|
|
|
if attribute:
|
|
|
|
|
|
|
|
setattr(self, flag, attribute)
|
|
|
|
|
|
|
|
|
|
|
|
if hasattr(options, 'timeout') and options.timeout:
|
|
|
|
if hasattr(options, 'timeout') and options.timeout:
|
|
|
|
self.timeout = int(options.timeout)
|
|
|
|
self.timeout = int(options.timeout)
|
|
|
|
|
|
|
|
|
|
|
|