Class: QB::Ansible::Env::Devel

Inherits:
QB::Ansible::Env show all
Defined in:
lib/qb/ansible/env/devel.rb

Overview

TODO:

document QB::Ansible::Env class.

Constant Summary collapse

ANSIBLE_HOME =
QB::ROOT / 'packages' / 'python' / 'ansible'

Constants inherited from QB::Ansible::Env

VAR_NAME_PREFIX

Instance Attribute Summary

Attributes inherited from QB::Ansible::Env

#config, #filter_plugins, #library, #lookup_plugins, #python_path, #roles_path, #test_plugins

Instance Method Summary collapse

Methods inherited from QB::Ansible::Env

#initialize, to_var_name

Constructor Details

This class inherits a constructor from QB::Ansible::Env

Instance Method Details

#to_hreturn_type

TODO:

Document to_h method.

Returns @todo Document return value.

Parameters:

  • arg_name (type)

    @todo Add name param description.

Returns:

  • (return_type)

    @todo Document return value.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/qb/ansible/env/devel.rb', line 20

def to_h
  hash = super
  
  hash['ANSIBLE_HOME'] = ANSIBLE_HOME.to_s
  
  hash['PYTHONPATH'] = [
    # (QB::ROOT / 'lib' / 'python'),
    (ANSIBLE_HOME / 'lib'),
    ENV['PYTHONPATH'],
  ].
    compact.
    map( &:to_s ).
    join( ':' )
  
  path = ENV['PATH'].split ':'
  
  path.insert \
    path.find_index { |p| ! p.start_with?( './' ) },
    (ANSIBLE_HOME / 'bin').to_s
  
  hash['PATH'] = path.join ':'
  
  # hash['ANSIBLE_CONNECTION'] = 'local'
  # hash['ANSIBLE_PYTHON_INTERPRETER'] = '/usr/local/bin/python2'
  
  hash
end