#NEWLINE# @ click . group ( ) #NEWLINE# @ click . pass_context #NEWLINE# @ click . option ( '--unattended' , '-u' , is_flag = True , default = False ) #NEWLINE# @ click . option ( '--configuration' , '-c' , type = click . Path ( file_okay = True , dir_okay = False , writable = True , readable = True ) , default = None ) #NEWLINE# @ click . option ( '--ansible-playbook-directory' , '-a' , type = click . Path ( exists = True , file_okay = False , dir_okay = True , readable = True ) , default = DEFAULT_PLAYBOOK_DIR , envvar = 'OO_ANSIBLE_PLAYBOOK_DIRECTORY' ) #NEWLINE# @ click . option ( '--ansible-config' , type = click . Path ( file_okay = True , dir_okay = False , writable = True , readable = True ) , default = None ) #NEWLINE# @ click . option ( '--ansible-log-path' , type = click . Path ( file_okay = True , dir_okay = False , writable = True , readable = True ) , default = '/tmp/ansible.log' ) #NEWLINE# @ click . option ( '-v' , '--verbose' , is_flag = True , default = False ) #NEWLINE# def cli( ctx , unattended , configuration , ansible_playbook_directory , ansible_config , ansible_log_path , verbose ) : #NEWLINE# #INDENT# '\n    atomic-openshift-installer makes the process for installing OSE or AEP\n    easier by interactively gathering the data needed to run on each host.\n    It can also be run in unattended mode if provided with a configuration file.\n\n    Further reading: https://docs.openshift.com/enterprise/latest/install_config/install/quick_install.html\n    ' #NEWLINE# ctx . obj = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# ctx . obj [ 'unattended' ] = unattended #NEWLINE# ctx . obj [ 'configuration' ] = configuration #NEWLINE# ctx . obj [ 'ansible_config' ] = ansible_config #NEWLINE# ctx . obj [ 'ansible_log_path' ] = ansible_log_path #NEWLINE# ctx . obj [ 'verbose' ] = verbose #NEWLINE# try : #NEWLINE# #INDENT# oo_cfg = OOConfig ( unattended . obj [ 'configuration' ] ) #NEWLINE# #UNINDENT# except OOConfigInvalidHostError as e : #NEWLINE# #INDENT# click . echo ( e ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# if ( not ansible_playbook_directory ) : #NEWLINE# #INDENT# ansible_playbook_directory = oo_cfg . settings . get ( 'ansible_playbook_directory' , '' ) #NEWLINE# #UNINDENT# if ( ( not ansible_playbook_directory ) and os . path . exists ( DEFAULT_PLAYBOOK_DIR ) ) : #NEWLINE# #INDENT# ansible_playbook_directory = DEFAULT_PLAYBOOK_DIR #NEWLINE# #UNINDENT# validate_ansible_dir ( ansible_playbook_directory ) #NEWLINE# oo_cfg . settings [ 'ansible_playbook_directory' ] = ansible_playbook_directory #NEWLINE# oo_cfg . ansible_playbook_directory = ansible_playbook_directory #NEWLINE# ctx . obj [ 'ansible_playbook_directory' ] = ansible_playbook_directory #NEWLINE# if ctx . obj [ 'ansible_config' ] : #NEWLINE# #INDENT# oo_cfg . settings [ 'ansible_config' ] = ctx . obj [ 'ansible_config' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( 'ansible_config' not in oo_cfg . settings ) and os . path . exists ( DEFAULT_ANSIBLE_CONFIG ) ) : #NEWLINE# #INDENT# oo_cfg . settings [ 'ansible_config' ] = DEFAULT_ANSIBLE_CONFIG #NEWLINE# #UNINDENT# #UNINDENT# oo_cfg . settings [ 'ansible_log_path' ] = ctx . obj [ 'ansible_log_path' ] #NEWLINE# ctx . obj [ 'oo_cfg' ] = oo_cfg #NEWLINE# openshift_ansible . set_config ( oo_cfg )