[katello-devel] Agent Reporting Enabled Repositories
Ivan Nečas
inecas at redhat.com
Thu Jan 19 14:34:31 UTC 2012
Hi
On 01/18/2012 08:18 PM, Jeff Ortel wrote:
> I'm working on the pulp and katello agent parts of a solution for
> getting enabled repositories (as configured by rhsm) bound to
> consumers in pulp. This is fairly straight forward and I think will
> go something like this:
>
> 1. katello agent detects change in pulp.repo
^^^ did you mean redhat.repo, or am I missing something?
>
> 2. sends list of enabled repos to the server.
>
> 3. katello query pulp consumer and performs a bind/unbind as needed.
>
> Eg: (read like pseudo code)
>
> # fetch consumer
> consumer = pulp.getConsumer(id) # pulp REST
> already_bound = consumer['repoids']
> # newly disabled
> for repoid in already_bound:
> if repoid not in reported:
> pulp.unbind(id, repoid) # pulp REST
> # newly enabled
> for repoid in reported:
> if repoid not in already_bound:
> pulp.bind(id, repoid) # pulp REST
There is a problem with repoid - in redhat.repo there is not pulp id.
That's because CP content <-> repos is 1:N relation (one content in more
environments, every environment separate repo). Therefore we need to
specify environment somewhere.
What about using the repourl (with substituting $env var) for the repo
identification in pulp for this purpose.?
-- Ivan
>
> This does mean a bind/unbind per newly enabled or disabled repo. But,
> this approach leverages pulp's existing API and I really don't expect
> repos to be enabled/disabled in large quantities. Though, I
> understand this may raise concern. Also, the pulp v2 RepoAssociation
> stuff will support bulk operations.
>
> I assume the katello REST call will be something like this?
>
> url: /bla/bla/consumer/<id>/repos/enabled
> payload:
> [<repoid>,...]
>
> Please let me know when the API is designed.
>
> Comments?
>
> Thanks,
>
> Jeff
>
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel
--
Regards,
Ivan Necas
Red Hat Czech s.r.o. Brno
More information about the katello-devel
mailing list