diff --git a/changelogs/fragments/69463-fix-apt_repository-typeerror- instancemethod.yaml b/changelogs/fragments/69463-fix-apt_repository-typeerror- instancemethod.yaml new file mode 100644 index 00000000000..dbe68aca6dd --- /dev/null +++ b/changelogs/fragments/69463-fix-apt_repository-typeerror- instancemethod.yaml @@ -0,0 +1,2 @@ +bugfixes: +- Fixed TypeError instancemethod expecting at least 2 arguments for apt_repository(issue https://github.com/ansible/ansible/issues/69308, PR https://github.com/ansible/ansible/pull/69463) \ No newline at end of file diff --git a/lib/ansible/modules/apt_repository.py b/lib/ansible/modules/apt_repository.py index 834bdec1ddf..06755d4db0c 100644 --- a/lib/ansible/modules/apt_repository.py +++ b/lib/ansible/modules/apt_repository.py @@ -406,6 +406,12 @@ class UbuntuSourcesList(SourcesList): self.codename = module.params['codename'] or distro.codename super(UbuntuSourcesList, self).__init__(module) + def __deepcopy__(self, memo=None): + return UbuntuSourcesList( + self.module, + add_ppa_signing_keys_callback=self.add_ppa_signing_keys_callback + ) + def _get_ppa_info(self, owner_name, ppa_name): lp_api = self.LP_API % (owner_name, ppa_name)