Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize GitHub Actions SSH in cloud-init #54

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions simple_vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ resource "openstack_compute_instance_v2" "instance" {
network {
name = var.network
}

lifecycle {
ignore_changes = [user_data]
}

user_data = <<-EOT
#cloud-config
ssh_pwauth: false
users:
# As in seagl-ansible/roles/users/tasks/main.yml
- name: "gh-actions"
strugee marked this conversation as resolved.
Show resolved Hide resolved
gecos: "Privileged User"
sudo: "ALL=(ALL) NOPASSWD:ALL"
shell: "/bin/bash"
lock_passwd: true
create_groups: false
uid: 1027
AndrewKvalheim marked this conversation as resolved.
Show resolved Hide resolved
ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHwA5jA6XgkCiaEGzFzp6EiEIzy73UQuQ3fYZLf8HA/l"
EOT
}

resource "aws_route53_record" "dns-a" {
Expand Down