diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c91d481 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +packer/variables.json diff --git a/config-scripts/install_mongodb.sh b/config-scripts/install_mongodb.sh index c1fd318..77fee50 100755 --- a/config-scripts/install_mongodb.sh +++ b/config-scripts/install_mongodb.sh @@ -1,6 +1,7 @@ #!/bin/bash -sudo apt-get update -sudo apt-get install mongodb -y -sudo systemctl start mongodb -sudo systemctl enable mongodb -sudo systemctl status mongodb +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 update +apt install mongodb-org -y +systemctl start mongod +systemctl enable mongod diff --git a/config-scripts/install_ruby.sh b/config-scripts/install_ruby.sh index 09c63b8..ed8167b 100755 --- a/config-scripts/install_ruby.sh +++ b/config-scripts/install_ruby.sh @@ -1,5 +1,3 @@ #!/bin/bash -sudo apt update -sudo apt install -y ruby-full ruby-bundler build-essential -ruby -v -bundler -v +apt update +apt install ruby-full ruby-bundler build-essential -y diff --git a/packer/files/key.json b/packer/files/key.json index a042848..e8e2f6f 100644 --- a/packer/files/key.json +++ b/packer/files/key.json @@ -5,4 +5,4 @@ "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+XV3bu7\n+2F27Q4t7lFlfST2OELq/dP8Uw82kw/FTGdy16PGnP45Ya451bQw8k8ovnQLlaUH\nnwzYQ8gxqF+adEuQtlXhivh9HpKL5y9khhA0pZ5RRFNhHGWosJyd/71Z7qF/0y7K\nUk/bit39AgMBAAECggEAElaQsNoouqyzj29KGC/rsv4Co1NQpkZLKSfVyOWFVA8M\n5N0dKDM0CLyh9o1fNPkqZpDYLGVi/tVoJNewP48SoA09c7VtcL6WwWxRqTOO9kRX\nAouNucdd980BWum/GIC7pHxe1RX7N063f3/Jc3XhohrWirz9MaC16YYnXKSxZEt5\nU16N++Dxn1yIzqY3+guTRuURFD0hHtB2CqplLXrlu4dcDSmwL3yzvE63LyzqpgFn\nxIu5QYqRlEZdqVmSjmvVdL/+5hISmpVKOaQ3fyMIoO/gWj+y4+UcshM/3S9Mmd2J\nZShie3Vi2o7ttQCwe3bXzlNIc6ARlAwAN1onhMuqXwKBgQDOUVblOJJ4o/jKrbiN\nKUX8V5i1sfovbGpesOXqGLNm4+0U8942e29eeOu4GaX8ohT1Uu6eXb5MTwOEdoZR\nEczyL2PFAXHDw7d84iUhvxcl6bt9Ss67qm1Rf/FpMhTG5UevJ6aeQUTi6U/vlf5b\nUAIUD4qcn6iDGYv/oIkOyL004wKBgQDgqBHl3jIXigW8POWr2UQrtunBPcWh+UNa\ndFXIT84Ep93PNXxmnWjBitHUzFXn0aNfvyqBdcelZ2QGRV7rOvSZOzdNYEh6Y/Yd\nPBDWeIKj91b9SkpW/z6JS2TXXTj/JoZH8s6utLSYrCE+4ZfKOserJpzsrcitxglQ\nHILk4AD3nwKBgQDJI5tnlSOW4aTnUz2cwSQtwuhqGr0iBrwc3LEI7FPad1LnHmkB\nDI2iuJh1vuuHxCxSjyt60UF4+38eYL7JwmTfpzvJEINsqx3zbjVtFPLoT1ot6ARs\nCNbSob0lJWIEFfsw06MondEetv7rQHvdYb7k99HWqACM7xcBe+yisSlkqQKBgAV0\nLxMMhNzLbf424EB+wsfo5d3aGQ0olvkAMADv5wl35cuc+csn8R4Zt6RZ3ZAGJ9gw\nNOD1sgYS73uzfW1qffumU15egwPtn1DwX1xFiq5eV89IWWupQKRmnykXS0Xucn4W\np+vX2TaHnzr+kQfIy4YdJtwcD+4gC6PVPVw/D+bzAoGBAIG4hoYliH4zpZPoeu5p\nkGAvWtgL3N5iZ8A62Bwy1qb6U5QFyUuCYKOHfL/zB4OJzpg1cmzMJQgI8pkyCDAo\nVvYpQ5DvB571rBbzeRDBKbZmJIpiGW74ELEqJSlPCnnfApbZDflRaE/L7URTXB9f\n5FeFGlxGhsg5Mmwd0eBaSPHu\n-----END PRIVATE KEY-----\n" -} \ No newline at end of file +} diff --git a/packer/ubuntu16.json b/packer/ubuntu16.json index 9166ebd..ff5e9fb 100644 --- a/packer/ubuntu16.json +++ b/packer/ubuntu16.json @@ -3,8 +3,8 @@ { "type": "yandex", "service_account_key_file": "files/key.json", - "folder_id": "b1getl3tuf5pfgn1so0j", - "source_image_family": "ubuntu-1604-lts", + "folder_id": "{{user `fid`}}", + "source_image_family": "{{user `sif`}}", "image_name": "reddit-base-{{timestamp}}", "image_family": "reddit-base", "ssh_username": "ubuntu", diff --git a/packer/variables.json.example b/packer/variables.json.example new file mode 100644 index 0000000..13a700e --- /dev/null +++ b/packer/variables.json.example @@ -0,0 +1,5 @@ +{ + "service_account_key_file": "key.json", + "fid": "b1getl3tuf5pfgn1sefg", + "sif": "ubuntu-1604-lts" +}