--- - name: XXXigCC 卸载脚本 hosts: all become: yes tasks: - name: 下载卸载脚本 ansible.builtin.get_url: url: https://gitea.bcde.io/wangdefa/xxxigcc/raw/branch/main/script/uninstall.sh dest: /tmp/uninstall.sh mode: '0755' force: yes validate_certs: yes register: download_result - name: 执行卸载脚本 ansible.builtin.shell: /tmp/uninstall.sh -y --purge args: executable: /bin/bash register: script_output changed_when: true - name: 显示脚本执行结果 ansible.builtin.debug: var: script_output.stdout_lines - name: 清理临时脚本文件 ansible.builtin.file: path: /tmp/uninstall.sh state: absent