Hi!
I want to deploy rpms through my ci/cd and therefore I added a non-admin user and gave it some permissions:
pulp role create --name "rpm_publisher" \
--permission "rpm.view_rpmrepository" \
--permission "rpm.add_rpmpublication" \
--permission "rpm.add_rpmdistribution"
pulp user create --username publisher --password "..."
pulp user role-assignment add --username publisher \
--role rpm_publisher --object ""
Pushing rpms directly into a repository works well using the rest api. But as some packages consist of multiple rpm files (foo, foo-libs, foo-devel, …) I want to add all of these at once.
According to Upload Content — Pulp RPM Support 3.25.3 documentation I need to perform the following steps:
- upload rpms to /pulp/api/v3/artifacts/
- create content from these artifacts by passing the artifact_hrefs to
/pulp/api/v3/content/rpm/packages/
- modify repo and add these content_hrefs
The pulp-cli requires the additional step of getting the artifact’s checksum and passing this checksum to pulp rpm content create --sha256
, which, according to pulp -v
only translates this back to the artifact_hrefs and passes these hrefs to pulp/api/v3/content/rpm/packages/
. This is something I don’t understand, why is this needed instead of passing the artifact_href directly?
Anyway, my problem is that step 2, creating content from the artifacts, only works as admin user. The “publisher” user is required to pass a destination repository. No matter whether I use the rest api or pulp-cli:
chksum=$(pulp show --href ${artifact_href} | jq -r .sha256)
pulp --username publisher --password "..." rpm content create --sha256 ${chksum}
# Error: ["Destination upload repository was not provided."]
What permissions are required to create rpm content without specifying a repository?