fuck scammers, abusers and bad actors!
This commit is contained in:
@@ -20,6 +20,10 @@ def help_message():
|
||||
"green",
|
||||
" --ansible-verbose Upgrade Ansible packages with verbose output. (-vvv)",
|
||||
)
|
||||
printfe(
|
||||
"green",
|
||||
" --tags TAG Run only specific Ansible tags (e.g., --tags caddy).",
|
||||
)
|
||||
printfe(
|
||||
"green",
|
||||
" --full-speed, -F Upgrade packages and use all available cores for compilation. (Default: 8 cores)",
|
||||
@@ -222,6 +226,9 @@ def main():
|
||||
action="store_true",
|
||||
help="Upgrade Ansible packages with verbose output",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--tags", type=str, help="Run only specific Ansible tags"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--full-speed", "-F", action="store_true", help="Use all available cores"
|
||||
)
|
||||
@@ -338,12 +345,19 @@ def main():
|
||||
return 1
|
||||
|
||||
printfe("cyan", "Running Ansible playbook...")
|
||||
# Determine which playbook to use based on tags
|
||||
if args.tags and any(tag.strip() in ['caddy', 'country-blocking', 'caddyfile', 'config'] for tag in args.tags.split(',')):
|
||||
playbook_path = f"{dotfiles_path}/config/ansible/caddy-playbook.yml"
|
||||
printfe("cyan", f"Using dedicated Caddy playbook for tags: {args.tags}")
|
||||
else:
|
||||
playbook_path = f"{dotfiles_path}/config/ansible/playbook.yml"
|
||||
|
||||
ansible_cmd = [
|
||||
"/usr/bin/env",
|
||||
"ansible-playbook",
|
||||
"-i",
|
||||
f"{dotfiles_path}/config/ansible/inventory.ini",
|
||||
f"{dotfiles_path}/config/ansible/playbook.yml",
|
||||
playbook_path,
|
||||
"--extra-vars",
|
||||
f"hostname={hostname}",
|
||||
"--extra-vars",
|
||||
@@ -353,9 +367,15 @@ def main():
|
||||
"--ask-become-pass",
|
||||
]
|
||||
|
||||
if args.tags:
|
||||
ansible_cmd.extend(["--tags", args.tags])
|
||||
|
||||
if args.ansible_verbose:
|
||||
ansible_cmd.append("-vvv")
|
||||
|
||||
# Debug: Show the command being executed
|
||||
printfe("yellow", f"Debug: Executing command: {' '.join(ansible_cmd)}")
|
||||
|
||||
result = subprocess.run(ansible_cmd)
|
||||
if result.returncode != 0:
|
||||
printfe("red", "Failed to upgrade Ansible packages.")
|
||||
|
Reference in New Issue
Block a user