Skip to content

Commit

Permalink
Allow extra sudo users
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev committed Jun 16, 2023
1 parent 2af0d77 commit 177fad6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion ansible/envs/staging/group_vars/docs-rs-builder.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---

sha: "{{ lookup('aws_ssm', '/docs-rs/builder/sha') }}"
vars_repository_sha: "{{ sha | ternary(sha, 'HEAD') }}"
vars_repository_sha: "{{ sha | ternary(sha, 'HEAD') }}"

vars_extra_sudo_users:
- rylev
2 changes: 1 addition & 1 deletion ansible/playbooks/docs-rs-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
- role: common
papertrail_url: "{{ vars_papertrail_url }}"
collect_metrics_from: "{{ global_collect_metrics_from }}"
sudo_users: "{{ global_sudo_users }}"
sudo_users: "{{ global_sudo_users + vars_extra_sudo_users }}"

- role: docs-rs-builder
1 change: 1 addition & 0 deletions ansible/roles/common/files/ssh-keys/rylev.pub
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDj2ga6r2r4AzZDyJJ3w81mTQIntuq5TdFlylZ1gwbd
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDro4UttZ6XQshnFBq4LdLXr0VDeunZFNRcv90ckpkZQrxbErzmpEvng0QUi9TI9gU/W4+cXhXAyEOcm+fVChesJBpqLFDJbQDmCPioPPsKVZ6ErBu3RHOgd4mD/Cfuly36L9AENql16R6ecxgbRVgpUISDYKo5jzRC7fJD40+bOai5Fv8+xvbuHPNJhj/IKxKCPDYCJ2+7H+6TMLZn5HjBvP42KES6030kR7pVWnug/OXSKESF0gm3tfspmFcw1aS57zVpyT7IlZvLb5zNvX8G8CEGV3KY//z80cbNMOa8QXggUGaLgFzwI2ng2W5CFHkOAXbX3bOtshsAmj0JWoM3ya+n70+E9tnGbwliOV/EfzQ1f0USyci8V2f1TkVLoRzWLBjtH5HsomsWN/8eNYcmDdbxy0TdclDEY6FavsDnQwD+JsDoeJaN+d31jyGSlYxcF+TZRgK5rFsRBZyXOc2sXi1bOQDWr5nt8y18yDhij7hj/wzV9DFwM4FVPOKNasImSZiVILwBUkdEGVAsTBuee6llrsApL1WmPsIb1xMrhN0+n1ZP7/07U69Eiqygbd6gb3a931H1z73j44MLvfh1BFsnrrmpFOb2PaSV+nwoi4pxSMOEiFZpno7hnc4OD3I+P/hBP3+6a42joHI42H08JsPZ0PgfiD8tjl/Z0/XLyw==
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILNkAIu1i0W8zWY/VO7yJ1I09KPlXa15Upfo8kIe21Up
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAHkoXhB9Pq+JKC+gPySI5yKwhYtGA++EfJ+7Ng3NNhN
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMxnE3/tgSLhXGQMjTzFBWBvpOJkNL+bojUthFVN4qCw
9 changes: 5 additions & 4 deletions packer/docs-rs-builder/builder.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ data "amazon-parameterstore" "revision" {

locals {
revision = data.amazon-parameterstore.revision.value
pretty_revision = substr(local.revision, 0, 8)
timestamp = regex_replace(timestamp(), "[- TZ:]", "")
}

source "amazon-ebs" "ubuntu" {
ami_name = "docs-rs-builder-${local.revision}"
ami_name = "docs-rs-builder-${local.pretty_revision}-${local.timestamp}"
instance_type = "t2.large"
region = "us-east-1"
source_ami_filter {
Expand All @@ -43,12 +45,11 @@ build {

provisioner "ansible" {
command = ".venv/bin/ansible-playbook"
# The default is "default"
host_alias = "docs-rs-builder"
groups = ["docs-rs-builder"]
inventory_directory = "./env"
playbook_file = "./play/playbook.yml"
# The default is the user running packer
user = "ubuntu"
extra_arguments = [ "--extra-vars", "vars_repository_sha=${local.revision}"]
extra_arguments = ["--extra-vars", "vars_repository_sha=${local.revision}"]
}
}

0 comments on commit 177fad6

Please sign in to comment.