Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(examples): flexible bootstrap options #22

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

michalbil
Copy link
Contributor

Description

Modify the way bootstrap options are passed in examples, so that any required one can be added at common/instance level, as needed.

Motivation and Context

Resolves #11

How Has This Been Tested?

Run plan/apply one of examples ("multi_nic_common") example with extended bootstrap options, on both common and instance levels.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@michalbil michalbil requested a review from a team as a code owner April 5, 2024 13:53
})
content = templatefile(
"templates/init-cfg.tmpl",
{ bootstrap_options = merge(var.vmseries_common.bootstrap_options, each.value.bootstrap_options) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we exclude some bootstrap_options here like authcodes for example?

Copy link
Contributor Author

@michalbil michalbil Apr 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! However, simply excluding those will result in making licensing options not available.
To exclude sensitive data from output of plan/apply, which is definitely relevant if such logs are stored in, for example, some CI/CD system, I've updated resource to local_sensitive_file.
Storing contents in the tfstate (eg. in a bucket) is a different story - you either have it or have no panorama licensing at all. This should be covered by local or bucket-level protection (encryption, appropriate access control).
Unless you have any proposal, I will mark this one as resolved.

@@ -56,8 +53,8 @@ module "bootstrap" {
service_account = module.iam_service_account[each.value.service_account_key].email
location = each.value.location
files = merge(
{ for k, v in var.vmseries : "files/${k}/config/bootstrap.xml" => "${k}/config/bootstrap.xml" },
{ for k, v in var.vmseries : "files/${k}/config/init-cfg.txt" => "${k}/config/init-cfg.txt" },
{ for k, v in var.vmseries : "files/${k}/config/bootstrap.xml" => "${k}/config/bootstrap.xml" if can(v.bootstrap_template_map) },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we handle authcodes in the example? How we do the licensing in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently authcodes are not handled in the examples.

examples/vmseries_ha/main.tf Outdated Show resolved Hide resolved
Copy link
Contributor

@horiagunica horiagunica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice enhancements! 👍

examples/vmseries_ha/main.tf Outdated Show resolved Hide resolved
@michalbil michalbil force-pushed the examples-flexible-bootstrap-options branch 3 times, most recently from 4fdb0d6 to 5b93561 Compare April 8, 2024 13:18
@michalbil michalbil force-pushed the examples-flexible-bootstrap-options branch from 5b93561 to 359dc67 Compare April 8, 2024 13:30
@michalbil michalbil merged commit a952af8 into main Apr 18, 2024
41 checks passed
@michalbil michalbil deleted the examples-flexible-bootstrap-options branch April 18, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional bootstrap parameters to the vpc_peering_dedicated example
4 participants