Skip to content

Commit

Permalink
add folder packer
Browse files Browse the repository at this point in the history
  • Loading branch information
aeivanov committed Dec 7, 2023
1 parent b394619 commit ac6456c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packer/files/key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "ajegg8175h1q90thaise",
"service_account_id": "ajeo9k17dj25iuj6h5au",
"created_at": "2023-12-07T20:04:07.729402726Z",
"key_algorithm": "RSA_2048",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtQ6f1kCIJbJFcDeYXRnQ\n61/1j7RbT3OsFUaetHP3WEZUx4Tr2RzjnnOjLUVkRIjjU/0Y8VWGLQx2b3bmBZ4P\nbngq+WtySVei+jLVk8o+gpK4AriuX5J15G/CfuOBgrCaXZok/YSi7h8ni7TU1YF6\nkjmUV/3JRZPG08xuiZh5pvATcpTlLUMopWCdhhGoci4B0QjX2pPl1d27u/thdu0O\nLe5RZX0k9jhC6v3T/FMPNpMPxUxnctejxpz+OWGuOdW0MPJPKL50C5WlB58M2EPI\nMahfmnRLkLZV4Yr4fR6Si+cvZIYQNKWeUURTYRxlqLCcnf+9We6hf9MuylJP24rd\n/QIDAQAB\n-----END PUBLIC KEY-----\n",
"private_key": "PLEASE DO NOT REMOVE THIS LINE! Yandex.Cloud SA Key ID \u003cajegg8175h1q90thaise\u003e\n-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC1Dp/WQIglskVw\nN5hdGdDrX/WPtFtPc6wVRp60c/dYRlTHhOvZHOOec6MtRWREiONT/RjxVYYtDHZv\nduYFng9ueCr5a3JJV6L6MtWTyj6CkrgCuK5fknXkb8J+44GCsJpdmiT9hKLuHyeL\ntNTVgXqSOZRX/clFk8bTzG6JmHmm8BNylOUtQyilYJ2GEahyLgHRCNfak+X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aGQ0olvkAMADv5wl35cuc+csn8R4Zt6RZ3ZAGJ9gw\nNOD1sgYS73uzfW1qffumU15egwPtn1DwX1xFiq5eV89IWWupQKRmnykXS0Xucn4W\np+vX2TaHnzr+kQfIy4YdJtwcD+4gC6PVPVw/D+bzAoGBAIG4hoYliH4zpZPoeu5p\nkGAvWtgL3N5iZ8A62Bwy1qb6U5QFyUuCYKOHfL/zB4OJzpg1cmzMJQgI8pkyCDAo\nVvYpQ5DvB571rBbzeRDBKbZmJIpiGW74ELEqJSlPCnnfApbZDflRaE/L7URTXB9f\n5FeFGlxGhsg5Mmwd0eBaSPHu\n-----END PRIVATE KEY-----\n"
}
8 changes: 8 additions & 0 deletions packer/scripts/install_mongodb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
apt-get update
sleep 30
apt-get install -y mongodb-org
systemctl start mongod
systemctl enable mongod
4 changes: 4 additions & 0 deletions packer/scripts/install_ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
apt-get update
sleep 30
apt-get install -y ruby-full ruby-bundler build-essential
27 changes: 27 additions & 0 deletions packer/ubuntu16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"builders": [
{
"type": "yandex",
"service_account_key_file": "files/key.json",
"folder_id": "b1getl3tuf5pfgn1so0j",
"source_image_family": "ubuntu-1604-lts",
"image_name": "reddit-base-{{timestamp}}",
"image_family": "reddit-base",
"ssh_username": "ubuntu",
"platform_id": "standard-v1",
"use_ipv4_nat": true
}
],
"provisioners": [
{
"type": "shell",
"script": "scripts/install_ruby.sh",
"execute_command": "sudo {{.Path}}"
},
{
"type": "shell",
"script": "scripts/install_mongodb.sh",
"execute_command": "sudo {{.Path}}"
}
]
}

0 comments on commit ac6456c

Please sign in to comment.