added ssh key management resource
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
3
examples/.gitignore
vendored
3
examples/.gitignore
vendored
@ -2,4 +2,5 @@
|
||||
.terraform.lock.hcl
|
||||
terraform.tfstate
|
||||
terraform.tfstate.backup
|
||||
*.tfvars
|
||||
*.tfvars
|
||||
id_ed25519
|
@ -38,3 +38,11 @@ resource "gitea_user" "test" {
|
||||
must_change_password = false
|
||||
admin = true
|
||||
}
|
||||
|
||||
|
||||
resource "gitea_public_key" "test_user_key" {
|
||||
title = "test"
|
||||
key = file("${path.module}/resources/gitea_public_key/id_ed25519.pub")
|
||||
read_only = true
|
||||
username = gitea_user.test.username
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "terraform.local/lerentis/gitea"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
1
examples/resources/gitea_public_key/id_ed25519.pub
Normal file
1
examples/resources/gitea_public_key/id_ed25519.pub
Normal file
@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINn6hAP48oKz6MVWjYvn0fne2YeaOv/zC6zuvFXlJKf2 test@dev.local
|
14
examples/resources/gitea_public_key/resource.tf
Normal file
14
examples/resources/gitea_public_key/resource.tf
Normal file
@ -0,0 +1,14 @@
|
||||
resource "gitea_user" "test" {
|
||||
username = "test"
|
||||
login_name = "test"
|
||||
password = "Geheim1!"
|
||||
email = "test@user.dev"
|
||||
must_change_password = false
|
||||
}
|
||||
|
||||
|
||||
resource "gitea_public_key" "test_user_key" {
|
||||
title = "test"
|
||||
key = file("${path.module}/id_ed25519.pub")
|
||||
username = gitea_user.test.username
|
||||
}
|
Reference in New Issue
Block a user