Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Release 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lfeldman committed May 11, 2021
1 parent ca7a05f commit 6fdaad5
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 72 deletions.
6 changes: 3 additions & 3 deletions main.tf → compute.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ------------------------------------------------------------------------------
# Setup Bastion Host
# ------------------------------------------------------------------------------
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

resource "oci_core_instance" "JenkinsBastion" {
availability_domain = var.availablity_domain_name
compartment_id = var.compartment_ocid
Expand Down
19 changes: 10 additions & 9 deletions datasources.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
############################################
# Datasource
############################################
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

# Gets a list of Availability Domains
data "oci_identity_availability_domains" "ad" {
Expand Down Expand Up @@ -63,9 +62,11 @@ data "oci_core_images" "bastion_image" {
}
}

# Gets the Id of a specific OS Images
#data "oci_core_images" "InstanceImageOCID" {
# #Required
# compartment_id = var.compartment_ocid
# display_name = var.OsImage
#}
data "oci_identity_region_subscriptions" "home_region_subscriptions" {
tenancy_id = var.tenancy_ocid

filter {
name = "is_home_region"
values = [true]
}
}
20 changes: 16 additions & 4 deletions loadbalancer.tf → lb.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
############################################
# Create Load Balancer
############################################
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

locals {
is_flexible_lb_shape = var.lb_shape == "flexible" ? true : false
}

resource "oci_load_balancer" "JenkinsLB" {
shape = "100Mbps"
shape = var.lb_shape

dynamic "shape_details" {
for_each = local.is_flexible_lb_shape ? [1] : []
content {
minimum_bandwidth_in_mbps = var.flex_lb_min_shape
maximum_bandwidth_in_mbps = var.flex_lb_max_shape
}
}

compartment_id = var.compartment_ocid

subnet_ids = [
Expand Down
3 changes: 3 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

locals {

# Network Locals #
Expand Down
3 changes: 3 additions & 0 deletions network.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

############################################
# Create VCN
############################################
Expand Down
3 changes: 3 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

output "master_private_ip" {
value = module.jenkins.master_private_ip
}
Expand Down
19 changes: 10 additions & 9 deletions provider.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## This file declare Provider block and variables required to run the template using Terraform CLI with standard user based authentication.
## Remove this file from your OCI ORM Stack as ORM will pick up these variables from the authenticated user running the ORM Stack.
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

############################################
# Provider
Expand All @@ -12,11 +12,12 @@ provider "oci" {
region = var.region
}

variable "user_ocid" {
}

variable "fingerprint" {
provider "oci" {
alias = "homeregion"
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
region = data.oci_identity_region_subscriptions.home_region_subscriptions.region_subscriptions[0].region_name
disable_auto_retries = "true"
}

variable "private_key_path" {
}
133 changes: 99 additions & 34 deletions schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,45 @@ variableGroups:
variables:
- tenancy_ocid
- region
- release
- bastion_user

- title: "Required Configuration"
visible: true
variables:
- compartment_ocid
- availablity_domain_name
- jenkins_password
- show_advanced

- title: "Optional Configuration"
visible: true
- title: Networking Optional Configuration
visible:
and:
- show_advanced
variables:
- plugins
- vcn_cidr
- label_prefix
- lb_http_port
- lb_https_port
- http_port
- jnlp_port
- jenkins_version
- agent_count

- title: Load Balancer Optional Configuration
visible:
and:
- show_advanced
variables:
- lb_shape
- flex_lb_min_shape
- flex_lb_max_shape
- lb_http_port
- lb_https_port
- listener_ca_certificate
- listener_private_key
- listener_public_certificate

- title: Compute Optional Configuration
visible:
and:
- show_advanced
variables:
- instance_os
- linux_os_version
- bastion_display_name
Expand All @@ -47,13 +66,27 @@ variableGroups:
- agent_shape
- agent_flex_shape_ocpus
- agent_flex_shape_memory
- bastion_user
- listener_ca_certificate
- listener_private_key
- listener_public_certificate
- release

- title: Jenkins Optional Configuration
visible:
and:
- show_advanced
variables:
- jenkins_version
- agent_count
- plugins
- label_prefix


variables:

show_advanced:
type: boolean
title: "Show advanced options?"
description: "Shows advanced options."
visible: true
default: false

# General Configuration
tenancy_ocid:
title: "Tenancy ID"
Expand Down Expand Up @@ -141,6 +174,56 @@ variables:
type: number
required: false

lb_shape:
type: enum
title: "Load Balancer Shape"
description: "Load Balancer Shape"
default: "flexible"
required: false
enum:
- "flexible"
- "100Mbps"
- "10Mbps"
- "10Mbps-Micro"
- "400Mbps"
- "8000Mbps"

flex_lb_min_shape:
type: enum
required: false
default: "10"
title: "LB Flex Min Shape"
description: "Choose Minimum Shape for Flex Load Balancer."
enum:
- "10"
- "100"
- "1000"
- "400"
- "8000"
visible:
and:
- eq:
- lb_shape
- "flexible"

flex_lb_max_shape:
type: enum
required: false
default: "100"
title: "LB Flex Max Shape"
description: "Choose Maximum Shape for Flex Load Balancer."
enum:
- "10"
- "100"
- "1000"
- "400"
- "8000"
visible:
and:
- eq:
- lb_shape
- "flexible"

http_port:
title: "HTTP Port"
description: "HTTP Port for Jenkins Server"
Expand Down Expand Up @@ -211,7 +294,7 @@ variables:
type: oci:core:instanceshape:name
title: "Bastion Server Shape"
description: "Bastion Server Shape"
default: "VM.Standard2.1"
default: "VM.Standard.E3.Flex"
required: false
dependsOn:
compartmentId: ${compartment_ocid}
Expand All @@ -225,9 +308,6 @@ variables:
- eq:
- bastion_shape
- "VM.Standard.E4.Flex"
- eq:
- bastion_shape
- "VM.Standard.A1.Flex"
type: integer
default: 1
title: Bastion Server Flex Shape OCPUs
Expand All @@ -245,9 +325,6 @@ variables:
- eq:
- bastion_shape
- "VM.Standard.E4.Flex"
- eq:
- bastion_shape
- "VM.Standard.A1.Flex"
type: integer
default: 6
title: Bastion Server Flex Shape Memory
Expand All @@ -260,7 +337,7 @@ variables:
type: oci:core:instanceshape:name
title: "Jenkins Master Server Shape"
description: "Jenkins Master Server Shape"
default: "VM.Standard2.4"
default: "VM.Standard.E3.Flex"
required: false
dependsOn:
compartmentId: ${compartment_ocid}
Expand All @@ -274,9 +351,6 @@ variables:
- eq:
- master_shape
- "VM.Standard.E4.Flex"
- eq:
- master_shape
- "VM.Standard.A1.Flex"
type: integer
default: 1
title: Jenkins Master Server Flex Shape OCPUs
Expand All @@ -295,9 +369,6 @@ variables:
- eq:
- master_shape
- "VM.Standard.E4.Flex"
- eq:
- master_shape
- "VM.Standard.A1.Flex"
type: integer
default: 6
title: Jenkins Master Server Flex Shape Memory
Expand All @@ -310,7 +381,7 @@ variables:
type: oci:core:instanceshape:name
title: "Jenkins Agent Server Shape"
description: "Jenkins Agent Server Shape"
default: "VM.Standard2.4"
default: "VM.Standard.E3.Flex"
required: false
dependsOn:
compartmentId: ${compartment_ocid}
Expand All @@ -324,9 +395,6 @@ variables:
- eq:
- agent_shape
- "VM.Standard.E4.Flex"
- eq:
- agent_shape
- "VM.Standard.A1.Flex"
type: integer
default: 1
title: Jenkins Agent Server Flex Shape OCPUs
Expand All @@ -345,9 +413,6 @@ variables:
- eq:
- agent_shape
- "VM.Standard.E4.Flex"
- eq:
- agent_shape
- "VM.Standard.A1.Flex"
type: integer
default: 6
title: Jenkins Agent Server Flex Shape Memory
Expand Down
12 changes: 9 additions & 3 deletions tags.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

resource "random_id" "tag" {
byte_length = 2
}

resource "oci_identity_tag_namespace" "ArchitectureCenterTagNamespace" {
provider = oci.homeregion
compartment_id = var.compartment_ocid
description = "ArchitectureCenterTagNamespace"
name = "ArchitectureCenter\\jenkins-master-agent-mode"
name = "ArchitectureCenter\\jenkins-master-agent-mode-${random_id.tag.hex}"

provisioner "local-exec" {
command = "sleep 10"
Expand All @@ -13,16 +18,17 @@ resource "oci_identity_tag_namespace" "ArchitectureCenterTagNamespace" {
}

resource "oci_identity_tag" "ArchitectureCenterTag" {
provider = oci.homeregion
description = "ArchitectureCenterTag"
name = "release"
tag_namespace_id = oci_identity_tag_namespace.ArchitectureCenterTagNamespace.id

validator {
validator_type = "ENUM"
values = ["release", "1.1"]
values = ["release", "1.2"]
}

provisioner "local-exec" {
command = "sleep 20"
command = "sleep 120"
}
}
3 changes: 3 additions & 0 deletions tls.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Copyright © 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl

resource "tls_private_key" "public_private_key_pair" {
algorithm = "RSA"
}
Loading

0 comments on commit 6fdaad5

Please sign in to comment.