hashicorp / packer-plugin-oracle

Packer plugin for Oracle Builder
https://www.packer.io/docs/builders/oracle
Mozilla Public License 2.0
8 stars 13 forks source link

Add option for disable agent config plugins #50

Open mo36924 opened 2 years ago

mo36924 commented 2 years ago

Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Some plugins are enabled by default and are installed during provisioning. In most cases, you don't need to enable the plugin when you create an image, so set the option to disable the plugin for the cloud agent.

agent config option https://docs.oracle.com/en-us/iaas/tools/go/65.6.0/core/index.html#LaunchInstanceDetails

VAdamec commented 1 year ago

Workaround for now (sample only)

provisioner "shell-local"{
        environment_vars = ["INSTANCE_ID=${build.ID}"]
        execute_command = ["sh", "-c", "{{.Vars}} {{.Script}}"]
        scripts = ["script/bugfixer.sh"]
    }

and

# script/bugfixer.sh
oci compute instance update --region=${REGION} \
--agent-config \
'{"are_all_plugins_disabled": "false", "is_management_disabled": "true", "is_monitoring_disabled": "false","plugins_config":[{"name": "Block Volume Management", "desired_state": "ENABLED", "name": "Custom Logs Monitoring", "desired_state": "DISABLED"}]}' \
--force --instance-id ${INSTANCE_ID}