@@ -90,42 +90,42 @@ def run_command(self, command):
90
90
env_pip_txt = EnvironmentManager (ENV_PIPPACKAGE_TXT_NAME )
91
91
pip_pkg_txt = env_pip_txt .check_optional_environment_variable ()
92
92
93
- # run ansible commands
94
- ansible_version_checker = AnsibleCommandExecution ()
93
+ # execute ansible commands
94
+ execute = AnsibleCommandExecution ()
95
95
96
96
# Optionally install required ansible collections directly
97
97
if bool (reqired_collection ):
98
- ansible_command = ["ansible-galaxy" , "collection" , "install" ,
98
+ collection_install_command = ["ansible-galaxy" , "collection" , "install" ,
99
99
f"{ reqired_collection } " , "--upgrade" ]
100
- version_info = ansible_version_checker .run_command (ansible_command )
101
- print (f"COLLECTION INSTALL SUCCESSFUL\n { version_info } " )
100
+ collection_install_info = execute .run_command (collection_install_command )
101
+ print (f"{ collection_install_info } \n SINGLE COLLECTION INSTALL SUCCESSFUL" )
102
102
103
103
# Optionally install required ansible collections from yml file
104
104
if bool (reqired_collection_yml ):
105
- ansible_command = ["ansible-galaxy" , "collection" , "install" , "-r" ,
105
+ collections_install_command = ["ansible-galaxy" , "collection" , "install" , "-r" ,
106
106
f"{ reqired_collection_yml } " , "--upgrade" ]
107
- version_info = ansible_version_checker .run_command (ansible_command )
108
- print (f"COLLECTION .YML INSTALL SUCCESSFUL\n { version_info } " )
107
+ collections_install_info = execute .run_command (collections_install_command )
108
+ print (f"{ collections_install_info } \n COLLECTION .YML INSTALL SUCCESSFUL" )
109
109
110
110
# Optionally install required ansible roles
111
111
if bool (reqired_role ):
112
- ansible_command = ["ansible-galaxy" , "role" , "install" , f"{ reqired_role } " , "--upgrade" ]
113
- version_info = ansible_version_checker .run_command (ansible_command )
114
- print (f"ROLE INSTALL SUCCESSFUL\n { version_info } " )
112
+ role_install_command = ["ansible-galaxy" , "role" , "install" , f"{ reqired_role } " , "--upgrade" ]
113
+ role_install_info = execute .run_command (role_install_command )
114
+ print (f"{ role_install_info } \n SINGLE ROLE INSTALL SUCCESSFUL" )
115
115
116
116
# Optionally install pip package directly
117
117
if bool (pip_pkg ):
118
- ansible_command = ["pip" , "install" , "--upgrade" , f"{ pip_pkg } " ]
119
- version_info = ansible_version_checker .run_command (ansible_command )
120
- print (f"PIP PACKAGE INSTALL SUCCESSFUL\n { version_info } " )
118
+ pip_install_command = ["pip" , "install" , "--upgrade" , f"{ pip_pkg } " ]
119
+ pip_install_info = execute .run_command (pip_install_command )
120
+ print (f"{ pip_install_info } \n PIP PACKAGE INSTALL SUCCESSFUL" )
121
121
122
122
# Optionally install pip package from file
123
123
if bool (pip_pkg_txt ):
124
- ansible_command = ["pip" , "install" , "--upgrade" , "-r" , f"{ pip_pkg_txt } " ]
125
- version_info = ansible_version_checker .run_command (ansible_command )
126
- print (f"PIP PACKAGE.TXT INSTALL SUCCESSFUL\n { version_info } " )
124
+ pip_requirements_command = ["pip" , "install" , "--upgrade" , "-r" , f"{ pip_pkg_txt } " ]
125
+ pip_requirements_info = execute .run_command (pip_requirements_command )
126
+ print (f"{ pip_requirements_info } \n PIP PACKAGE.TXT INSTALL SUCCESSFUL" )
127
127
128
128
# run ansible lint
129
129
ansible_command = ["ansible-lint" , f"{ target } " ]
130
- linter_run = ansible_version_checker .run_command (ansible_command )
131
- print (f"{ linter_run } \n \ n Ansible run successful" )
130
+ linter_run = execute .run_command (ansible_command )
131
+ print (f"---start+linter--- \n { linter_run } \n Ansible run successful\n ---end+linter--- " )
0 commit comments