Skip to content

Commit d0056ed

Browse files
committed
Move terraform-bastion to the Admins team
1 parent 80195cc commit d0056ed

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

ansible/inventory/group_vars/all/source-repositories

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ ansible_workflows:
2626
- publish-role
2727
community_files:
2828
codeowners:
29+
admins: |
30+
* @stackhpc/admins
2931
ansible: |
3032
* @stackhpc/ansible
3133
batch: |
@@ -412,6 +414,14 @@ source_repositories:
412414
- codeowners:
413415
content: "{{ community_files.codeowners.openstack }}"
414416
dest: ".github/CODEOWNERS"
417+
# Admins team
418+
terraform-bastion:
419+
repository_type: "single-branch"
420+
workflows: []
421+
community_files:
422+
- codeowners:
423+
content: "{{ community_files.codeowners.admins }}"
424+
dest: ".github/CODEOWNERS"
415425
# Ansible team
416426
ansible-role-libvirt-host:
417427
repository_type: "ansible"
@@ -735,10 +745,3 @@ source_repositories:
735745
- codeowners:
736746
content: "{{ community_files.codeowners.sms_lab }}"
737747
dest: ".github/CODEOWNERS"
738-
terraform-bastion:
739-
repository_type: "single-branch"
740-
workflows: []
741-
community_files:
742-
- codeowners:
743-
content: "{{ community_files.codeowners.sms_lab }}"
744-
dest: ".github/CODEOWNERS"

scripts/validate-source-repos.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def _extract_group_from_community_files(files):
3838
return content.strip('{ }').replace('_', '').split('.')[-1]
3939

4040

41-
def _sort_ans_repos_by_group(ans_repos):
41+
def _group_ans_repos_by_group(ans_repos):
4242
ans_repos_by_group = {}
4343
for repo in ans_repos:
44-
files = ans_repos[repo]['community_files']
45-
group = _extract_group_from_community_files(files)
44+
group = _extract_group_from_community_files(
45+
ans_repos[repo]['community_files'])
4646
if group in ans_repos_by_group:
4747
ans_repos_by_group[group].append(repo)
4848
else:
@@ -51,7 +51,7 @@ def _sort_ans_repos_by_group(ans_repos):
5151

5252

5353
def get_mismatched_repos(tf_repos, ans_repos, repos_missing):
54-
ans_repos_new = _sort_ans_repos_by_group(ans_repos)
54+
ans_repos_new = _group_ans_repos_by_group(ans_repos)
5555
tf_repos_new = {k.lower(): v for k, v in tf_repos.items()}
5656

5757
mismatched_repos = []
@@ -77,10 +77,11 @@ def main():
7777
repos_missing)
7878

7979
print('The following repos are assigned to different codeowner groups in '
80-
'the Ansible source-repositories and the Terraform tfvars: '
81-
f'{mismatched_repos}')
80+
'the Ansible source-repositories and the Terraform tfvars: '
81+
f'{mismatched_repos}')
8282

8383
return len(repos_missing) > 0 or len(mismatched_repos) > 0
8484

85+
8586
if __name__ == "__main__":
8687
sys.exit(main())

terraform/github/terraform.tfvars.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"owner": "stackhpc",
33
"repositories": {
4+
"Admins": [
5+
"terraform-bastion"
6+
],
47
"Ansible": [
58
"ansible-role-libvirt-host",
69
"ansible-role-libvirt-vm",
@@ -89,8 +92,7 @@
8992
"SMSLab": [
9093
"smslab-azimuth-config",
9194
"smslab-config",
92-
"smslab-kayobe-config",
93-
"terraform-bastion"
95+
"smslab-kayobe-config"
9496
]
9597
},
9698
"teams": {

0 commit comments

Comments
 (0)