refactor: remove obsolete pipx task and clean up ensure_ansible_collections function
Some checks failed
Nix Format Check / check-format (push) Failing after 37s
Some checks failed
Nix Format Check / check-format (push) Failing after 37s
This commit is contained in:
@ -66,9 +66,7 @@ def ensure_ansible_collections():
|
||||
if len(parts) >= 1:
|
||||
collection_name = parts[0]
|
||||
installed_collections.append(collection_name)
|
||||
|
||||
printfe("cyan", f"Found installed collections: {', '.join(installed_collections) if installed_collections else 'none'}")
|
||||
|
||||
|
||||
# Check which required collections are missing
|
||||
missing_collections = []
|
||||
for collection in required_collections:
|
||||
@ -166,16 +164,7 @@ def main():
|
||||
dotfiles_path = os.environ.get("DOTFILES_PATH", os.path.expanduser("~/.dotfiles"))
|
||||
hostname = os.uname().nodename
|
||||
username = os.environ.get("USER", os.environ.get("USERNAME", "user"))
|
||||
|
||||
# Check if ansible is installed
|
||||
status, _ = run_command(["which", "ansible-playbook"], shell=False)
|
||||
if not status:
|
||||
printfe("yellow", "Ansible is not installed, installing it with pipx...")
|
||||
status, output = run_command(["pipx", "install", "--include-deps", "ansible", "ansible-lint"], shell=False)
|
||||
if not status:
|
||||
printfe("red", f"Failed to install Ansible: {output}")
|
||||
return 1
|
||||
|
||||
|
||||
# Ensure required collections are installed
|
||||
if not ensure_ansible_collections():
|
||||
printfe("red", "Failed to ensure required Ansible collections are installed")
|
||||
|
Reference in New Issue
Block a user