diff --git a/config.yml.example b/config.yml.example index 011828c..d29ef0a 100644 --- a/config.yml.example +++ b/config.yml.example @@ -1,5 +1,7 @@ ### Chemin dans lequel se trouvent les playbooks ansible base_path: ansible +### Titre du menu +title: Menu de configuration Libretic ### Liste des playbooks ansible # ansible_playbooks: diff --git a/linuxinstaller/PythonActions.py b/linuxinstaller/PythonActions.py index bf0173b..61381d3 100644 --- a/linuxinstaller/PythonActions.py +++ b/linuxinstaller/PythonActions.py @@ -18,7 +18,7 @@ def setFQDN(fqdn): ### Cartouche de status -def print_status(): +def print_status(menuTitle): # Récupération des infos hostname = getHostName() domain = getDomain() @@ -27,7 +27,7 @@ def print_status(): # Affichage du statut console = Console() console.print() - console.print("=== Menu de configuration Libretic ===", style="bold red") + console.print("=== {0} ===".format(menuTitle), style="bold red") console.print() table = Table(show_header=True, header_style="bold dim") table.add_column("Paramètre", style="bold magenta") diff --git a/linuxinstaller/linuxinstaller.py b/linuxinstaller/linuxinstaller.py index 068f5e2..1aa7c76 100644 --- a/linuxinstaller/linuxinstaller.py +++ b/linuxinstaller/linuxinstaller.py @@ -102,8 +102,12 @@ def main(): config = readConfig("config.yml") currentBranch = GitActions.getBranch() - description="Menu de configuration linuxinstaller" - parser = argparse.ArgumentParser(description=description) + if 'title' in config: + title=config['title'] + else: + title="Menu de configuration linuxinstaller" + + parser = argparse.ArgumentParser(description=title) parser.add_argument("--tags", help="Exécute les playbooks portant ces étiquettes", action="extend", nargs="+", type=str) for entry in config['ansible_playbooks']: if 'argument_help' in config['ansible_playbooks'][entry]: @@ -148,7 +152,7 @@ def main(): while not cmdlineOptionPassed: - PythonActions.print_status() + PythonActions.print_status(title) console = Console() console.print("Choisir une des options suivantes", style="bold blue") action = inquirer.select(