Last active
September 6, 2021 03:49
-
-
Save g1soori/a2272136437ebee2b74a891dc9ac690c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"ssh_user": "admin", | |
"ssh_pass": "abc@341256", | |
"mgd_image": "apchewebserver", | |
"rg": "rg_name", | |
"subscription_id": "subscription-id", | |
"image_ver": "1.0.0" | |
}, | |
"builders": [ | |
{ | |
"type": "azure-arm", | |
"subscription_id": "{{user `subscription_id`}}", | |
"build_resource_group_name": "{{user `rg`}}", | |
"shared_image_gallery": { | |
"subscription": "{{user `subscription_id`}}", | |
"resource_group": "{{user `rg`}}", | |
"gallery_name": "web_app", | |
"image_name": "rhel7", | |
"image_version": "{{user `image_ver`}}" | |
}, | |
"managed_image_name": "{{user `mgd_image`}}", | |
"managed_image_resource_group_name": "{{user `rg`}}", | |
"shared_image_gallery_destination": { | |
"resource_group": "{{user `rg`}}", | |
"gallery_name": "web_app", | |
"image_name": "rhel7-oracledb", | |
"image_version": "{{user `image_ver`}}", | |
"replication_regions": ["US East"] | |
}, | |
"shared_image_gallery_timeout": "2h5m2s", | |
"virtual_network_name": "vnet_name", | |
"virtual_network_subnet_name": "snet_name", | |
"virtual_network_resource_group_name": "{{user `rg`}}", | |
"os_type": "Linux", | |
"ssh_username": "{{user `ssh_user`}}", | |
"ssh_password": "{{user `ssh_pass`}}", | |
"ssh_pty": "true", | |
"disk_additional_size": "300", | |
"azure_tags": { | |
"app": "oracledb" | |
}, | |
"vm_size": "Standard_A2" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "ansible", | |
"playbook_file": "./config_oracledb.yml", | |
"ansible_env_vars": [ | |
"ANSIBLE_HOST_KEY_CHECKING=False", "ansible_python_interpreter=/opt/azure/bin/python", | |
"ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s'" | |
], | |
"extra_arguments": [ | |
"-vvvv", | |
"-e", | |
"ansible_python_interpreter=/opt/azure/bin/python" | |
], | |
"use_proxy": "false", | |
"user": "root" | |
}, | |
{ | |
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", | |
"inline": [ | |
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" | |
], | |
"inline_shebang": "/bin/sh -x", | |
"type": "shell" | |
} | |
], | |
"post-processors": [ | |
[ | |
{ | |
"inline": [ | |
"az image delete -n {{user `mgd_image`}} -g {{user `rg`}} --subscription {{user `subscription_id`}}" | |
], | |
"type": "shell-local" | |
} | |
] | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment