-@gerrit:opendev.org- Nils Gondermann proposed: [zuul/zuul] 915326: Add inherit-files attr to evaluate parent file matchers https://review.opendev.org/c/zuul/zuul/+/915326 | 08:36 | |
-@gerrit:opendev.org- Alberto Gonzalez proposed: [zuul/zuul] 916613: Fix typos in docstrings https://review.opendev.org/c/zuul/zuul/+/916613 | 08:52 | |
-@gerrit:opendev.org- Alberto Gonzalez proposed: [zuul/zuul] 916613: Fix typos in docstrings https://review.opendev.org/c/zuul/zuul/+/916613 | 08:54 | |
-@gerrit:opendev.org- Nils Gondermann proposed: [zuul/zuul] 915326: Add inherit-files attr to evaluate parent file matchers https://review.opendev.org/c/zuul/zuul/+/915326 | 10:33 | |
-@gerrit:opendev.org- Nils Gondermann proposed: [zuul/zuul] 915326: Add inherit-files attr to evaluate parent file matchers https://review.opendev.org/c/zuul/zuul/+/915326 | 12:27 | |
-@gerrit:opendev.org- Nils Gondermann proposed: [zuul/zuul] 915326: Add inherit-files attr to evaluate parent file matchers https://review.opendev.org/c/zuul/zuul/+/915326 | 13:48 | |
@fungicide:matrix.org | > <@harbott.osism.tech:regio.chat> is it possible to use nodepool 10.x with zuul 9.x or do they need to be upgraded in sync? | 14:27 |
---|---|---|
at least in the past we've made a point of mentioning new minimum versions in release notes | ||
@fungicide:matrix.org | like https://zuul-ci.org/docs/zuul/latest/releasenotes.html#relnotes-4-10-0-upgrade-notes | 14:28 |
@clarkb:matrix.org | I don't think nodepool 10.x and zuul have a strong coupling | 15:07 |
@jpew:matrix.org | Would someone mind a look at https://review.opendev.org/c/zuul/zuul/+/914818 ? | 15:37 |
@f2ked:matrix.org | where can I add custom roles that are trusted? | 19:58 |
I'm trying to use my `zuul-config` but I get | ||
``` | ||
2024-04-22 19:24:21.102047 | ERROR! couldn't resolve module/action 'conductor'. This often indicates a misspelling, missing collection, or incorrect module path. | ||
``` | ||
@f2ked:matrix.org | I added | 20:00 |
``` | ||
roles: | ||
- zuul: zuul/zuul-config | ||
``` | ||
to the job | ||
@clarkb:matrix.org | Does that error come with a traceback to provide more context? I'm wondering specifically if the error occurs in zuul or ansible context | 20:24 |
@f2ked:matrix.org | here is more logs | 20:35 |
``` | ||
2024-04-22 19:24:20.531806 | RUN START: [untrusted : gerrit/XXX/zuul.d/playbooks/build.yaml@master] | ||
2024-04-22 19:24:21.102026 | ANSIBLE PARSE ERROR | ||
2024-04-22 19:24:21.102042 | Using /var/lib/zuul/builds/ee0170d8db284868b705b32d4ad81a9c/ansible/playbook_0/ansible.cfg as config file | ||
2024-04-22 19:24:21.102047 | ERROR! couldn't resolve module/action 'conductor'. This often indicates a misspelling, missing collection, or incorrect module path. | ||
2024-04-22 19:24:21.102051 | | ||
2024-04-22 19:24:21.102053 | The error appears to be in '/var/lib/zuul/builds/ee0170d8db284868b705b32d4ad81a9c/untrusted/project_0/gerrit/XXX/zuul.d/playbooks/build.yaml': line 44, column 7, but may | ||
2024-04-22 19:24:21.102056 | be elsewhere in the file depending on the exact syntax problem. | ||
2024-04-22 19:24:21.102058 | | ||
2024-04-22 19:24:21.102060 | The offending line appears to be: | ||
2024-04-22 19:24:21.102063 | | ||
2024-04-22 19:24:21.102065 | | ||
2024-04-22 19:24:21.102067 | - name: Upload with conductor | ||
2024-04-22 19:24:21.102070 | ^ here | ||
``` | ||
@clarkb:matrix.org | that shows it is an ansible error. Not a zuul error. | 20:37 |
@clarkb:matrix.org | do you know what conductor it is trying to run and where that lives? Is it part of zuul-jobs which is why you think the problem is including roles? | 20:38 |
-@gerrit:opendev.org- James E. Blair https://matrix.to/#/@jim:acmegating.com proposed: [zuul/zuul] 916684: Gitlab: make change.files persistent https://review.opendev.org/c/zuul/zuul/+/916684 | 20:38 | |
@clarkb:matrix.org | I don't find it in the upstream zuul-jobs | 20:40 |
@f2ked:matrix.org | conductor is my own private role, I have placed it in my trusted gerrit `zuul-config` repo hoping it would be picked up | 20:44 |
@sjal:matrix.org | it gets picked up the point is your role doesn't work | 20:50 |
@clarkb:matrix.org | got it, is that trusted zuul-config repo the same as the one addressed by `zuul: zuul/zuul-config` ? | 20:50 |
@clarkb:matrix.org | oh! yes it could just be an error in the role. good point sjal | 20:51 |
@sjal:matrix.org | he's using an undefined module | 20:51 |
@sjal:matrix.org | I've got my work laptop, let me check how I'm handling this because I don't remember from the top off my head | 20:51 |
@jim:acmegating.com | the docs for how roles are added are here: https://zuul-ci.org/docs/zuul/latest/config/job.html note the information about repo structure and inheritance hierarchy | 20:54 |
@sjal:matrix.org | so anyways if I have custom modules in a role I have corresponding `.py` files under `library` directory | 20:55 |
@sjal:matrix.org | where are you storing the `conductor` module? it looks like your role can't find it | 20:55 |
@f2ked:matrix.org | I'm starting from the tutorial with `gerrit:zuul-config` that contains all my pipeline stuff. | 21:00 |
I added `./roles/conductor/...` to that repo and used `job.roles.zuul` (as above) to make it available (I hoped) | ||
@jim:acmegating.com | f2ked: since i've seen the word "trusted" ... if you added this to a job definition in a trusted repo, then the addition of the roles won't take effect until that change is merged (changes to job definitions in trusted repos don't take effect until they merge; ie, they aren't self-testing). | 21:03 |
@f2ked:matrix.org | corvus: in the thread you can see how I followed the instructions and added | 21:08 |
``` | ||
-job: | ||
roles: | ||
- zuul: zuul/zuul-config | ||
``` | ||
@f2ked:matrix.org | the role has been merged into the `zuul-config` repo and is in master | 21:09 |
@sjal:matrix.org | can you post your `Upload with conductor` task? | 21:12 |
@sjal:matrix.org | to me it looks like you're using `conductor` module for it which Zuul has trouble finding | 21:13 |
@f2ked:matrix.org | ``` | 21:18 |
- hosts: all | ||
... | ||
roles: | ||
... | ||
- conductor | ||
... | ||
tasks: | ||
... | ||
- name: Upload with conductor | ||
conductor: | ||
key: XXX | ||
files: | ||
- "{{ tarball }}" | ||
... | ||
``` | ||
@sjal:matrix.org | yeah, exactly :) | 21:18 |
@sjal:matrix.org | how do you expect Zuul to run your custom module? | 21:18 |
@sjal:matrix.org | this is the problem Zuul has with your playbook, it does not know what to do with `conductor` module because it does not know it. You need to make a `library` directory in the role and put `conductor.py` there for it to see | 21:19 |
@sjal:matrix.org | it's not a Zuul problem but rather an Ansible problem just like Clark said | 21:22 |
@f2ked:matrix.org | conductor is very simple and uses other "roles" | 21:26 |
my understanding is that `job.roles.zuul: zuul/zuul-jobs` is that places that repo in ansible's `role_path`, right? | ||
so adding `job.roles.zuul: zuul/zuul-config` should do the same? | ||
if not.. how do I influence `roles_path` from zuul? | ||
@sjal:matrix.org | I feel ignored | 21:26 |
@f2ked:matrix.org | I apologize.. what part am I missing that makes you feel that way? | 21:28 |
@fungicide:matrix.org | ERROR! couldn't resolve module/action 'conductor'. | 21:28 |
@fungicide:matrix.org | we would need to see the contents of your custom conductor role, but seems like it contains a task referring to an ansible module named "conductor" which doesn't exist (or which ansible can't find) | 21:29 |
@sjal:matrix.org | > <@f2ked:matrix.org> I apologize.. what part am I missing that makes you feel that way? | 21:30 |
You're not providing`conductor` module to the ansible environment. There's no skipping that if you want to run it you need to put the custom module inside your role | ||
@sjal:matrix.org | > <@f2ked:matrix.org> I apologize.. what part am I missing that makes you feel that way? | 21:31 |
* You're not providing`conductor` module to the ansible environment. There's no skipping that. If you want to run it you need to put the custom module inside your role | ||
@sjal:matrix.org | Basically this is the answer to your problem: https://stackoverflow.com/a/52979849/11390058 | 21:31 |
@sjal:matrix.org | > <@fungicide:matrix.org> we would need to see the contents of your custom conductor role, but seems like it contains a task referring to an ansible module named "conductor" which doesn't exist (or which ansible can't find) | 21:32 |
from what I understood he pasted that just below - the role uses `conductor` module which is unknown to the environment run by zuul | ||
@fungicide:matrix.org | yeah, i see now you provided a copy of the conductor role, but maybe what you're not understanding is that the "conductor" reference inside that "Upload with conductor" task needs to be an ansible module somewhere ansible can find | 21:33 |
@sjal:matrix.org | > <@f2ked:matrix.org> ``` | 21:33 |
> - hosts: all | ||
> ... | ||
> roles: | ||
> ... | ||
> - conductor | ||
> ... | ||
> tasks: | ||
> ... | ||
> - name: Upload with conductor | ||
> conductor: | ||
> key: XXX | ||
> files: | ||
> - "{{ tarball }}" | ||
> ... | ||
> | ||
> ``` | ||
imo this is playbook and below is the `conductor` role | ||
@fungicide:matrix.org | but maybe the user confusion is that an ansible role is not the same thing as an ansible module, and you haven't said anything about where that module lives | 21:34 |
@fungicide:matrix.org | it looks like you have a *role* named conductor but your task also refers to a *module* named conductor. those are different | 21:35 |
@f2ked:matrix.org | ok.. how does zuul tell ansible that there is a repo that contains "roles" | 21:35 |
conductor is just a set of basic ansible tasks | ||
@sjal:matrix.org | and what does an ansible task do? | 21:36 |
@f2ked:matrix.org | the role has no refernce to conductor at all | 21:37 |
@sjal:matrix.org | it runs a module and you have a custom one | 21:37 |
@fungicide:matrix.org | all the repos referenced in the roles list are checked for a roles directory. does your conductor role also provide a module named conductor? | 21:37 |
@sjal:matrix.org | ``` | 21:37 |
- name: Upload with conductor | ||
conductor: <-- this is your custom module | ||
key: XXX | ||
files: | ||
- "{{ tarball }}" | ||
``` | ||
@sjal:matrix.org | because it's custom you need to provide code for it otherwise it will only work on your machine | 21:37 |
@sjal:matrix.org | > <@f2ked:matrix.org> the role has no refernce to conductor at all | 21:38 |
it does, just pinpointed it in the example above | ||
@f2ked:matrix.org | ``` | 21:38 |
# tasks file for conductor | ||
- name: Install AWS | ||
pip: | ||
name: | ||
- awscli | ||
- name: Upload artifacts to S3 | ||
loop: "{{ files }}" | ||
shell: | ||
executable: /bin/bash | ||
cmd: | | ||
set -xeo pipefail | ||
<an aws command> | ||
``` | ||
@fungicide:matrix.org | sounds like maybe that `Upload with conductor` task is in the playbook not in the *conductor* role contents, but doesn't change the fact that the task is referring to an ansible module (not role) which needs to be defined somewhere | 21:39 |
@sjal:matrix.org | if `conductor` isn't a custom module but just a role you're invoking it in a wrong way | 21:40 |
@sjal:matrix.org | Does this look like something you wanted to do? https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_role_module.html | 21:41 |
@jim:acmegating.com | a useful iterative development process is to work on an ansible playbook on its own before asking zuul to run it. | 21:46 |
@sjal:matrix.org | can't blame him, who has the time for that :D | 21:47 |
@f2ked:matrix.org | hey.. I figured since it was a solid `play` making it a role should be easy :) | 21:49 |
@f2ked:matrix.org | ok.. I get it now.. I thought referencing the role in a task used it, but as sjal has been saying.. I'm invoking a "module". | 21:51 |
https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#including-roles-dynamic-reuse | ||
@f2ked:matrix.org | thanks all | 21:51 |
@sjal:matrix.org | see you around hopefully :) | 21:52 |
@jim:acmegating.com | > <@f2ked:matrix.org> hey.. I figured since it was a solid `play` making it a role should be easy :) | 22:04 |
yep, that's a solid refactoring impulse. :) i mentioned that just to note that it's easy to get fixated on the zuul aspect, but one of the reasons we went with ansible is that it's easy to run standalone to develop/debug job issues. roles help with that too. :) | ||
@f2ked:matrix.org | closing the loop | 22:39 |
``` | ||
- name: Upload with conductor | ||
include_role: | ||
name: conductor | ||
vars: | ||
key: XXX | ||
files: | ||
- "{{ tarball }}" | ||
``` | ||
did it.. thanks again y'all |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!