semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Playbook error

Open mikaelparkefelt opened this issue 9 months ago • 0 comments

I have a playbook with this list of tasks: ` - name: Fetching available collections command: ansible-galaxy collection list register: result

- name: Available collections
  debug:
    var: result.stdout_lines

- name: Fetching available roles
  command: ansible-galaxy list
  register: result

- name: Available roles
  debug:
    var: result.stdout_lines

` and I get this error:

TASK [Fetching available collections] ******************************************
fatal: [localhost]: FAILED! => {
   "changed":true,
   "cmd":[
      "ansible-galaxy",
      "collection",
      "list"
   ],
   "delta":"0:00:02.423948",
   "end":"2024-04-30 13:26:21.383339",
   "msg":"non-zero return code",
   "rc":5,
   "start":"2024-04-30 13:26:18.959391",
   "stderr":"\u001b[0;31mERROR! - None of the provided paths were usable. Please specify a valid path with --collections-path\u001b[0m",
   "stderr_lines":[
      "\u001b[0;31mERROR! - None of the provided paths were usable. Please specify a valid path with --collections-path\u001b[0m"
   ],
   "stdout":"usage: ansible-galaxy [-h] [--version] [-v] TYPE ...\n\nPerform various Role and Collection related operations.\n\npositional arguments:\n  TYPE\n    collection   Manage an Ansible Galaxy collection.\n    role         Manage an Ansible Galaxy role.\n\noptions:\n  --version      show program's version number, config file location,\n                 configured module search path, module location, executable\n                 location and exit\n  -h, --help     show this help message and exit\n  -v, --verbose  Causes Ansible to print more debug messages. Adding multiple\n                 -v will increase the verbosity, the builtin plugins currently\n                 evaluate up to -vvvvvv. A reasonable level to start is -vvv,\n                 connection debugging might require -vvvv.",
   "stdout_lines":[
      "usage: ansible-galaxy [-h] [--version] [-v] TYPE ...",
      "",
      "Perform various Role and Collection related operations.",
      "",
      "positional arguments:",
      "  TYPE",
      "    collection   Manage an Ansible Galaxy collection.",
      "    role         Manage an Ansible Galaxy role.",
      "",
      "options:",
      "  --version      show program's version number, config file location,",
      "                 configured module search path, module location, executable",
      "                 location and exit",
      "  -h, --help     show this help message and exit",
      "  -v, --verbose  Causes Ansible to print more debug messages. Adding multiple",
      "                 -v will increase the verbosity, the builtin plugins currently",
      "                 evaluate up to -vvvvvv. A reasonable level to start is -vvv,",
      "                 connection debugging might require -vvvv."
   ]
}

I have a ansible.cfg that is specifying the COLLECTIONS_PATH and DEFAULT_ROLES_PATH to custom paths.

This tasks are working fine on my local machine when I run the playbook but in in Ansible Semaphore UI.

I guess this could be related to #1984 Not possible to set working directory for a template task

mikaelparkefelt avatar May 07 '24 07:05 mikaelparkefelt