mirror of
https://github.com/Cian-H/I-Form_Server_Node_Deployer.git
synced 2025-12-22 22:22:02 +00:00
Added top-level overall command
This commit is contained in:
@@ -121,6 +121,7 @@ def json_to_img(
|
||||
str, typer.Option(help="The file to output the disk image to", prompt=True)
|
||||
],
|
||||
) -> None:
|
||||
"""Takes a fuel-ignition json file and produces an ignition disk image file"""
|
||||
selenium_container = None
|
||||
fuelignition_container = None
|
||||
fuelignition_image = None
|
||||
|
||||
@@ -85,6 +85,7 @@ def create_ignition_disk(
|
||||
str, typer.Option(help="Swarm token for connecting to the swarm", prompt=True)
|
||||
],
|
||||
) -> None:
|
||||
"""Writes an ignition image to the specified disk for easy deployment of new nodes to the swarm""" # noqa
|
||||
create_img(hostname, password, switch_ip_address, switch_port, swarm_token)
|
||||
valid, response = validate()
|
||||
if not valid:
|
||||
|
||||
@@ -90,6 +90,7 @@ def create_img(
|
||||
str, typer.Option(help="Swarm token for connecting to the swarm", prompt=True)
|
||||
],
|
||||
) -> None:
|
||||
"""Creates an ignition image for deploying a new node to the swarm"""
|
||||
switch_ip_address = ipaddress.ip_address(switch_ip_address)
|
||||
if switch_port > MAX_PORT:
|
||||
raise ValueError(f"Port must be less than {MAX_PORT}")
|
||||
|
||||
18
node_deployer.py
Normal file
18
node_deployer.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import typer
|
||||
|
||||
from create_img import create_img
|
||||
from create_disk import create_ignition_disk
|
||||
from autoignition import json_to_img
|
||||
|
||||
app = typer.Typer(
|
||||
help="A tool for creating ignition images for automated deployment to a swarm"
|
||||
)
|
||||
|
||||
app.command()(create_img)
|
||||
app.command()(create_ignition_disk)
|
||||
app.command()(json_to_img)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app()
|
||||
Reference in New Issue
Block a user