@@ -59,6 +59,7 @@ def run_command(self, command):
5959 ENV_TARGET_NAME = "TARGET"
6060 ENV_REQUIRED_COLLECTION_NAME = "REQCOLLECTIONS"
6161 ENV_REQUIRED_ROLE_NAME = "REROLE"
62+ ENV_PIPPACKAGE_NAME = "PIPPACKAGE"
6263
6364 # check for target variable
6465 env_target = EnvironmentManager (ENV_TARGET_NAME )
@@ -75,6 +76,10 @@ def run_command(self, command):
7576 env_role = EnvironmentManager (ENV_REQUIRED_ROLE_NAME )
7677 reqired_role = env_role .check_optional_environment_variable ()
7778
79+ # check for required role variable
80+ env_pip = EnvironmentManager (ENV_PIPPACKAGE_NAME )
81+ pip_pkg = env_pip .check_optional_environment_variable ()
82+
7883 # run ansible commands
7984 ansible_version_checker = AnsibleCommandExecution ()
8085
@@ -91,6 +96,12 @@ def run_command(self, command):
9196 version_info = ansible_version_checker .run_command (ansible_command )
9297 print (f"ROLE INSTALL SUCCESSFUL\n { version_info } " )
9398
99+ # Optionally install pip package
100+ if bool (pip_pkg ):
101+ ansible_command = ["pip" , "install" , "--upgrade" , f"{ pip_pkg } " ]
102+ version_info = ansible_version_checker .run_command (ansible_command )
103+ print (f"PIP PACKAGE INSTALL SUCCESSFUL\n { version_info } " )
104+
94105 # run ansible lint
95106 ansible_command = ["ansible-lint" , f"{ target } " ]
96107 linter_run = ansible_version_checker .run_command (ansible_command )
0 commit comments