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

updated event stream functionality #91

Open
wants to merge 1 commit into
base: tidy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion terraform/chef-automate/azure/chef_automate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ data "template_file" "set_chef_automate_token" {
}
}

data "template_file" "automate_eas_config" {
template = file(
"${path.module}/templates/chef_automate/automate-eas-config.toml.tpl",
)

vars = {
disable_event_tls = var.disable_event_tls
}
}

locals {
full_cert_chain = "${acme_certificate.automate_cert.certificate_pem}${acme_certificate.automate_cert.issuer_pem}"
}
Expand Down Expand Up @@ -138,6 +148,11 @@ resource "azurerm_virtual_machine" "chef_automate" {
content = data.template_file.set_chef_automate_token.rendered
}

provisioner "file" {
destination = "/tmp/automate-eas-config.toml"
content = data.template_file.automate_eas_config.rendered
}

provisioner "file" {
destination = "/tmp/ssl_cert"
content = var.automate_custom_ssl ? var.automate_custom_ssl_cert_chain : local.full_cert_chain
Expand All @@ -162,6 +177,7 @@ resource "azurerm_virtual_machine" "chef_automate" {
"sudo rm -f /tmp/ssl_cert /tmp/ssl_key",
"sudo mv /tmp/config.toml /etc/chef-automate/config.toml",
"sudo ./chef-automate deploy ${var.automate_products} /etc/chef-automate/config.toml --accept-terms-and-mlsa",
"sudo ./chef-automate config patch /tmp/automate-eas-config.toml",
"sleep 60",
"sudo chown ${var.azure_image_user}:${var.azure_image_user} $HOME/automate-credentials.toml",
"sudo echo -e api-token = \"$(sudo chef-automate admin-token)\" >> $HOME/automate-credentials.toml",
Expand Down Expand Up @@ -202,4 +218,3 @@ data "external" "a2_secrets" {
a2_ip = azurerm_public_ip.automate_pip.ip_address
}
}

13 changes: 12 additions & 1 deletion terraform/chef-automate/azure/security_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ resource "azurerm_network_security_group" "chef_automate" {
destination_address_prefix = "*"
}

security_rule {
name = "4222"
priority = 1006
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "4222"
source_address_prefix = "*"
destination_address_prefix = "*"
}

tags = {
X-Dept = var.tag_dept
X-Customer = var.tag_customer
Expand All @@ -73,4 +85,3 @@ resource "azurerm_network_security_group" "chef_automate" {
X-TTL = var.tag_ttl
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[event_gateway]
[event_gateway.v1]
[event_gateway.v1.sys]
[event_gateway.v1.sys.service]
disable_frontend_tls = ${disable_event_tls}
5 changes: 4 additions & 1 deletion terraform/chef-automate/azure/tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ tag_project = "proj"
tag_dept = "sales"
// Contacdt Tag
tag_contact = "[email protected]"
// Chef Automate Hostname
// Chef Automate
automate_hostname = "jmery-a2"
automate_password = "some-password"
automate_token = "reusable-token"
automate_license = "your-license"
7 changes: 6 additions & 1 deletion terraform/chef-automate/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,9 @@ variable "automate_token" {
variable "automate_products" {
default = "--product automate"
description = "default Automate only options as follows: --product builder --product automate --product chef-server"
}
}

variable "disable_event_tls" {
default = "true"
description = "Demo does not support encryption for event stream, see automate docs for production deploys with encryption"
}