github_repo: support GitHub on premise installations (#3039)

* added possibility to manage on prem github

* added changelog

* fixed module tests

* Update changelogs/fragments/3038-enhance_github_repo_api_url.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/source_control/github/github_repo.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Max Bidlingmaier <Max-Florian.Bidlingmaier@sap.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Max Bidlingmaier
2021-07-22 16:55:09 +02:00
committed by GitHub
parent 11cdb1b661
commit 38e70ae0e4
3 changed files with 29 additions and 10 deletions

View File

@@ -159,7 +159,8 @@ class TestGithubRepo(unittest.TestCase):
"name": "myrepo",
"description": "Just for fun",
"private": False,
"state": "present"
"state": "present",
"api_url": "https://api.github.com"
})
self.assertEqual(result['changed'], True)
@@ -177,7 +178,8 @@ class TestGithubRepo(unittest.TestCase):
"name": "myrepo",
"description": "Just for fun",
"private": True,
"state": "present"
"state": "present",
"api_url": "https://api.github.com"
})
self.assertEqual(result['changed'], True)
self.assertEqual(result['repo']['private'], True)
@@ -194,7 +196,8 @@ class TestGithubRepo(unittest.TestCase):
"name": "myrepo",
"description": "Just for fun",
"private": True,
"state": "present"
"state": "present",
"api_url": "https://api.github.com"
})
self.assertEqual(result['changed'], True)
self.assertEqual(result['repo']['private'], True)
@@ -211,7 +214,8 @@ class TestGithubRepo(unittest.TestCase):
"name": "myrepo",
"description": "Just for fun",
"private": False,
"state": "absent"
"state": "absent",
"api_url": "https://api.github.com"
})
self.assertEqual(result['changed'], True)
@@ -227,7 +231,8 @@ class TestGithubRepo(unittest.TestCase):
"name": "myrepo",
"description": "Just for fun",
"private": False,
"state": "absent"
"state": "absent",
"api_url": "https://api.github.com"
})
self.assertEqual(result['changed'], True)
@@ -243,7 +248,8 @@ class TestGithubRepo(unittest.TestCase):
"name": "myrepo",
"description": "Just for fun",
"private": True,
"state": "absent"
"state": "absent",
"api_url": "https://api.github.com"
})
self.assertEqual(result['changed'], False)