builds a golden image using a RHEL OS base image from azure, downloads vault, azure cli, goss, uploads files, configurations and installs necessary applications in the golden image
- install packer
- working knowledge of ansible
- working knowledge of goss for validating configuration
- add the values for
client-id
,client-secret
,subscription-id
,tenant-id
,az_image_name
,managed-image-rg-name
, invariables.auto.pkrvars.hcl.example
file
client-id = "c5bgyg0-575-....."
client-secret = "AdCD419~F...."
subscription-id = "c4774376-......"
tenant-id = "b9rc7889-....."
az_image_name = "your-custom-image-name"
managed-image-rg-name = "your-resource-group" # not parker created
- you can also change the
location
,img-publisher
,img-offer
,img-sku
,os-type
in thevariables.auto.pkrvars.hcl.example
(optional)
img-publisher = "Redhat"
img-offer = "RHEL"
img-sku = "8.2"
location = "Canada Central"
os-type = "Linux"
-
rename the
variables.auto.pkrvars.hcl.example
tovariables.auto.pkrvars.hcl
-
run
packer fmt .
for formatting code (optional) -
run
packer validate .
for ensuring no syntax error (optional) -
run
packer build .
for building the image
information about the ansible provisoner, go to ansible readme