community.general.gio_mime (8.5.0) — module

Set default handler for MIME type, for applications using Gnome GIO

| "added in version" 7.5.0 of community.general"

Authors: Alexei Znamensky (@russoz)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module allows configuring the default handler for a specific MIME type, to be used by applications built with th Gnome GIO API.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set chrome as the default handler for https
  community.general.gio_mime:
    mime_type: x-scheme-handler/https
    handler: google-chrome.desktop
  register: result

Inputs

    
handler:
    description:
    - Default handler will be set for the MIME type.
    required: true
    type: str

mime_type:
    description:
    - MIME type for which a default handler will be set.
    required: true
    type: str

Outputs

handler:
  description:
  - The handler set as default.
  returned: success
  sample: google-chrome.desktop
  type: str
stderr:
  description:
  - The error output of the C(gio) command.
  returned: failure
  sample: 'gio: Failed to load info for handler "never-existed.desktop"'
  type: str
stdout:
  description:
  - The output of the C(gio) command.
  returned: success
  sample: Set google-chrome.desktop as the default for x-scheme-handler/https
  type: str

See also