Possibilité de configuration du titre dans config.yml
This commit is contained in:
parent
e50dae4b12
commit
08737d7adf
3 changed files with 11 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
||||||
### Chemin dans lequel se trouvent les playbooks ansible
|
### Chemin dans lequel se trouvent les playbooks ansible
|
||||||
base_path: ansible
|
base_path: ansible
|
||||||
|
### Titre du menu
|
||||||
|
title: Menu de configuration Libretic
|
||||||
|
|
||||||
### Liste des playbooks ansible
|
### Liste des playbooks ansible
|
||||||
# ansible_playbooks:
|
# ansible_playbooks:
|
||||||
|
|
|
@ -18,7 +18,7 @@ def setFQDN(fqdn):
|
||||||
|
|
||||||
### Cartouche de status
|
### Cartouche de status
|
||||||
|
|
||||||
def print_status():
|
def print_status(menuTitle):
|
||||||
# Récupération des infos
|
# Récupération des infos
|
||||||
hostname = getHostName()
|
hostname = getHostName()
|
||||||
domain = getDomain()
|
domain = getDomain()
|
||||||
|
@ -27,7 +27,7 @@ def print_status():
|
||||||
# Affichage du statut
|
# Affichage du statut
|
||||||
console = Console()
|
console = Console()
|
||||||
console.print()
|
console.print()
|
||||||
console.print("=== Menu de configuration Libretic ===", style="bold red")
|
console.print("=== {0} ===".format(menuTitle), style="bold red")
|
||||||
console.print()
|
console.print()
|
||||||
table = Table(show_header=True, header_style="bold dim")
|
table = Table(show_header=True, header_style="bold dim")
|
||||||
table.add_column("Paramètre", style="bold magenta")
|
table.add_column("Paramètre", style="bold magenta")
|
||||||
|
|
|
@ -102,8 +102,12 @@ def main():
|
||||||
config = readConfig("config.yml")
|
config = readConfig("config.yml")
|
||||||
currentBranch = GitActions.getBranch()
|
currentBranch = GitActions.getBranch()
|
||||||
|
|
||||||
description="Menu de configuration linuxinstaller"
|
if 'title' in config:
|
||||||
parser = argparse.ArgumentParser(description=description)
|
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)
|
parser.add_argument("--tags", help="Exécute les playbooks portant ces étiquettes", action="extend", nargs="+", type=str)
|
||||||
for entry in config['ansible_playbooks']:
|
for entry in config['ansible_playbooks']:
|
||||||
if 'argument_help' in config['ansible_playbooks'][entry]:
|
if 'argument_help' in config['ansible_playbooks'][entry]:
|
||||||
|
@ -148,7 +152,7 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
while not cmdlineOptionPassed:
|
while not cmdlineOptionPassed:
|
||||||
PythonActions.print_status()
|
PythonActions.print_status(title)
|
||||||
console = Console()
|
console = Console()
|
||||||
console.print("Choisir une des options suivantes", style="bold blue")
|
console.print("Choisir une des options suivantes", style="bold blue")
|
||||||
action = inquirer.select(
|
action = inquirer.select(
|
||||||
|
|
Loading…
Reference in a new issue