--- # ChatGPT desktop is installed from OpenAI's signed RPM repository; removal # must clean up the package, the managed repository and its signing key. - name: Validate ChatGPT desktop architecture on Fedora tags: [packages, chatgpt] ansible.builtin.assert: that: - ansible_facts['architecture'] in chatgpt_desktop_supported_architectures - ansible_facts['distribution_major_version'] in chatgpt_desktop_supported_fedora_versions fail_msg: >- ChatGPT desktop supports Fedora {{ chatgpt_desktop_supported_fedora_versions | join(' and ') }} on x86_64 or aarch64; detected Fedora {{ ansible_facts['distribution_major_version'] }} on {{ ansible_facts['architecture'] }}. when: chatgpt_desktop_install_enabled | default(false) | bool - name: Install ChatGPT desktop RPM signing key tags: [packages, chatgpt] ansible.builtin.copy: src: "{{ chatgpt_desktop_rpm_gpg_key }}" dest: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}" owner: root group: root mode: "0644" when: chatgpt_desktop_install_enabled | default(false) | bool - name: Import ChatGPT desktop RPM signing key tags: [packages, chatgpt] ansible.builtin.rpm_key: state: present key: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}" when: chatgpt_desktop_install_enabled | default(false) | bool - name: Configure ChatGPT desktop RPM repository tags: [packages, chatgpt] ansible.builtin.yum_repository: name: openai-chatgpt description: ChatGPT baseurl: "{{ chatgpt_desktop_rpm_repository }}" enabled: true gpgcheck: true repo_gpgcheck: true gpgkey: "file:///etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}" state: present when: chatgpt_desktop_install_enabled | default(false) | bool - name: Install ChatGPT desktop on selected Fedora hosts tags: [packages, chatgpt] ansible.builtin.dnf: name: chatgpt state: latest update_cache: true when: chatgpt_desktop_install_enabled | default(false) | bool - name: Check for the installed ChatGPT desktop signing key tags: [packages, chatgpt] ansible.builtin.stat: path: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}" get_checksum: false register: chatgpt_desktop_signing_key when: chatgpt_desktop_uninstall_enabled | default(false) | bool - name: Remove ChatGPT desktop from selected Fedora hosts tags: [packages, chatgpt] ansible.builtin.dnf: name: chatgpt state: absent when: chatgpt_desktop_uninstall_enabled | default(false) | bool - name: Remove ChatGPT desktop RPM repository tags: [packages, chatgpt] ansible.builtin.yum_repository: name: openai-chatgpt state: absent when: chatgpt_desktop_uninstall_enabled | default(false) | bool # rpm_key reads the identifier from the key file, so only remove the key from # the RPM database while the deployed file is still present. - name: Remove ChatGPT desktop RPM signing key from the RPM database tags: [packages, chatgpt] ansible.builtin.rpm_key: state: absent key: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}" when: - chatgpt_desktop_uninstall_enabled | default(false) | bool - chatgpt_desktop_signing_key.stat.exists | default(false) - name: Remove ChatGPT desktop RPM signing key file tags: [packages, chatgpt] ansible.builtin.file: path: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}" state: absent when: chatgpt_desktop_uninstall_enabled | default(false) | bool