WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 9372354

Browse files
chore: new service account svc-gha-kubectl without sudo permissions (#51)
1 parent 47d0e27 commit 9372354

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

data/service_accounts.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
---
22
# These service accounts are provisioned by MAAS through its one-time cloud-init process.
3+
# Optionally, they can be updated on the k3s cluster machines through the Ansible playbook
4+
# `ansible/playbooks/service_accounts.yaml`
35
- account_name: svc-gha-ansible-reboot
4-
description: GitHub Actions Ansible CI User
6+
description: GitHub Actions Ansible CI user for reboots
57
public_ssh_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHaLPRZrnK/HEwLX56SbzIJlUJCkXiFLMbDCMpwg1YoR svc-gha-ansible-reboot CI key
68
allow_connections_from: "192.168.150.0/24"
79
sudo_permissions:
810
- "/sbin/reboot"
11+
- account_name: svc-gha-kubectl
12+
description: GitHub Actions user for calling kubectl
13+
public_ssh_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAJTJ5LG+Qj0CKOt0mVBfSptjP4ziyKYJB31lyp4ORF9 svc-gha-kubectl CI key
14+
allow_connections_from: "192.168.150.0/24"

terraform/modules/server/cloud-init.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ users:
1515
%{ for acct in service_accounts ~}
1616
- name: "${acct.account_name}"
1717
gecos: "${acct.description}"
18+
%{ if length(try(acct.sudo_permissions, [])) > 0 }
1819
sudo: "ALL=(ALL) NOPASSWD: ${join(",", acct.sudo_permissions)}"
20+
%{ endif }
1921
shell: /bin/bash
2022
%{ if startswith(acct.public_ssh_key, "gh:") }
2123
ssh_import_id:

0 commit comments

Comments
 (0)