parameters: (self, instance, private_data_dir, private_data_files=None)
return_statement: return env
docstring: Build environment dictionary for ansible-playbook.
docstring_summary: Build environment dictionary for ansible-playbook.
docstring_tokens: Build environment dictionary for ansible - playbook .
function: def build_env(self, instance, private_data_dir, private_data_files=None):
          """
          Build environment dictionary for ansible-playbook.
          """
          env = {}
          # Add ANSIBLE_* settings to the subprocess environment.
          for attr in dir(settings):
              if attr == attr.upper() and attr.startswith('ANSIBLE_'):
                  env[attr] = str(getattr(settings, attr))
          # Also set environment variables configured in AWX_TASK_ENV setting.
          for key, value in settings.AWX_TASK_ENV.items():
              env[key] = str(value)
  
          env['AWX_PRIVATE_DATA_DIR'] = private_data_dir
  
          if self.instance.execution_environment is None:
              raise RuntimeError('The project could not sync because there is no Execution Environment.')
  
          return env
function_tokens: def build_env ( self , instance , private_data_dir , private_data_files = None ) : env = { } # Add ANSIBLE_* settings to the subprocess environment. for attr in dir ( settings ) : if attr == attr . upper ( ) and attr . startswith ( 'ANSIBLE_' ) : env [ attr ] = str ( getattr ( settings , attr ) ) # Also set environment variables configured in AWX_TASK_ENV setting. for key , value in settings . AWX_TASK_ENV . items ( ) : env [ key ] = str ( value ) env [ 'AWX_PRIVATE_DATA_DIR' ] = private_data_dir if self . instance . execution_environment is None : raise RuntimeError ( 'The project could not sync because there is no Execution Environment.' ) return env