{"id":5827,"sha1":"623cf225422bf2050799056cd2faccc30e49fa77","playbook":{"id":3707,"items":{"plays":2,"tasks":0,"results":0,"hosts":0,"files":1,"records":0},"arguments":{"version":null,"verbosity":1,"private_key_file":"/home/ssh-gateway/.ssh/id_rsa","remote_user":"root","connection":"ssh","timeout":null,"ssh_common_args":null,"sftp_extra_args":null,"scp_extra_args":null,"ssh_extra_args":null,"ask_pass":false,"connection_password_file":null,"force_handlers":false,"flush_cache":false,"become":false,"become_method":"sudo","become_user":null,"become_ask_pass":false,"become_password_file":null,"tags":["all"],"skip_tags":[],"check":false,"diff":false,"inventory":["/home/ssh-gateway/ansible/kuly/bash-kvm-inventory-dev.sh"],"listhosts":false,"subset":"friendly-pelican.man-1.solus.stage.town","extra_vars":"Not saved by ARA as configured by 'ignored_arguments'","vault_ids":[],"ask_vault_pass":false,"vault_password_files":[],"forks":20,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["find_snowflakes_repos.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"},{"id":225,"name":"subset:friendly-pelican.man-1.solus.stage.town"}],"started":"2025-09-11T13:50:53.784980+01:00","ended":"2025-09-11T13:50:54.111848+01:00","duration":"00:00:00.326868","name":null,"ansible_version":"2.16.11","client_version":"1.7.3","python_version":"3.10.10","server_version":"1.7.3","status":"completed","path":"/home/ssh-gateway/ansible/kuly/find_snowflakes_repos.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Detect snowflake repositories on AlmaLinux 8 servers\n  hosts: almalinux8_servers\n  gather_facts: no\n  become: yes\n\n  vars:\n    # Define your baseline repos here\n    baseline_repos:\n      - appstream\n      - baseos\n      - epel\n      - extras\n\n  tasks:\n    - name: Get list of enabled repos\n      command: dnf repolist enabled -q\n      register: repo_output\n\n    - name: Parse enabled repos into a list\n      set_fact:\n        enabled_repos: \"{{ repo_output.stdout_lines | map('regex_replace', '^\\\\S+\\\\s+(\\\\S+).*', '\\\\1') | list }}\"\n      when: repo_output.stdout_lines is defined\n\n    - name: Determine snowflake repos (repos not in baseline)\n      set_fact:\n        snowflake_repos: \"{{ enabled_repos | difference(baseline_repos) }}\"\n\n    - name: Show snowflake repos per host\n      debug:\n        msg: \"Snowflake repos on {{ inventory_hostname }}: {{ snowflake_repos | default([]) }}\"\n\n    - name: Save results centrally\n      add_host:\n        name: \"snowflake_summary\"\n        snowflakes: \"{{ hostvars[inventory_hostname].snowflake_repos | default([]) }}\"\n        ansible_host: \"localhost\"\n      when: snowflake_repos | length > 0\n\n- name: Summarize snowflake repos\n  hosts: snowflake_summary\n  gather_facts: no\n  tasks:\n    - name: Print summary\n      debug:\n        msg: \"Host {{ item.key }} has extra repos: {{ item.value }}\"\n      with_dict: \"{{ hostvars }}\"\n      when: item.value.snowflake_repos is defined and item.value.snowflake_repos | length > 0\n\n","created":"2025-09-11T13:50:53.802683+01:00","updated":"2025-09-11T13:50:53.802703+01:00","path":"/home/ssh-gateway/ansible/kuly/find_snowflakes_repos.yaml"}