mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-08 19:27:18 +02:00
Changed 09_ports.yml to 10_ports.yml
This commit is contained in:
@@ -11,7 +11,7 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')
|
|||||||
from module_utils.entity_name_utils import get_entity_name
|
from module_utils.entity_name_utils import get_entity_name
|
||||||
|
|
||||||
# Paths to the group-vars files
|
# Paths to the group-vars files
|
||||||
PORTS_FILE = './group_vars/all/09_ports.yml'
|
PORTS_FILE = './group_vars/all/10_ports.yml'
|
||||||
NETWORKS_FILE = './group_vars/all/09_networks.yml'
|
NETWORKS_FILE = './group_vars/all/09_networks.yml'
|
||||||
ROLE_TEMPLATE_DIR = './templates/roles/web-app'
|
ROLE_TEMPLATE_DIR = './templates/roles/web-app'
|
||||||
ROLES_DIR = './roles'
|
ROLES_DIR = './roles'
|
||||||
|
@@ -11,7 +11,7 @@ class TestApplicationIDsInPorts(unittest.TestCase):
|
|||||||
# Path to the ports definition file
|
# Path to the ports definition file
|
||||||
ports_file = os.path.abspath(
|
ports_file = os.path.abspath(
|
||||||
os.path.join(
|
os.path.join(
|
||||||
os.path.dirname(__file__), '..', '..', 'group_vars', 'all', '09_ports.yml'
|
os.path.dirname(__file__), '..', '..', 'group_vars', 'all', '10_ports.yml'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
with open(ports_file, 'r', encoding='utf-8') as f:
|
with open(ports_file, 'r', encoding='utf-8') as f:
|
||||||
|
@@ -8,7 +8,7 @@ class TestOAuth2ProxyPorts(unittest.TestCase):
|
|||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
# Set up root paths and load oauth2_proxy ports mapping
|
# Set up root paths and load oauth2_proxy ports mapping
|
||||||
cls.ROOT = Path(__file__).parent.parent.parent.resolve()
|
cls.ROOT = Path(__file__).parent.parent.parent.resolve()
|
||||||
cls.PORTS_FILE = cls.ROOT / 'group_vars' / 'all' / '09_ports.yml'
|
cls.PORTS_FILE = cls.ROOT / 'group_vars' / 'all' / '10_ports.yml'
|
||||||
with cls.PORTS_FILE.open() as f:
|
with cls.PORTS_FILE.open() as f:
|
||||||
data = yaml.safe_load(f)
|
data = yaml.safe_load(f)
|
||||||
cls.oauth2_ports = (
|
cls.oauth2_ports = (
|
||||||
@@ -50,7 +50,7 @@ class TestOAuth2ProxyPorts(unittest.TestCase):
|
|||||||
if app_id not in self.oauth2_ports:
|
if app_id not in self.oauth2_ports:
|
||||||
self.fail(
|
self.fail(
|
||||||
f"Missing oauth2_proxy port mapping for application '{app_id}' "
|
f"Missing oauth2_proxy port mapping for application '{app_id}' "
|
||||||
f"in group_vars/all/09_ports.yml"
|
f"in group_vars/all/10_ports.yml"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ class TestPortReferencesValidity(unittest.TestCase):
|
|||||||
# locate and load the ports definition
|
# locate and load the ports definition
|
||||||
base = os.path.dirname(__file__)
|
base = os.path.dirname(__file__)
|
||||||
cls.ports_file = os.path.abspath(
|
cls.ports_file = os.path.abspath(
|
||||||
os.path.join(base, '..', '..', 'group_vars', 'all', '09_ports.yml')
|
os.path.join(base, '..', '..', 'group_vars', 'all', '10_ports.yml')
|
||||||
)
|
)
|
||||||
if not os.path.isfile(cls.ports_file):
|
if not os.path.isfile(cls.ports_file):
|
||||||
raise FileNotFoundError(f"{cls.ports_file} does not exist.")
|
raise FileNotFoundError(f"{cls.ports_file} does not exist.")
|
||||||
@@ -42,7 +42,7 @@ class TestPortReferencesValidity(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
Scan all .j2, .yml, .yaml files under roles/, group_vars/, host_vars/, tasks/,
|
Scan all .j2, .yml, .yaml files under roles/, group_vars/, host_vars/, tasks/,
|
||||||
templates/, and playbooks/ for any ports.<host>.<category>.<service> references
|
templates/, and playbooks/ for any ports.<host>.<category>.<service> references
|
||||||
(dot, [''], or .get('')) and verify each triple is defined in 09_ports.yml.
|
(dot, [''], or .get('')) and verify each triple is defined in 10_ports.yml.
|
||||||
"""
|
"""
|
||||||
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||||
dirs_to_scan = ['roles', 'group_vars', 'host_vars', 'tasks', 'templates', 'playbooks']
|
dirs_to_scan = ['roles', 'group_vars', 'host_vars', 'tasks', 'templates', 'playbooks']
|
||||||
|
@@ -8,7 +8,7 @@ class TestPortsUniqueness(unittest.TestCase):
|
|||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
base_dir = os.path.dirname(__file__)
|
base_dir = os.path.dirname(__file__)
|
||||||
cls.ports_file = os.path.abspath(
|
cls.ports_file = os.path.abspath(
|
||||||
os.path.join(base_dir, '..', '..', 'group_vars', 'all', '09_ports.yml')
|
os.path.join(base_dir, '..', '..', 'group_vars', 'all', '10_ports.yml')
|
||||||
)
|
)
|
||||||
# Try to load data; leave it as None if missing or invalid YAML
|
# Try to load data; leave it as None if missing or invalid YAML
|
||||||
try:
|
try:
|
||||||
|
@@ -18,7 +18,7 @@ class TestCreateDockerRoleCLI(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
# Temporary directory for YAML files and templates
|
# Temporary directory for YAML files and templates
|
||||||
self.tmpdir = tempfile.mkdtemp()
|
self.tmpdir = tempfile.mkdtemp()
|
||||||
self.ports_file = os.path.join(self.tmpdir, '09_ports.yml')
|
self.ports_file = os.path.join(self.tmpdir, '10_ports.yml')
|
||||||
self.networks_file = os.path.join(self.tmpdir, '09_networks.yml')
|
self.networks_file = os.path.join(self.tmpdir, '09_networks.yml')
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
Reference in New Issue
Block a user