Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/+ansible_git_remote.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for pulp_ansible git remotes.
1 change: 1 addition & 0 deletions CHANGES/pulp-glue/+ansible_git_remote.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added the pulp_ansible git remote context.
11 changes: 11 additions & 0 deletions pulp-glue/src/pulp_glue/ansible/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ class PulpAnsibleRoleRemoteContext(PulpRemoteContext):
NEEDS_PLUGINS = [PluginRequirement("ansible", specifier=">=0.7.0")]


class PulpAnsibleGitRemoteContext(PulpRemoteContext):
PLUGIN = "ansible"
RESOURCE_TYPE = "git"
ENTITY = _("git remote")
ENTITIES = _("git remotes")
HREF = "ansible_git_remote_href"
ID_PREFIX = "remotes_ansible_git"
HREF_PATTERN = r"remotes/(?P<plugin>ansible)/(?P<resource_type>git)/"
NEEDS_PLUGINS = [PluginRequirement("ansible", specifier=">=0.7.0")]


class PulpAnsibleCollectionRemoteContext(PulpRemoteContext):
PLUGIN = "ansible"
RESOURCE_TYPE = "collection"
Expand Down
2 changes: 2 additions & 0 deletions src/pulpcore/cli/ansible/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from pulp_glue.ansible.context import (
PulpAnsibleCollectionRemoteContext,
PulpAnsibleGitRemoteContext,
PulpAnsibleRoleRemoteContext,
)
from pulp_glue.common.i18n import get_translation
Expand Down Expand Up @@ -46,6 +47,7 @@ def yaml_callback(ctx: click.Context, param: click.Parameter, value: t.Any) -> s
choices={
"collection": PulpAnsibleCollectionRemoteContext,
"role": PulpAnsibleRoleRemoteContext,
"git": PulpAnsibleGitRemoteContext,
}
)
def remote() -> None:
Expand Down
2 changes: 2 additions & 0 deletions src/pulpcore/cli/ansible/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pulp_glue.ansible.context import (
PulpAnsibleCollectionRemoteContext,
PulpAnsibleCollectionVersionContext,
PulpAnsibleGitRemoteContext,
PulpAnsibleRepositoryContext,
PulpAnsibleRoleContext,
PulpAnsibleRoleRemoteContext,
Expand Down Expand Up @@ -59,6 +60,7 @@
context_table={
"ansible:collection": PulpAnsibleCollectionRemoteContext,
"ansible:role": PulpAnsibleRoleRemoteContext,
"ansible:git": PulpAnsibleGitRemoteContext,
},
href_pattern=PulpRemoteContext.HREF_PATTERN,
help=_(
Expand Down
Loading