Skip to content

Commit 3be5cb6

Browse files
authored
Merge pull request #155 from oracle-devrel/develop
Automation Toolkit Release v2025.2.1
2 parents 0d791c3 + 937c943 commit 3be5cb6

35 files changed

+1544
-932
lines changed
Lines changed: 107 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,121 @@
1-
#!/bin/bash
1+
#cloud-config
2+
runcmd:
3+
- |
4+
echo "Waiting for network..."
5+
until ping -c1 8.8.8.8 >/dev/null 2>&1; do
6+
echo "Network not ready, retrying in 10 seconds..."
7+
sleep 10
8+
done
9+
echo "Network ready, starting..."
10+
username=cd3user
11+
logfile="/$username/mount_path/installToolkit.log"
12+
toolkit_dir="/tmp/githubCode"
13+
mount_dir="/$username/mount_path"
14+
sudo mkdir -p /$mount_dir/tenancies
15+
sudo mkdir -p /$mount_dir/oci_tools
216

3-
username=cd3user
4-
logfile="/$username/mount_path/installToolkit.log"
5-
toolkit_dir="/tmp/githubCode"
6-
mount_dir="/$username/mount_path"
7-
sudo mkdir -p /$mount_dir/tenancies
8-
sudo mkdir -p /$mount_dir/oci_tools
17+
tenancyconfig_properties="/$mount_dir/oci_tools/cd3_automation_toolkit/user-scripts/tenancyconfig.properties"
18+
connectOCI_properties="/$mount_dir/oci_tools/cd3_automation_toolkit/connectOCI.properties"
19+
start=$(date +%s.%N)
20+
sudo sh -c "echo '########################################################################' >> /etc/motd"
21+
sudo sh -c "echo ' Welcome to CD3 Automation Toolkit WorkVM' >> /etc/motd"
22+
sudo sh -c "echo '########################################################################' >> /etc/motd"
23+
sudo sh -c "echo 'Please wait for couple of minutes for container to become active if you' >> /etc/motd"
24+
sudo sh -c "echo 'are logging in for first time to after VM Provisioning. Toolkit initial' >> /etc/motd"
25+
sudo sh -c "echo 'setup log is present at - /cd3user/mount_path/installToolkit.log' >> /etc/motd"
26+
sudo sh -c "echo 'To verify podman container run command: sudo podman ps -a' >> /etc/motd"
27+
sudo sh -c "echo 'To connect to container run command: sudo podman exec -it cd3_toolkit bash' >> /etc/motd"
28+
sudo sh -c "echo 'if you want to stop seeing these messages at login remove in /etc/motd' >> /etc/motd"
29+
sudo sh -c "echo '###########################################################################' >> /etc/motd"
930

10-
tenancyconfig_properties="/$mount_dir/oci_tools/cd3_automation_toolkit/user-scripts/tenancyconfig.properties"
11-
connectOCI_properties="/$mount_dir/oci_tools/cd3_automation_toolkit/connectOCI.properties"
12-
start=$(date +%s.%N)
13-
sudo sh -c "echo '########################################################################' >> /etc/motd"
14-
sudo sh -c "echo ' Welcome to CD3 Automation Toolkit WorkVM' >> /etc/motd"
15-
sudo sh -c "echo '########################################################################' >> /etc/motd"
16-
sudo sh -c "echo 'Please wait for couple of minutes for container to become active if you' >> /etc/motd"
17-
sudo sh -c "echo 'are logging in for first time to after VM Provisioning. Toolkit initial' >> /etc/motd"
18-
sudo sh -c "echo 'setup log is present at - /cd3user/mount_path/installToolkit.log' >> /etc/motd"
19-
sudo sh -c "echo 'To verify podman container run command: sudo podman ps -a' >> /etc/motd"
20-
sudo sh -c "echo 'To connect to container run command: sudo podman exec -it cd3_toolkit bash' >> /etc/motd"
21-
sudo sh -c "echo 'if you want to stop seeing these messages at login remove in /etc/motd' >> /etc/motd"
22-
sudo sh -c "echo '###########################################################################' >> /etc/motd"
31+
stop_exec () {
32+
if [[ $? -ne 0 ]] ; then
33+
echo $? >> $logfile 2>&1
34+
echo "Error encountered in CD3 Automation Toolkit Container Setup. Please do setup Manually" >> $logfile 2>&1
35+
exit 1
36+
fi
37+
}
2338

24-
stop_exec () {
25-
if [[ $? -ne 0 ]] ; then
26-
echo $? >> $logfile 2>&1
27-
echo "Error encountered in CD3 Automation Toolkit Container Setup. Please do setup Manually" >> $logfile 2>&1
28-
exit 1
29-
fi
30-
}
39+
#sudo systemctl stop oracle-cloud-agent.service >> $logfile 2>&1
40+
#cd /etc/yum.repos.d/
41+
#for i in $( ls *.osms-backup ); do sudo mv $i ${i%.*}; done
42+
echo "***SELinux permissive***" >> $logfile 2>&1
43+
sudo setenforce 0
44+
sudo sed -c -i "s/\SELINUX=.*/SELINUX=permissive/" /etc/sysconfig/selinux
3145

32-
#sudo systemctl stop oracle-cloud-agent.service >> $logfile 2>&1
33-
#cd /etc/yum.repos.d/
34-
#for i in $( ls *.osms-backup ); do sudo mv $i ${i%.*}; done
35-
echo "***SELinux permissive***" >> $logfile 2>&1
36-
sudo setenforce 0
37-
sudo sed -c -i "s/\SELINUX=.*/SELINUX=permissive/" /etc/sysconfig/selinux
46+
echo "***cd3user setup***" >> $logfile 2>&1
47+
sudo useradd -u 1001 $username
48+
sudo sh -c "echo $username ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$username"
49+
sudo chmod 0440 /etc/sudoers.d/$username
50+
sudo chmod 775 -R /$username
51+
sudo chown -R $username:$username /$username
52+
sudo usermod -aG $username opc
53+
sudo mkdir -p /home/$username/.ssh
54+
sudo chown -R $username:$username /home/$username/.ssh
55+
sudo chmod 700 /home/$username/.ssh
56+
sudo cp /home/opc/.ssh/authorized_keys /home/$username/.ssh/authorized_keys
57+
sudo chown -R $username:$username /home/$username/.ssh/authorized_keys
58+
sudo chmod 600 /home/$username/.ssh/authorized_keys
3859

39-
echo "***cd3user setup***" >> $logfile 2>&1
40-
sudo useradd -u 1001 $username
41-
sudo sh -c "echo $username ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$username"
42-
sudo chmod 0440 /etc/sudoers.d/$username
43-
sudo chmod 775 -R /$username
44-
sudo chown -R $username:$username /$username
45-
sudo usermod -aG $username opc
46-
sudo mkdir -p /home/$username/.ssh
47-
sudo chown -R $username:$username /home/$username/.ssh
48-
sudo chmod 700 /home/$username/.ssh
49-
sudo cp /home/opc/.ssh/authorized_keys /home/$username/.ssh/authorized_keys
50-
sudo chown -R $username:$username /home/$username/.ssh/authorized_keys
51-
sudo chmod 600 /home/$username/.ssh/authorized_keys
60+
echo "***Install git***" >> $logfile 2>&1
61+
sudo yum --disablerepo=ol7_ksplice --disablerepo=ol8_ksplice --disablerepo=ol8_x86_64_ksplice --disablerepo=ol9_ksplice --disablerepo=ol9_x86_64_ksplice install -y git >> $logfile 2>&1
62+
stop_exec
5263

53-
echo "***Install git***" >> $logfile 2>&1
54-
sudo yum --disablerepo=ol7_ksplice --disablerepo=ol8_ksplice --disablerepo=ol8_x86_64_ksplice --disablerepo=ol9_ksplice --disablerepo=ol9_x86_64_ksplice install -y git >> $logfile 2>&1
55-
stop_exec
64+
echo "***Install Podman***" >> $logfile 2>&1
65+
echo "########################################################" >> $logfile 2>&1
66+
osrelase=`cat /etc/oracle-release`
67+
if [[ $osrelase == "Oracle Linux Server release 7".* ]] ; then
68+
sudo yum --disablerepo=ol7_ksplice install -y podman podman-docker >> $logfile 2>&1
69+
stop_exec
70+
else
71+
sudo yum --disablerepo=ol8_ksplice --disablerepo=ol8_x86_64_ksplice --disablerepo=ol9_ksplice --disablerepo=ol9_x86_64_ksplice install -y podman podman-docker >> $logfile 2>&1
72+
stop_exec
73+
sudo systemctl enable podman.service
74+
sudo systemctl start podman.service
75+
stop_exec
76+
fi
77+
sudo podman --version >> $logfile 2>&1 || true
5678

57-
echo "***Install Podman***" >> $logfile 2>&1
58-
echo "########################################################" >> $logfile 2>&1
59-
osrelase=`cat /etc/oracle-release`
60-
if [[ $osrelase == "Oracle Linux Server release 7".* ]] ; then
61-
sudo yum --disablerepo=ol7_ksplice install -y podman podman-docker >> $logfile 2>&1
62-
stop_exec
63-
else
64-
sudo yum --disablerepo=ol8_ksplice --disablerepo=ol8_x86_64_ksplice --disablerepo=ol9_ksplice --disablerepo=ol9_x86_64_ksplice install -y podman podman-docker >> $logfile 2>&1
65-
stop_exec
66-
sudo systemctl enable podman.service
67-
sudo systemctl start podman.service
79+
echo "***Download Toolkit***" >> $logfile 2>&1
80+
sudo git clone https://github.com/oracle-devrel/cd3-automation-toolkit.git -b develop $toolkit_dir >> $logfile 2>&1
81+
cp -r $toolkit_dir/cd3_automation_toolkit /$mount_dir/oci_tools/
82+
cp -r $toolkit_dir/othertools /$mount_dir/oci_tools/
83+
sudo chown -R $username:$username /$mount_dir/oci_tools/
6884
stop_exec
69-
fi
70-
sudo podman --version >> $logfile 2>&1 || true
71-
72-
echo "***Download Toolkit***" >> $logfile 2>&1
73-
sudo git clone https://github.com/oracle-devrel/cd3-automation-toolkit.git $toolkit_dir >> $logfile 2>&1
74-
cp -r $toolkit_dir/cd3_automation_toolkit /$mount_dir/oci_tools/
75-
cp -r $toolkit_dir/othertools /$mount_dir/oci_tools/
76-
sudo chown -R $username:$username /$mount_dir/oci_tools/
77-
stop_exec
7885

79-
curl -H "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/instance/ -o /tmp/metadata.json
80-
metadata=$(cat /tmp/metadata.json)
81-
user_id=$(echo "$metadata" | jq -r '.metadata.current_user_ocid')
82-
cust_name=$(echo "$metadata" | jq -r '.metadata.tenancy_name')
83-
tenancy_id=$(echo "$metadata" | jq -r '.metadata.tenancy_ocid')
84-
config_region=$(echo "$metadata" | jq -r '.metadata.config_region')
85-
sudo sed -c -i "s/prefix=.*/prefix=$cust_name/" $tenancyconfig_properties
86-
sudo sed -c -i "s/tenancy_ocid=.*/tenancy_ocid=$tenancy_id/" $tenancyconfig_properties
87-
sudo sed -c -i "s/region=.*/region=$config_region/" $tenancyconfig_properties
88-
sudo sed -c -i "s/user_ocid=.*/user_ocid=$user_id/" $tenancyconfig_properties
86+
curl -H "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/instance/ -o /tmp/metadata.json
87+
metadata=$(cat /tmp/metadata.json)
88+
user_id=$(echo "$metadata" | jq -r '.metadata.current_user_ocid')
89+
cust_name=$(echo "$metadata" | jq -r '.metadata.tenancy_name')
90+
tenancy_id=$(echo "$metadata" | jq -r '.metadata.tenancy_ocid')
91+
config_region=$(echo "$metadata" | jq -r '.metadata.config_region')
92+
sudo sed -c -i "s/prefix=.*/prefix=$cust_name/" $tenancyconfig_properties
93+
sudo sed -c -i "s/tenancy_ocid=.*/tenancy_ocid=$tenancy_id/" $tenancyconfig_properties
94+
sudo sed -c -i "s/region=.*/region=$config_region/" $tenancyconfig_properties
95+
sudo sed -c -i "s/user_ocid=.*/user_ocid=$user_id/" $tenancyconfig_properties
8996

90-
sudo sed -c -i "s/prefix=.*/prefix=$cust_name/" $connectOCI_properties
91-
sudo sed -c -i "s/tenancy_ocid=.*/tenancy_ocid=$tenancy_id/" $connectOCI_properties
92-
sudo sed -c -i "s/region=.*/region=$config_region/" $connectOCI_properties
93-
sudo sed -c -i "s/user_ocid=.*/user_ocid=$user_id/" $connectOCI_properties
97+
sudo sed -c -i "s/prefix=.*/prefix=$cust_name/" $connectOCI_properties
98+
sudo sed -c -i "s/tenancy_ocid=.*/tenancy_ocid=$tenancy_id/" $connectOCI_properties
99+
sudo sed -c -i "s/region=.*/region=$config_region/" $connectOCI_properties
100+
sudo sed -c -i "s/user_ocid=.*/user_ocid=$user_id/" $connectOCI_properties
94101

95-
echo "***Building container image***" >> $logfile 2>&1
96-
cd /tmp
97-
cd githubCode
98-
sudo podman build --platform linux/amd64 -t cd3_toolkit -f Dockerfile --pull --no-cache . >> $logfile 2>&1
99-
stop_exec
100-
sudo podman images >> $logfile 2>&1
102+
echo "***Building container image***" >> $logfile 2>&1
103+
cd /tmp
104+
cd githubCode
105+
sudo podman build --platform linux/amd64 -t cd3_toolkit -f Dockerfile --pull --no-cache . >> $logfile 2>&1
106+
stop_exec
107+
sudo podman images >> $logfile 2>&1
101108

102-
echo "***Setting Up podman Container***" >> $logfile 2>&1
103-
sudo podman run --name cd3_toolkit -it -p 8443:8443 -d -v /cd3user/mount_path:/cd3user cd3_toolkit bash >> $logfile 2>&1
104-
stop_exec
105-
sudo podman ps -a >> $logfile 2>&1
106-
echo "Connect to Container using command - sudo podman exec -it cd3_toolkit bash " >> $logfile 2>&1
109+
echo "***Setting Up podman Container***" >> $logfile 2>&1
110+
sudo podman run --name cd3_toolkit -it -p 8443:8443 -d -v /cd3user/mount_path:/cd3user cd3_toolkit bash >> $logfile 2>&1
111+
stop_exec
112+
sudo podman ps -a >> $logfile 2>&1
113+
echo "Connect to Container using command - sudo podman exec -it cd3_toolkit bash " >> $logfile 2>&1
107114

108-
#sudo systemctl start oracle-cloud-agent.service
115+
#sudo systemctl start oracle-cloud-agent.service
109116

110-
duration_sec=$(echo "$(date +%s.%N) - $start" | bc)
111-
duration_min=$(echo "$duration_sec%3600/60" | bc)
112-
execution_time=`printf "%.2f seconds" $duration_sec`
113-
echo "Script Execution Time in Seconds: $execution_time" >> $logfile 2>&1
114-
echo "Script Execution Time in Minutes: approx $duration_min Minutes" >> $logfile 2>&1
117+
duration_sec=$(echo "$(date +%s.%N) - $start" | bc)
118+
duration_min=$(echo "$duration_sec%3600/60" | bc)
119+
execution_time=`printf "%.2f seconds" $duration_sec`
120+
echo "Script Execution Time in Seconds: $execution_time" >> $logfile 2>&1
121+
echo "Script Execution Time in Minutes: approx $duration_min Minutes" >> $logfile 2>&1

OCIWorkVMStack/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
terraform {
22

3-
required_version = "~> 1.2.0, < 1.3.0"
3+
required_version = ">= 1.5.0"
44
required_providers {
55
oci = {
66
version = ">= 4.21.0"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<br>
99

10-
[What's New](https://github.com/oracle-devrel/cd3-automation-toolkit/releases/tag/v2025.2.0) &nbsp;&nbsp;[Excel Templates](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/excel-templates/) &nbsp;&nbsp;[CD3 Docs](https://oracle-devrel.github.io/cd3-automation-toolkit/)&nbsp;&nbsp; [Watch & Learn](https://www.youtube.com/playlist?list=PLPIzp-E1msrbJ3WawXVhzimQnLw5iafcp) &nbsp;&nbsp;[Blogs & Tutorials](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/tutorials/) &nbsp;&nbsp;[Livelabs](https://apexapps.oracle.com/pls/apex/f?p=133:180:112501098061930::::wid:3724) &nbsp;&nbsp;[Slack Channel](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/queries)
10+
[What's New](https://github.com/oracle-devrel/cd3-automation-toolkit/releases/tag/v2025.2.1) &nbsp;&nbsp;[Excel Templates](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/excel-templates/) &nbsp;&nbsp;[CD3 Docs](https://oracle-devrel.github.io/cd3-automation-toolkit/)&nbsp;&nbsp; [Watch & Learn](https://www.youtube.com/playlist?list=PLPIzp-E1msrbJ3WawXVhzimQnLw5iafcp) &nbsp;&nbsp;[Blogs & Tutorials](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/tutorials/) &nbsp;&nbsp;[Livelabs](https://apexapps.oracle.com/pls/apex/f?p=133:180:112501098061930::::wid:3724) &nbsp;&nbsp;[Slack Channel](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/queries)
1111

1212
<br>
1313

cd3_automation_toolkit/Release-Notes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
-------------------------------------
2+
CD3 Automation Toolkit Tag v2025.2.1
3+
Dec 26th, 2025
4+
-------------------------------------
5+
1. Support custom domain user for connecting the container to cloud while running connectCloud.py for OCI.
6+
2. Added support for X11 ExaInfra.
7+
3. Fixed ordering issue for agent plugins during instance export. Please use latest excel sheet corresponding to this release.
8+
4. Fixed attachment of routing policy to the load balancer listener.
9+
5. Minor bug fixes wrt SDDCs, Policies, jenkins warnings and other scripts.
10+
6. Updated CIS Compliance check script as per latest version available.
11+
112
-------------------------------------
213
CD3 Automation Toolkit Tag v2025.2.0
314
Oct 10th, 2025

cd3_automation_toolkit/connectCloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def main():
66
if len(sys.argv) != 3:
77
print("Usage: python connectCloud.py <cloud_provider> <properties_file_path>")
8-
print("Example: python connectCloud.py oci tenancyconfig.properties")
8+
print("Example: python connectCloud.py oci connectOCI.properties")
99
print("Example: python connectCloud.py azure connectAzure.properties")
1010
return
1111

cd3_automation_toolkit/connectOCI.properties

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ssh_public_key=
5959
##################################################################################################################
6060

6161

62-
# Compartment OCID where Bucket and DevOps Project/repo will be created; defaults to root if left empty.
62+
# Compartment Name/OCID where Bucket and DevOps Project/repo will be created; defaults to root if left empty.
6363
compartment_ocid=
6464

6565
# Remote state configuration
@@ -84,8 +84,12 @@ oci_devops_git_repo_name=
8484
# or session_token
8585
# Customer Secret Key will be created for this user for S3 credentials of the bucket.
8686
# When left empty, it will be fetched from $(user_ocid) for $(auth_mechanism) as api_key.
87-
# Format: <domainName>/<userName>@<tenancyName> eg oracleidentitycloudservice/[email protected]@ocitenant
88-
# Users in Custom Domain are not supported as of now.
87+
88+
# Format: <domainName>/<userName>@<tenancyName>
89+
# eg oracleidentitycloudservice/[email protected]@ocitenant - if it is not Identity Domain Tenancy
90+
# eg custom_domain/[email protected]@ocitenant if user is in Custom Domain in Identity Domain Tenancy
91+
# eg [email protected]@ocitenant - if user is in Default Domain in Identity Domain Tenancy
92+
8993
oci_devops_git_user=
9094

9195
# When left empty, same key file from $(key_path) used for $(auth_mechanism) as api_key will be copied to
-2.67 KB
Binary file not shown.
Binary file not shown.
-2.76 KB
Binary file not shown.
-2.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)