# Path: installer/configurators/common.py
# def get_tfvars_file():
#     return get_terraform_folder() + "terraform.tfvars"
# 
# def replace_tfvars(key, value, fileName, quoteVal=True):
#     with in_place.InPlace(fileName) as fileContent:
#         for line in fileContent:
#             if quoteVal:
#                 fileContent.write(re.sub(r'({0} = )(.*)'.format(key), r'\1"{0}"'.format(value), line))
#             else:
#                 fileContent.write(re.sub(r'({0} = )(.*)'.format(key), r'\1{0}'.format(value), line))
# 
# def passwd_generator():
#     """
#         Random password generator for jazz_ui admin email ID login
#     """
#     alphabet = string.ascii_letters + string.digits
#     return ''.join(secrets.choice(alphabet) for i in range(8))


from installer.configurators.common import get_tfvars_file, replace_tfvars, passwd_generator


def configure_jenkins_container(existing_vpc_id, vpc_cidr, ecs_range):
    """
        Launch a containerized Jenkins server.
    """
    if existing_vpc_id:

# Path: installer/configurators/common.py
# def get_tfvars_file():
#     return get_terraform_folder() + "terraform.tfvars"
# 
# def replace_tfvars(key, value, fileName, quoteVal=True):
#     with in_place.InPlace(fileName) as fileContent:
#         for line in fileContent:
#             if quoteVal:
#                 fileContent.write(re.sub(r'({0} = )(.*)'.format(key), r'\1"{0}"'.format(value), line))
#             else:
#                 fileContent.write(re.sub(r'({0} = )(.*)'.format(key), r'\1{0}'.format(value), line))
# 
# def passwd_generator():
#     """
#         Random password generator for jazz_ui admin email ID login
#     """
#     alphabet = string.ascii_letters + string.digits
#     return ''.join(secrets.choice(alphabet) for i in range(8))


# Path: installer/configurators/jenkins_container.py
from installer.configurators.common import get_tfvars_file, replace_tfvars, passwd_generator



def configure_jenkins_container(existing_vpc_id, vpc_cidr, ecs_range):
    """
        Launch a containerized Jenkins server.
    """
    if existing_vpc_id:

        replace_tfvars('existing_vpc_ecs', existing_vpc_id, get_tfvars_file())