Monday, 2024-04-22

-@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/+/91532608:36
-@gerrit:opendev.org- Alberto Gonzalez proposed: [zuul/zuul] 916613: Fix typos in docstrings https://review.opendev.org/c/zuul/zuul/+/91661308:52
-@gerrit:opendev.org- Alberto Gonzalez proposed: [zuul/zuul] 916613: Fix typos in docstrings https://review.opendev.org/c/zuul/zuul/+/91661308: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/+/91532610: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/+/91532612: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/+/91532613: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.orglike https://zuul-ci.org/docs/zuul/latest/releasenotes.html#relnotes-4-10-0-upgrade-notes14:28
@clarkb:matrix.orgI don't think nodepool 10.x and zuul have a strong coupling15:07
@jpew:matrix.orgWould someone mind a look at https://review.opendev.org/c/zuul/zuul/+/914818 ?15:37
@f2ked:matrix.orgwhere 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.orgI added 20:00
```
roles:
- zuul: zuul/zuul-config
```
to the job
@clarkb:matrix.orgDoes that error come with a traceback to provide more context? I'm wondering specifically if the error occurs in zuul or ansible context20:24
@f2ked:matrix.orghere is more logs20: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.orgthat shows it is an ansible error. Not a zuul error.20:37
@clarkb:matrix.orgdo 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/+/91668420:38
@clarkb:matrix.orgI don't find it in the upstream zuul-jobs20:40
@f2ked:matrix.orgconductor is my own private role, I have placed it in my trusted gerrit `zuul-config` repo hoping it would be picked up20:44
@sjal:matrix.orgit gets picked up the point is your role doesn't work20:50
@clarkb:matrix.orggot it, is that trusted zuul-config repo the same as the one addressed by `zuul: zuul/zuul-config` ?20:50
@clarkb:matrix.orgoh! yes it could just be an error in the role. good point sjal 20:51
@sjal:matrix.orghe's using an undefined module20:51
@sjal:matrix.orgI've got my work laptop, let me check how I'm handling this because I don't remember from the top off my head20:51
@jim:acmegating.comthe 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 hierarchy20:54
@sjal:matrix.orgso anyways if I have custom modules in a role I have corresponding `.py` files under `library` directory20:55
@sjal:matrix.orgwhere are you storing the `conductor` module? it looks like your role can't find it20:55
@f2ked:matrix.orgI'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.comf2ked: 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.orgcorvus: in the thread you can see how I followed the instructions and added21:08
```
-job:
roles:
- zuul: zuul/zuul-config
```
@f2ked:matrix.orgthe role has been merged into the `zuul-config` repo and is in master21:09
@sjal:matrix.orgcan you post your `Upload with conductor` task?21:12
@sjal:matrix.orgto me it looks like you're using `conductor` module for it which Zuul has trouble finding21:13
@f2ked:matrix.org```21:18
- hosts: all
...
roles:
...
- conductor
...
tasks:
...
- name: Upload with conductor
conductor:
key: XXX
files:
- "{{ tarball }}"
...
```
@sjal:matrix.orgyeah, exactly :)21:18
@sjal:matrix.orghow do you expect Zuul to run your custom module?21:18
@sjal:matrix.orgthis 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 see21:19
@sjal:matrix.orgit's not a Zuul problem but rather an Ansible problem just like Clark  said21:22
@f2ked:matrix.orgconductor 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.orgI feel ignored21:26
@f2ked:matrix.orgI apologize.. what part am I missing that makes you feel that way?21:28
@fungicide:matrix.orgERROR! couldn't resolve module/action 'conductor'.21:28
@fungicide:matrix.orgwe 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.orgBasically this is the answer to your problem: https://stackoverflow.com/a/52979849/1139005821: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.orgyeah, 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 find21: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.orgbut 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 lives21:34
@fungicide:matrix.orgit looks like you have a *role* named conductor but your task also refers to a *module* named conductor. those are different21:35
@f2ked:matrix.orgok.. 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.organd what does an ansible task do?21:36
@f2ked:matrix.orgthe role has no refernce to conductor at all21:37
@sjal:matrix.orgit runs a module and you have a custom one21:37
@fungicide:matrix.orgall 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.orgbecause it's custom you need to provide code for it otherwise it will only work on your machine21:37
@sjal:matrix.org> <@f2ked:matrix.org> the role has no refernce to conductor at all21: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.orgsounds 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 somewhere21:39
@sjal:matrix.orgif `conductor` isn't a custom module but just a role you're invoking it in a wrong way21:40
@sjal:matrix.orgDoes this look like something you wanted to do? https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_role_module.html21:41
@jim:acmegating.coma useful iterative development process is to work on an ansible playbook on its own before asking zuul to run it.21:46
@sjal:matrix.orgcan't blame him, who has the time for that :D21:47
@f2ked:matrix.orghey.. I figured since it was a solid `play` making it a role should be easy :)21:49
@f2ked:matrix.orgok.. 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.orgthanks all21:51
@sjal:matrix.orgsee 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.orgclosing the loop22: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/!