Commit 08989225 by Syed Saad

Creating-VM-Offer

parents
{
"variables": {
"subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
"tenant_id": "{{env `AZURE_TENANT_ID`}}",
"client_id": "{{env `AZURE_CLIENT_ID`}}",
"client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
"location": "eastus2",
"sig_gallery_resource_group": "",
"sig_gallery_name": "",
"sig_image_name": "",
"sig_image_version": "1.0.0"
},
"sensitive-variables": ["client_secret"],
"builders": [{
"type": "azure-arm",
"subscription_id": "{{user `subscription_id`}}",
"tenant_id": "{{user `tenant_id`}}",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "18.04-LTS",
"image_version": "latest",
"location": "{{user `location`}}",
"vm_size": "Standard_DS2_v2",
"temp_resource_group_name": "packer-rg",
"temp_compute_name": "packervms",
"private_virtual_network_with_public_ip": true,
"custom_data_file": "",
"polling_duration_timeout": "0h30m0s",
"managed_image_name": "packer-image",
"managed_image_resource_group_name": "{{user `sig_gallery_resource_group`}}",
"shared_image_gallery_destination": {
"subscription": "{{user `subscription_id`}}",
"resource_group": "{{user `sig_gallery_resource_group`}}",
"gallery_name": "{{user `sig_gallery_name`}}",
"image_name": "{{user `sig_image_name`}}",
"image_version": "{{user `sig_image_version`}}",
"replication_regions": ["{{user `location`}}"]
}
}],
"provisioners": [{
"type": "shell",
"inline_shebang": "/bin/sh -x -e",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y"
]
},
{
"type": "shell",
"scripts": [
"scripts/update.sh",
"scripts/installation.sh",
"scripts/post-update.sh"
]
}
]
}
\ No newline at end of file
#!/bin/bash
sudo apt-get -y update
sudo wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
sudo apt-get -y update
sudo apt-get install -y rabbitmq-server
sudo systemctl start rabbitmq-server
sudo systemctl enable rabbitmq-server
sudo rabbitmq-plugins enable rabbitmq_management
sleep 10
sudo ufw allow 15672/tcp
cd /etc/rabbitmq
sudo touch rabbitmq.config
sudo chmod 777 rabbitmq.config
echo '[{rabbit,[{loopback_users,[]}]}].'>> rabbitmq.config
cd ..
cd ..
sudo service rabbitmq-server restart
#!/bin/sh
sudo /usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync
# echo '-------------- end SCRIPT POST - UPDATE.SH -------------- '
\ No newline at end of file
#!/bin/sh
sudo add-apt-repository universe -y && sudo apt-get update -y && sudo apt-get install build-essential libssl-dev libffi-dev python3-dev software-properties-common python3-pip python3-venv -y && sudo pip3 install virtualenv
/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync
# echo '-------------- end SCRIPT UPDATE.SH -------------- '
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment