def METHOD_NAME(tmp_path):
    """Generate a random inventory, write the files and return the resulting
    inventory, the directory containing the files and the key for credential
    decryption
    """
    inventory, credentials, result = get_random_node_list(INVENTORY_SIZE)
    # Generate the inventory files
    # Write the inventory file
    inv_data = yaml.safe_dump(inventory)
    if not inv_data:
        assert False, "Unable to produce the device list"
    with open(f'{tmp_path}/inv_0.yml', "w") as out_file:
        out_file.write(inv_data)
    # Encrypt and write the credential file
    cred_key = Fernet.generate_key()
    encryptor = Fernet(cred_key)
    cred_data = yaml.safe_dump(credentials)
    if not cred_data:
        assert False, "Unable to produce the credentials list"
    # Encrypt credential data
    enc_cred_data = encryptor.encrypt(cred_data.encode('utf-8'))
    with open(f'{tmp_path}/cred_0', "w") as out_file:
        out_file.write(enc_cred_data.decode())
    return result, tmp_path, cred_key.decode()