Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playbook error #1998

Open
mikaelparkefelt opened this issue May 7, 2024 · 0 comments
Open

Playbook error #1998

mikaelparkefelt opened this issue May 7, 2024 · 0 comments

Comments

@mikaelparkefelt
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants