{"id":5800,"sha1":"e8160c808638d9966ea452537087242a507bfae7","playbook":{"id":3680,"items":{"plays":1,"tasks":7,"results":7,"hosts":2,"files":1,"records":0},"arguments":{"version":null,"verbosity":2,"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":"popular-flamingo.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":182,"name":"subset:popular-flamingo.man-1.solus.stage.town"}],"started":"2025-09-11T13:06:03.888896+01:00","ended":"2025-09-11T13:06:09.145109+01:00","duration":"00:00:05.256213","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: Check for 3rd-party enabled repositories via bash script\n  hosts: all\n  become: true\n\n  tasks:\n    - name: Create temp directory for script\n      ansible.builtin.file:\n        path: /tmp/snowflake_check\n        state: directory\n        mode: '0700'\n\n    - name: Upload snowflake detection script\n      ansible.builtin.copy:\n        src: find_snowflakes_repos.sh\n        dest: /tmp/snowflake_check/find_snowflakes_repos\n        mode: '0755'\n\n    - name: Run snowflake detection script\n      ansible.builtin.command: /tmp/snowflake_check/find_snowflakes_repos\n      register: script_output\n      changed_when: false\n\n    - name: Cleanup script\n      ansible.builtin.file:\n        path: /tmp/snowflake_check\n        state: absent\n\n    - name: Register output for reporting\n      ansible.builtin.set_fact:\n        snowflake_result: \"{{ script_output.stdout }}\"\n\n    - name: Aggregate all results (run once on first host)\n      ansible.builtin.set_fact:\n        all_results: >-\n          {{\n            (all_results | default([])) + [hostvars[item].snowflake_result]\n          }}\n      delegate_to: localhost\n      run_once: true\n      when: ansible_play_hosts_all.index(inventory_hostname) == 0\n      loop: \"{{ ansible_play_hosts_all }}\"\n\n    - name: Parse and display tabular report\n      ansible.builtin.debug:\n        msg: |\n          {% set lines = all_results %}\n          {% set data = [] %}\n          {% for line in lines %}\n          {%   set parts = line.split(',') %}\n          {%   set host = parts[0].split(':')[1] %}\n          {%   set snow = parts[1].split(':')[1] %}\n          {%   set _ = data.append({'host': host, 'snowflakes': snow}) %}\n          {% endfor %}\n          {% set max_host_len = (data | map(attribute='host') | map('length') | max) + 2 %}\n          {% set header_host = 'HOST' | center(max_host_len) %}\n          {% set header_snow = 'THIRD-PARTY REPOS' %}\n          {{ '=' * (max_host_len + 40) }}\n          {{ header_host }} | {{ header_snow }}\n          {{ '-' * (max_host_len + 40) }}\n          {% for item in data %}\n          {{ item.host | center(max_host_len) }} | {{ item.snowflakes }}\n          {% endfor %}\n          {{ '=' * (max_host_len + 40) }}\n      delegate_to: localhost\n      run_once: true\n      when: ansible_play_hosts_all.index(inventory_hostname) == 0\n","created":"2025-09-11T13:06:03.920167+01:00","updated":"2025-09-11T13:06:03.920188+01:00","path":"/home/ssh-gateway/ansible/kuly/find_snowflakes_repos.yaml"}