diff --git a/CHANGES/+ansible_git_remote.feature b/CHANGES/+ansible_git_remote.feature new file mode 100644 index 000000000..e7fd06d4b --- /dev/null +++ b/CHANGES/+ansible_git_remote.feature @@ -0,0 +1 @@ +Added support for pulp_ansible git remotes. diff --git a/CHANGES/pulp-glue/+ansible_git_remote.feature b/CHANGES/pulp-glue/+ansible_git_remote.feature new file mode 100644 index 000000000..3a1fa7bb1 --- /dev/null +++ b/CHANGES/pulp-glue/+ansible_git_remote.feature @@ -0,0 +1 @@ +Added the pulp_ansible git remote context. diff --git a/pulp-glue/src/pulp_glue/ansible/context.py b/pulp-glue/src/pulp_glue/ansible/context.py index b77fcf4f2..208c24589 100644 --- a/pulp-glue/src/pulp_glue/ansible/context.py +++ b/pulp-glue/src/pulp_glue/ansible/context.py @@ -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/(?Pansible)/(?Pgit)/" + NEEDS_PLUGINS = [PluginRequirement("ansible", specifier=">=0.7.0")] + + class PulpAnsibleCollectionRemoteContext(PulpRemoteContext): PLUGIN = "ansible" RESOURCE_TYPE = "collection" diff --git a/src/pulpcore/cli/ansible/remote.py b/src/pulpcore/cli/ansible/remote.py index e8934cd8f..e172b4c94 100644 --- a/src/pulpcore/cli/ansible/remote.py +++ b/src/pulpcore/cli/ansible/remote.py @@ -5,6 +5,7 @@ from pulp_glue.ansible.context import ( PulpAnsibleCollectionRemoteContext, + PulpAnsibleGitRemoteContext, PulpAnsibleRoleRemoteContext, ) from pulp_glue.common.i18n import get_translation @@ -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: diff --git a/src/pulpcore/cli/ansible/repository.py b/src/pulpcore/cli/ansible/repository.py index e33cd96ed..f9cfbf1d9 100644 --- a/src/pulpcore/cli/ansible/repository.py +++ b/src/pulpcore/cli/ansible/repository.py @@ -6,6 +6,7 @@ from pulp_glue.ansible.context import ( PulpAnsibleCollectionRemoteContext, PulpAnsibleCollectionVersionContext, + PulpAnsibleGitRemoteContext, PulpAnsibleRepositoryContext, PulpAnsibleRoleContext, PulpAnsibleRoleRemoteContext, @@ -59,6 +60,7 @@ context_table={ "ansible:collection": PulpAnsibleCollectionRemoteContext, "ansible:role": PulpAnsibleRoleRemoteContext, + "ansible:git": PulpAnsibleGitRemoteContext, }, href_pattern=PulpRemoteContext.HREF_PATTERN, help=_(