Operators available for use with variables in register / with_items

I am generating a list of filenames on a client to be copied back to an admin server by parsing a file via the shell module, using 'register' to store the resulting list from stdout, then iterating through fetch using 'with_items' to copy them back to an admin server.

i.e..
       - name: fetch RPMs
         fetch: src=${item} dest=/tmp/foo
         with_items: ${rpm_names.stdout_lines}

Questions:

1. Is there some documentation on available operators/variables (such as stdout_lines) ? I got that from an example. The documentation (under Loops) mentions subkeys, which I realize would be site-specific, but the mailing list archives mention stdout_lines as a variable. I assume there are others?

2. More specifically, what operators are available to massage strings? In this case, there is whitespace that I end up having to trim on the client via a piped command. I would be nice to say something like:

   with_items: ${rpm_names.stdout_lines.strip()}

1.

all the variables available should generally be available in -v
output, though IIRC stdout_lines is not.

I agree this needs to be documented somewhere if not already :slight_smile:

2. In templates, you can do lots. In main playbooks, you do not
have such operators. Usually a sign something needs to be simplified
elsewhere.

Curious what your overall playbook is that gets the rpm list and then
has to use the rpm list, seems like the yum module would have been the
way to go here?

2. In templates, you can do lots. In main playbooks, you do not
have such operators. Usually a sign something needs to be simplified
elsewhere.

Pity, this would be useful, and simpler for the register-var-cleanup use case, IMHO.

Curious what your overall playbook is that gets the rpm list and then
has to use the rpm list, seems like the yum module would have been the
way to go here?

I'm automating an occasional build of a package that spits out two RPMs (related to an earlier thread I posted). When the build is done, I need to parse the log (from rpmbuild) to figure out what RPMs were generated, and copy those files back to a central server.

Getting this right will help with future use cases of parsing logs / stdout / stderr for strings.

I'm automating an occasional build of a package that spits out two RPMs
(related to an earlier thread I posted). When the build is done, I need to
parse the log (from rpmbuild) to figure out what RPMs were generated, and
copy those files back to a central server.

I see.

I'd invoke rsync via a local_action. Keep it simple.