Skip to content

Commit 78b497b

Browse files
authored
Merge pull request #62 from oracle-devrel/develop
Automation Toolkit Release v11.1
2 parents 5fad8eb + 5944d9d commit 78b497b

File tree

90 files changed

+618
-1634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+618
-1634
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<li> <a href= "#introduction">Introduction</a></li>
1010

11-
<li> <a href = "https://github.com/oracle-devrel/cd3-automation-toolkit/releases/tag/v11">What's new in this release</a></li>
11+
<li> <a href = "https://github.com/oracle-devrel/cd3-automation-toolkit/releases/tag/v11.1">What's new in this release</a></li>
1212
<li> <a href = "/cd3_automation_toolkit/documentation/user_guide/learn_more/CD3ExcelTabs.md">Toolkit Supported OCI Services</a></li>
1313
<li> <a href = "/cd3_automation_toolkit/documentation/user_guide/RunningAutomationToolkit.md#excel-sheet-templates">Excel Templates</a></li>
1414

@@ -29,14 +29,15 @@
2929
<li> <a href="/cd3_automation_toolkit/documentation/user_guide/GreenField.md">Green Field Tenancies</a>
3030
<ul>
3131
<li> <a href="/cd3_automation_toolkit/documentation/user_guide/NetworkingScenariosGF.md"</a><b> Must Read :</b> Managing Network for Greenfield Tenancies</li>
32-
<li> <a href="/cd3_automation_toolkit/documentation/user_guide/RemoteExecution.md"</a><b> Must Read :</b> Remote Execution/Cloud Init for OCI compute instances</li>
32+
<li> <a href="/cd3_automation_toolkit/documentation/user_guide/ComputeGF.md"</a><b> Must Read :</b> Managing Compute Instances for Greefield Tenancies</li>
3333
</ul>
3434
</ul>
3535
</li>
3636
<ul>
3737
<li> <a href="/cd3_automation_toolkit/documentation/user_guide/NonGreenField.md">Non Greenfield Tenancies</a>
3838
<ul>
3939
<li><a href ="/cd3_automation_toolkit/documentation/user_guide/NetworkingScenariosNGF.md"</a><b> Must Read : </b> Managing Network for Non-Greenfield Tenancies</li>
40+
<li><a href = "/cd3_automation_toolkit/documentation/user_guide/ComputeNGF.md"</a><b> Must Read : </b> Managing Compute Instances for Non-Greenfield Tenancies </li>
4041
</ul>
4142
</ul>
4243

cd3_automation_toolkit/Compute/create_terraform_dedicatedhosts.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#
1111

1212
import sys
13-
import argparse
1413
import os
1514
from oci.config import DEFAULT_LOCATION
1615
from pathlib import Path
@@ -23,18 +22,9 @@
2322
######
2423
# Required Inputs-CD3 excel file, Config file, prefix AND outdir
2524
######
26-
def parse_args():
27-
# Read input arguments
28-
parser = argparse.ArgumentParser(description='Create Dedicated VM Hosts terraform file')
29-
parser.add_argument('inputfile', help='Full Path of input CD3 excel file')
30-
parser.add_argument('outdir', help='Output directory for creation of TF files')
31-
parser.add_argument("service_dir",help="subdirectory under region directory in case of separate out directory structure")
32-
parser.add_argument('prefix', help='TF files prefix')
33-
parser.add_argument('--config', default=DEFAULT_LOCATION, help='Config file name')
34-
return parser.parse_args()
35-
3625

3726
# If input is CD3 excel file
27+
# Execution of the code begins here
3828
def create_terraform_dedicatedhosts(inputfile, outdir, service_dir,prefix, config):
3929
# Load the template file
4030
file_loader = FileSystemLoader(f'{Path(__file__).parent}/templates')
@@ -153,10 +143,3 @@ def create_terraform_dedicatedhosts(inputfile, outdir, service_dir,prefix, confi
153143
print(outfile + " for dedicated vm hosts has been created for region " + reg)
154144
oname.write(tfStr[reg])
155145
oname.close()
156-
157-
158-
159-
if __name__ == '__main__':
160-
args = parse_args()
161-
# Execution of the code begins here
162-
create_terraform_dedicatedhosts(args.inputfile, args.outdir, args.service_dir,args.prefix, args.config)

cd3_automation_toolkit/Compute/create_terraform_instances.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#
1111

1212
import sys
13-
import argparse
1413
import os
1514
from oci.config import DEFAULT_LOCATION
1615
from pathlib import Path
@@ -20,18 +19,8 @@
2019
from jinja2 import Environment, FileSystemLoader
2120

2221

23-
def parse_args():
24-
parser = argparse.ArgumentParser(description='Creates Instances TF file')
25-
parser.add_argument('inputfile', help='Full Path of input CD3 excel file')
26-
parser.add_argument('outdir', help='Output directory for creation of TF files')
27-
parser.add_argument("service_dir",
28-
help="subdirectory under region directory in case of separate out directory structure")
29-
parser.add_argument('prefix', help='TF files prefix')
30-
parser.add_argument('--config', default=DEFAULT_LOCATION, help='Config file name')
31-
return parser.parse_args()
32-
33-
3422
# If input is CD3 excel file
23+
# Execution of the code begins here
3524
def create_terraform_instances(inputfile, outdir, service_dir, prefix, config):
3625
boot_policy_tfStr = {}
3726
tfStr = {}
@@ -244,8 +233,3 @@ def create_terraform_instances(inputfile, outdir, service_dir, prefix, config):
244233
oname.write(tfStr[reg])
245234
oname.close()
246235

247-
248-
if __name__ == '__main__':
249-
args = parse_args()
250-
# Execution of the code begins here
251-
create_terraform_instances(args.inputfile, args.outdir, args.service_dir, args.prefix, args.config)

cd3_automation_toolkit/Compute/export_dedicatedvmhosts_nonGreenField.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# Oracle Consulting
99
#
1010

11-
import argparse
1211
import oci
1312
import os
1413

@@ -44,20 +43,7 @@ def print_dedicatedvmhosts(region, dedicatedvmhost, values_for_column, ntk_compa
4443
oci_objs = [dedicatedvmhost]
4544
values_for_column = commonTools.export_extra_columns(oci_objs, col_header, sheet_dict, values_for_column)
4645

47-
48-
def parse_args():
49-
# Read the arguments
50-
parser = argparse.ArgumentParser(description="Export Block Volumes on OCI to CD3")
51-
parser.add_argument("inputfile", help="path of CD3 excel file to export Block Volume objects to")
52-
parser.add_argument("outdir", help="path to out directory containing script for TF import commands")
53-
parser.add_argument("service_dir",help="subdirectory under region directory in case of separate out directory structure")
54-
parser.add_argument("--config", default=DEFAULT_LOCATION, help="Config file name")
55-
parser.add_argument("--export-compartments", nargs='*', required=False, help="comma seperated Compartments for which to export Block Volume Objects")
56-
parser.add_argument("--export-regions", nargs='*', help="comma seperated Regions for which to export Networking Objects",
57-
required=False)
58-
return parser.parse_args()
59-
60-
46+
# Execution of the code begins here
6147
def export_dedicatedvmhosts(inputfile, _outdir, service_dir, _config, ct, export_compartments=[], export_regions=[]):
6248
global tf_import_cmd
6349
global sheet_dict
@@ -125,9 +111,3 @@ def export_dedicatedvmhosts(inputfile, _outdir, service_dir, _config, ct, export
125111
commonTools.write_to_cd3(values_for_column, cd3file, "DedicatedVMHosts")
126112

127113
print("Dedicated VM Hosts exported to CD3\n")
128-
129-
130-
if __name__ == '__main__':
131-
args = parse_args()
132-
# Execution of the code begins here
133-
export_dedicatedvmhosts(args.inputfile, args.outdir, args.service_dir,args.config, args.export_compartments, args.export_regions)

cd3_automation_toolkit/Compute/export_instances_nonGreenField.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Oracle Consulting.
55

66
import re
7-
import argparse
87
import sys
98
import oci
109
import os
@@ -249,20 +248,7 @@ def __get_instances_info(compartment_name, compartment_id, reg_name, config,disp
249248
ins_shape, key_name, compartment_name, bkp_policy_name, nsg_names, dedicated_host,
250249
ins, values_for_column_instances, bdet, cpcn,shape_config, vnic_info, vnic_defined_tags, vnic_freeform_tags, launch_options)
251250

252-
253-
def parse_args():
254-
parser = argparse.ArgumentParser(description="Export Instances in OCI to CD3")
255-
parser.add_argument("inputfile", help="path of CD3 excel file to export Instance objects to")
256-
parser.add_argument("outdir", help="path to out directory containing script for TF import commands")
257-
parser.add_argument("service_dir",help="subdirectory under region directory in case of separate out directory structure")
258-
parser.add_argument("--config", default=DEFAULT_LOCATION, help="Config file name")
259-
parser.add_argument("--export-compartments", nargs='*', required=False, help="comma seperated Compartments for which to export Instance Objects")
260-
parser.add_argument("--export-regions", nargs='*', help="comma seperated Regions for which to export Networking Objects",
261-
required=False)
262-
263-
return parser.parse_args()
264-
265-
251+
# Execution of the code begins here
266252
def export_instances(inputfile, outdir, service_dir,config,ct, export_compartments=[], export_regions=[],display_names=[],ad_names=[]):
267253
cd3file = inputfile
268254

@@ -373,8 +359,3 @@ def export_instances(inputfile, outdir, service_dir,config,ct, export_compartmen
373359
commonTools.write_to_cd3(values_for_column_instances, cd3file, "Instances")
374360
print("{0} Instance Details exported into CD3.\n".format(len(values_for_column_instances["Region"])))
375361

376-
377-
if __name__ == '__main__':
378-
# Execution of the code begins here
379-
args = parse_args()
380-
export_instances(args.inputfile, args.outdir, args.service_dir,args.config, args.export_compartments, args.export_regions)

cd3_automation_toolkit/Database/create_terraform_adb.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
#!/usr/bin/python3
22
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#
4-
# This script will produce a Terraform file that will be used to set up OCI core components
5-
# Groups
4+
# This script will produce a Terraform file that will be used to set up OCI Database
5+
# Autonomous Database
66
#
77
# Author: Kartikey Rajput
88
# Oracle Consulting
99
# Modified (TF Upgrade): Divya Das
1010
#
11-
12-
import sys
13-
import argparse
1411
import os
1512
from jinja2 import Environment, FileSystemLoader
1613
from oci.config import DEFAULT_LOCATION
@@ -21,18 +18,7 @@
2118
######
2219
# Required Inputs- CD3 excel file, Config file, prefix AND outdir
2320
######
24-
def parse_args():
25-
# Read the arguments
26-
parser = argparse.ArgumentParser(description="Create ADB terraform file")
27-
parser.add_argument("inputfile", help="Full Path of input file. It could be CD3 excel file")
28-
parser.add_argument("outdir", help="directory path for output tf files ")
29-
parser.add_argument("service_dir", help="subdirectory under region directory in case of separate out directory structure")
30-
parser.add_argument("prefix", help="customer name/prefix for all file names")
31-
parser.add_argument("--config", default=DEFAULT_LOCATION, help="Config file name")
32-
return parser.parse_args()
33-
34-
35-
#If input is cd3 file
21+
# Execution of the code begins here
3622
def create_terraform_adb(inputfile, outdir, service_dir, prefix, config=DEFAULT_LOCATION):
3723

3824
filename = inputfile
@@ -221,8 +207,3 @@ def create_terraform_adb(inputfile, outdir, service_dir, prefix, config=DEFAULT_
221207
oname[reg].write(tfStr[reg])
222208
oname[reg].close()
223209
print(outfile[reg] + " containing TF for ADB has been created for region "+reg)
224-
225-
if __name__ == '__main__':
226-
# Execution of the code begins here
227-
args = parse_args()
228-
create_terraform_adb(args.inputfile, args.outdir, args.service_dir, args.prefix, args.config)

cd3_automation_toolkit/Database/create_terraform_dbsystems_vm_bm.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#!/usr/bin/python3
22
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#
4-
# This script will produce a Terraform file that will be used to set up OCI core components
4+
# This script will produce a Terraform file that will be used to set up OCI Database
55
# Database System Virtual Machine
66
#
77
# Author: Suruchi
88
# Oracle Consulting
99
#
1010

1111
import sys
12-
import argparse
1312
import os
1413
from jinja2 import Environment, FileSystemLoader
1514
from oci.config import DEFAULT_LOCATION
@@ -20,18 +19,7 @@
2019
######
2120
# Required Inputs- CD3 excel file, Config file, prefix AND outdir
2221
######
23-
def parse_args():
24-
# Read the arguments
25-
parser = argparse.ArgumentParser(description="Create DB VM and DB BM terraform file")
26-
parser.add_argument('inputfile', help='Full Path of input CD3 excel file')
27-
parser.add_argument("outdir", help="directory path for output tf files ")
28-
parser.add_argument("service_dir", help="subdirectory under region directory in case of separate out directory structure")
29-
parser.add_argument('prefix', help='TF files prefix')
30-
parser.add_argument('--config', default=DEFAULT_LOCATION, help='Config file name')
31-
return parser.parse_args()
32-
33-
34-
#If input is cd3 file
22+
# Execution of the code begins here
3523
def create_terraform_dbsystems_vm_bm(inputfile, outdir, service_dir, prefix, config=DEFAULT_LOCATION):
3624
filename = inputfile
3725
configFileName = config
@@ -260,8 +248,3 @@ def create_terraform_dbsystems_vm_bm(inputfile, outdir, service_dir, prefix, con
260248
oname[reg].close()
261249
print(outfile[reg] + " for DBSystems-VM-BM has been created for region "+reg)
262250

263-
264-
if __name__ == '__main__':
265-
args = parse_args()
266-
# Execution of the code begins here
267-
create_terraform_dbsystems_vm_bm(args.inputfile, args.outdir, args.service_dir, args.prefix, args.config)

cd3_automation_toolkit/Database/create_terraform_exa_infra.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#!/usr/bin/python3
22
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#
4-
# This script will produce a Terraform file that will be used to set up OCI core components
4+
# This script will produce a Terraform file that will be used to set up OCI Database
55
# Database EXA
66
#
77
# Author: Suruchi
88
# Oracle Consulting
99
#
1010

11-
import sys
12-
import argparse
1311
import os
1412
from jinja2 import Environment, FileSystemLoader
1513
from oci.config import DEFAULT_LOCATION
@@ -20,18 +18,7 @@
2018
######
2119
# Required Inputs- CD3 excel file, Config file, prefix AND outdir
2220
######
23-
def parse_args():
24-
# Read the arguments
25-
parser = argparse.ArgumentParser(description="Create EXA Infra terraform file")
26-
parser.add_argument('inputfile', help='Full Path of input CD3 excel file')
27-
parser.add_argument("outdir", help="directory path for output tf files ")
28-
parser.add_argument("service_dir", help="subdirectory under region directory in case of separate out directory structure")
29-
parser.add_argument('prefix', help='TF files prefix')
30-
parser.add_argument('--config', default=DEFAULT_LOCATION, help='Config file name')
31-
return parser.parse_args()
32-
33-
34-
#If input is cd3 file
21+
# Execution of the code begins here
3522
def create_terraform_exa_infra(inputfile, outdir, service_dir, prefix, config=DEFAULT_LOCATION):
3623
filename = inputfile
3724
configFileName = config
@@ -166,8 +153,3 @@ def create_terraform_exa_infra(inputfile, outdir, service_dir, prefix, config=DE
166153
oname[reg].write(tfStr[reg])
167154
oname[reg].close()
168155
print(outfile[reg] + " for EXA-Infra has been created for region "+reg)
169-
170-
if __name__ == '__main__':
171-
args = parse_args()
172-
# Execution of the code begins here
173-
create_terraform_exa_infra(args.inputfile, args.outdir, args.service_dir, args.prefix, args.config)

cd3_automation_toolkit/Database/create_terraform_exa_vmclusters.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
#!/usr/bin/python3
22
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#
4-
# This script will produce a Terraform file that will be used to set up OCI core components
4+
# This script will produce a Terraform file that will be used to set up OCI Database
55
# Database EXA
66
#
77
# Author: Kartikey Rajput
88
# Oracle Consulting
99
# Modified (TF Upgrade): Kartikey Rajput
1010
#
11-
12-
import sys
13-
import argparse
1411
import os
1512
from jinja2 import Environment, FileSystemLoader
1613
from oci.config import DEFAULT_LOCATION
@@ -21,19 +18,7 @@
2118
######
2219
# Required Inputs- CD3 excel file, Config file, prefix AND outdir
2320
######
24-
def parse_args():
25-
# Read the arguments
26-
parser = argparse.ArgumentParser(description="Create EXA Home terraform file")
27-
parser.add_argument('inputfile', help='Full Path of input CD3 excel file')
28-
parser.add_argument('outdir', help='Output directory for creation of TF files')
29-
parser.add_argument("service_dir", help="subdirectory under region directory in case of separate out directory structure")
30-
parser.add_argument('prefix', help='TF files prefix')
31-
parser.add_argument('--config', default=DEFAULT_LOCATION, help='Config file name')
32-
33-
return parser.parse_args()
34-
35-
36-
# If input is cd3 file
21+
# Execution of the code begins here
3722
def create_terraform_exa_vmclusters(inputfile, outdir, service_dir, prefix, config=DEFAULT_LOCATION):
3823
filename = inputfile
3924
configFileName = config
@@ -250,9 +235,3 @@ def create_terraform_exa_vmclusters(inputfile, outdir, service_dir, prefix, conf
250235
oname[reg].write(tfStr[reg])
251236
oname[reg].close()
252237
print(outfile[reg] + " for EXA-VMClusters has been created for region " + reg)
253-
254-
255-
if __name__ == '__main__':
256-
args = parse_args()
257-
# Execution of the code begins here
258-
create_terraform_exa_vmclusters(args.inputfile, args.outdir, args.service_dir, args.prefix, args.config)

0 commit comments

Comments
 (0)