Skip to content

Commit

Permalink
TTP v1.3.0 release with support ACOS_6.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
smundhe-a10 committed Oct 20, 2023
1 parent e744ce3 commit d7ca387
Show file tree
Hide file tree
Showing 970 changed files with 38,483 additions and 14,274 deletions.
389 changes: 307 additions & 82 deletions README.md

Large diffs are not rendered by default.

Binary file not shown.
137 changes: 137 additions & 0 deletions devops/jenkins/pipeline.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
pipeline {
agent any
parameters {
string defaultValue: '10.64.3.183', name: 'IP_ADDRESS'
string defaultValue: '1.2.2', name: 'PROVIDER_VERSION'
string defaultValue: 'admin', name: 'USER_NAME'
string defaultValue: 'a10', name: 'PASSWORD'
string defaultValue: '0', name: 'TERRAFORM_DESTROY'
string defaultValue: '/var/lib/jenkins/jobs/state_files', name: 'STATE_DIR_PATH'
string defaultValue: 'thunder_gslb_group', name: 'EXAMPLE_DIR_PATH'
string defaultValue: 'https://github.com/a10networks/terraform-provider-thunder.git', name: 'GIT_REPOSITORY'
string defaultValue: 'master', name: 'GIT_BRANCH'
}
stages {
stage('Clone Repository') {
steps {
echo "Cloning repository!!"
checkout([$class: 'GitSCM',
branches: (["$GIT_BRANCH" != 'master'] ? [[name: "$GIT_BRANCH"]] : []),
userRemoteConfigs: [[url: "$GIT_REPOSITORY"]]])
}
}

stage('Preparing Environment') {
steps {
echo "Changing directory!!"
dir("examples/resources/$EXAMPLE_DIR_PATH") {
echo "Removing state files!!!"
sh "rm -rf .terraform/ .terraform.lock.hcl .terraform.lock.hcl Thunder_shared.txt terraform.tfstate thunder.log terraform.tfstate.backup Thunder_L3v.txt"

echo "Creating variables.tf file!!"
script {
def varContent = """
variable "dut9049" {
description = "Thunder hostname/IP address"
type = string
}
variable "username" {
description = "Thunder username"
type = string
}
variable "password" {
description = "Thunder password"
type = string
}
"""
writeFile file: 'variables.tf', text: varContent
}

echo "Creating terraform.tfvars file!!"

script {
def tfvarContent = """
dut9049 = "${IP_ADDRESS}"
username = "${USER_NAME}"
password = "${PASSWORD}"
"""
writeFile file: 'terraform.tfvars', text: tfvarContent
}

echo "Creating provider.tf file!!"

script {
def providerContent = """
terraform {
required_providers {
thunder = {
source = "a10networks/thunder"
version = "${PROVIDER_VERSION}"
}
}
}
"""
writeFile file: 'provider.tf', text: providerContent
}
}
}
}

stage('Terraform') {
steps {
script {
if (params.TERRAFORM_DESTROY == "0") {

echo "Running terraform init"
dir("examples/resources/$EXAMPLE_DIR_PATH") {
sh 'terraform init'
}

echo "Running terraform plan"
dir("examples/resources/$EXAMPLE_DIR_PATH") {
sh "terraform plan -var=\"dut9049=${params.IP_ADDRESS}\" -var=\"username=${params.USER_NAME}\" -var=\"password=${params.PASSWORD}\""
}

echo "Running terraform apply"
dir("examples/resources/$EXAMPLE_DIR_PATH") {
sh "terraform apply --auto-approve -var=\"dut9049=${params.IP_ADDRESS}\" -var=\"username=${params.USER_NAME}\" -var=\"password=${params.PASSWORD}\""
}

def filename = "${EXAMPLE_DIR_PATH}"
def path = "${STATE_DIR_PATH}/${filename}"
echo "${path}"

echo "Copying state files"
dir("examples/resources/$EXAMPLE_DIR_PATH") {
sh "mkdir -p ${path}"
sh "cp -r .terraform .terraform.lock.hcl terraform.tfstate provider.tf terraform.tfvars variables.tf ${path}"
}


} else {
def filename = "${EXAMPLE_DIR_PATH}"
def path = "$STATE_DIR_PATH/$filename"
def example_path = "examples/resources/$EXAMPLE_DIR_PATH"

echo "Copying state files"
dir("examples/resources/$EXAMPLE_DIR_PATH") {
sh "cp -r ${path}/.terraform ."
sh "cp -r ${path}/.terraform.lock.hcl ."
sh "cp -r ${path}/terraform.tfstate ."
sh "cp -r ${path}/provider.tf ."
sh "cp -r ${path}/terraform.tfvars ."
sh "cp -r ${path}/variables.tf ."
}

echo "Running terraform destroy"
dir("examples/resources/$EXAMPLE_DIR_PATH") {
sh "terraform destroy --auto-approve -var=\"dut9049=${params.IP_ADDRESS}\" -var=\"username=${params.USER_NAME}\" -var=\"password=${params.PASSWORD}\""
}
}
}
}
}
}
}
Binary file not shown.
53 changes: 53 additions & 0 deletions devops/tekton/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: terraform-pipeline
spec:
params:
- name: REPO_URL
description: URL of the repository to clone
type: string
default: https://github.com/a10networks/terraform-provider-thunder.git
- name: REPO_PATH
description: Path where the repository will be cloned
type: string
default: /workspace/repo
- name: DIR_PATH
description: Path where the examples are present
type: string
default: examples/resources/thunder_gslb_group
- name: IP_ADDRESS
description: IP address of ACOS
type: string
default: 10.64.3.183
- name: USER_NAME
description: User name of ACOS
type: string
default: admin
- name: PASSWORD
description: Password of ACOS
type: string
default: a10
- name: PROVIDER_VERSION
description: Thunder provider version
type: string
default: 1.2.2
tasks:
- name: configure-acos-using-terraform
taskRef:
name: configure-acos-using-terraform
params:
- name: REPO_URL
value: $(params.REPO_URL)
- name: REPO_PATH
value: $(params.REPO_PATH)
- name: DIR_PATH
value: $(params.DIR_PATH)
- name: IP_ADDRESS
value: $(params.IP_ADDRESS)
- name: USER_NAME
value: $(params.USER_NAME)
- name: PASSWORD
value: $(params.PASSWORD)
- name: PROVIDER_VERSION
value: $(params.PROVIDER_VERSION)
111 changes: 111 additions & 0 deletions devops/tekton/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: configure-acos-using-terraform
spec:
params:
- name: REPO_URL
description: URL of the repository to clone
type: string
default: https://github.com/a10networks/terraform-provider-thunder.git
- name: REPO_PATH
description: Path where the repository will be cloned
type: string
default: /workspace/repo
- name: DIR_PATH
description: Path wehere the examples are present
type: string
default: examples/resources/thunder_gslb_group
- name: IP_ADDRESS
description: Ip address of acos
type: string
default: 10.10.10.10
- name: USER_NAME
description: User name of acos
type: string
default: admin
- name: PASSWORD
description: Password of acos
type: string
default: a10
- name: PROVIDER_VERSION
description: Thunder provider version
type: string
default: 1.2.2

steps:
- name: clone-repository
image: bitnami/git
workingDir: $(params.REPO_PATH)
command:
- sh
- -c
args:
- |
git clone $(params.REPO_URL)
- name: create-files
image: ubuntu
workingDir: $(params.REPO_PATH)
command:
- sh
- -c
args:
- |
cd terraform-provider-thunder/$(params.DIR_PATH)
echo ' variable "dut9049"' { >> variables.tf
echo ' description = "Thunder hostname/IP address"' >> variables.tf
echo type = string >> variables.tf
echo } >> variables.tf
echo ' variable "username"' { >> variables.tf
echo ' description = "Thunder username"' >> variables.tf
echo type = string >> variables.tf
echo } >> variables.tf
echo ' variable "password"' { >> variables.tf
echo ' description = "Thunder password"' >> variables.tf
echo type = string >> variables.tf
echo } >> variables.tf
echo ' dut9049 = "$(params.IP_ADDRESS)"' >> terraform.tfvars
echo ' username = "$(params.USER_NAME)"' >> terraform.tfvars
echo ' password = "$(params.PASSWORD)"' >> terraform.tfvars
echo terraform { >> provider.tf
echo required_providers { >> provider.tf
echo thunder = { >> provider.tf
echo ' source = "a10networks/thunder"' >> provider.tf
echo ' version = "$(params.PROVIDER_VERSION)"' >> provider.tf
echo } >> provider.tf
echo } >> provider.tf
echo } >> provider.tf
- name: install-and-configure
image: ubuntu
workingDir: $(params.REPO_PATH)
command:
- sh
- -c
args:
- |
cd terraform-provider-thunder/$(params.DIR_PATH)
echo "Upgrade packages!!"
apt update
apt install -y git wget unzip
echo "Install terraform!!!!"
wget https://releases.hashicorp.com/terraform/1.5.2/terraform_1.5.2_linux_amd64.zip
unzip terraform_1.5.2_linux_amd64.zip
chmod +x terraform
mv terraform /usr/local/bin/
echo "Apply configurations"
terraform init
terraform plan
terraform apply --auto-approve
Binary file removed docs/A10_TTP_1.2.0.pdf
Binary file not shown.
41 changes: 41 additions & 0 deletions docs/data-sources/clock_show_oper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "thunder_clock_show_oper Data Source - terraform-provider-thunder"
subcategory: ""
description: |-
thunder_clock_show_oper: Operational Status for the object show
PLACEHOLDER
---

# thunder_clock_show_oper (Data Source)

`thunder_clock_show_oper`: Operational Status for the object show

__PLACEHOLDER__



<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `oper` (Block List, Max: 1) (see [below for nested schema](#nestedblock--oper))

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--oper"></a>
### Nested Schema for `oper`

Optional:

- `date` (String)
- `day` (String)
- `offset` (String)
- `source_type` (Number)
- `time` (String)
- `timezone` (String)


47 changes: 47 additions & 0 deletions docs/data-sources/interface_available_eth_list_oper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "thunder_interface_available_eth_list_oper Data Source - terraform-provider-thunder"
subcategory: ""
description: |-
thunder_interface_available_eth_list_oper: Operational Status for the object available-eth-list
PLACEHOLDER
---

# thunder_interface_available_eth_list_oper (Data Source)

`thunder_interface_available_eth_list_oper`: Operational Status for the object available-eth-list

__PLACEHOLDER__



<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `oper` (Block List, Max: 1) (see [below for nested schema](#nestedblock--oper))

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--oper"></a>
### Nested Schema for `oper`

Optional:

- `if_list` (Block List) (see [below for nested schema](#nestedblock--oper--if_list))
- `tot_num_of_ports` (Number)

<a id="nestedblock--oper--if_list"></a>
### Nested Schema for `oper.if_list`

Optional:

- `if_num` (Number)
- `if_status` (String)
- `if_type` (String)
- `state` (String)


Loading

0 comments on commit d7ca387

Please sign in to comment.