This is an automated email from the ASF dual-hosted git repository.
zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 51345aad56 t3c remove perl dependency and references (#7829)
51345aad56 is described below
commit 51345aad56f816ba35be5c090561e5bc524d8aec
Author: Joe Pappano <[email protected]>
AuthorDate: Thu Oct 19 15:20:09 2023 -0400
t3c remove perl dependency and references (#7829)
* removed perl scripts no longer needed
* removed references to traffic_ops_ort and supermicro_udev_rules
* removed perl dependency
* updated CHANGELOG.md
* removed if clauses
---
CHANGELOG.md | 1 +
cache-config/build/build_rpm.sh | 2 -
.../build/trafficcontrol-cache-config.spec | 5 -
cache-config/supermicro_udev_mapper.pl | 81 -----------
cache-config/traffic_ops_ort.pl | 153 ---------------------
infrastructure/ansible/roles/ats/defaults/main.yml | 14 +-
infrastructure/ansible/roles/ats/tasks/ats.yml | 24 +---
.../ansible/roles/dataset_loader/defaults/main.yml | 6 -
infrastructure/ansible/roles/grove/tasks/grove.yml | 7 -
9 files changed, 4 insertions(+), 289 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc724e7433..ef959871ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -199,6 +199,7 @@ The format is based on [Keep a
Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7271](https://github.com/apache/trafficcontrol/pull/7271) Removed
`misc/jira_github_issue_import.py`, the project does not use JIRA.
- [#7271](https://github.com/apache/trafficcontrol/pull/7271) Removed
`traffic_ops/install/bin/convert_profile/`, this script is outdated and is for
use on an EOL ATS version.
- [#7271](https://github.com/apache/trafficcontrol/pull/7271) Removed
`traffic_ops/install/bin/install_go.sh`,
`traffic_ops/install/bin/todb_bootstrap.sh` and
`traffic_ops/install/bin/install_goose.sh` are no longer in use.
+- [#7829](https://github.com/apache/trafficcontrol/pull/7829) Removed
`cache-config/supermicro_udev_mapper.pl` and `traffic_ops_ort.pl` and any
references
## [7.0.0] - 2022-07-19
### Added
diff --git a/cache-config/build/build_rpm.sh b/cache-config/build/build_rpm.sh
index 5aa82fb9a9..9db0ebf203 100755
--- a/cache-config/build/build_rpm.sh
+++ b/cache-config/build/build_rpm.sh
@@ -127,8 +127,6 @@ initBuildArea() {
buildManpage 't3c-preprocess';
)
- cp -p traffic_ops_ort.pl "$dest";
- cp -p supermicro_udev_mapper.pl "$dest";
mkdir -p "${dest}/build";
echo "build_rpm.sh lsing for logrotate";
diff --git a/cache-config/build/trafficcontrol-cache-config.spec
b/cache-config/build/trafficcontrol-cache-config.spec
index 456b3af9dd..e3176c402e 100644
--- a/cache-config/build/trafficcontrol-cache-config.spec
+++ b/cache-config/build/trafficcontrol-cache-config.spec
@@ -143,9 +143,6 @@ mkdir -p
"${RPM_BUILD_ROOT}"/var/log/trafficcontrol-cache-config
mkdir -p ${RPM_BUILD_ROOT}/"$mandir"/"$man1dir"
mkdir -p ${RPM_BUILD_ROOT}/usr/lib/systemd/system
-cp -p
${RPM_SOURCE_DIR}/trafficcontrol-cache-config-%{version}/traffic_ops_ort.pl
${RPM_BUILD_ROOT}/"$installdir"
-cp -p
${RPM_SOURCE_DIR}/trafficcontrol-cache-config-%{version}/supermicro_udev_mapper.pl
${RPM_BUILD_ROOT}/"$installdir"
-
src=src/github.com/apache/trafficcontrol/cache-config
cp -p
${RPM_SOURCE_DIR}/trafficcontrol-cache-config-%{version}/build/atstccfg.logrotate
"${RPM_BUILD_ROOT}"/etc/logrotate.d/atstccfg
touch ${RPM_BUILD_ROOT}/var/log/trafficcontrol-cache-config/atstccfg.log
@@ -225,8 +222,6 @@ fi
%files
%license LICENSE
%attr(755, root, root)
-/usr/bin/traffic_ops_ort.pl
-/usr/bin/supermicro_udev_mapper.pl
/usr/bin/t3c
/usr/bin/t3c-apply
/usr/bin/t3c-check
diff --git a/cache-config/supermicro_udev_mapper.pl
b/cache-config/supermicro_udev_mapper.pl
deleted file mode 100755
index efaecb51d7..0000000000
--- a/cache-config/supermicro_udev_mapper.pl
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/perl
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-use strict;
-use warnings;
-
-$| = 1;
-
-my $udevadm = "/sbin/udevadm";
-my $kernel_device = shift(@ARGV);
-
-if (!defined($kernel_device)) {
- die("Please specify a device");
-}
-
-if (! -x $udevadm) {
- die("$udevadm: $!");
-}
-
-# udevadm info --export-db |grep block |grep expander |egrep '^P'
-# ...
-# P:
/devices/pci0000:80/0000:80:01.0/0000:81:00.0/host2/port-2:0/expander-2:0/port-2:0:7/end_device-2:0:7/target2:0:7/2:0:7:0/block/sdbd
-# P:
/devices/pci0000:80/0000:80:01.0/0000:81:00.0/host2/port-2:0/expander-2:0/port-2:0:8/end_device-2:0:8/target2:0:8/2:0:8:0/block/sdbe
-# P:
/devices/pci0000:80/0000:80:01.0/0000:81:00.0/host2/port-2:0/expander-2:0/port-2:0:9/end_device-2:0:9/target2:0:9/2:0:9:0/block/sdbf
-# ...
-
-my @out = `/sbin/udevadm info --export-db`;
-my $devices = {};
-
-for my $line (@out) {
- chomp($line);
- next unless ($line =~ /^P: .*$/ && $line =~ /block/ && $line =~
/expander/);
-
- my (undef, $device) = split(/^P: /, $line, 2);
- my @path_parts = split(/\//, $device);
- my $disk = pop(@path_parts);
- pop(@path_parts);
- my $path_ids = pop(@path_parts);
- my @target_parts = split(/:/, $path_ids);
-
-
$devices->{$target_parts[0]}->{$target_parts[1]}->{$target_parts[2]}->{$target_parts[3]}
= $disk;
-}
-
-my $matched = 0;
-my $oa = 0;
-
-for my $da (sort { $a <=> $b } (keys(%{$devices}))) {
- my $ob = 0;
- for my $db (sort { $a <=> $b } (keys(%{$devices->{$da}}))) {
- for my $dc (sort { $a <=> $b }
(keys(%{$devices->{$da}->{$db}}))) {
- for my $dd (sort { $a <=> $b }
(keys(%{$devices->{$da}->{$db}->{$dc}}))) {
- if ($kernel_device eq
$devices->{$da}->{$db}->{$dc}->{$dd}) {
- printf("%d-%d-%02d\n", $oa, $ob, $dc);
- $matched = 1;
- last;
- }
- }
-
- last if ($matched);
- }
-
- last if ($matched);
- $ob++;
- }
-
- last if ($matched);
- $oa++;
-}
diff --git a/cache-config/traffic_ops_ort.pl b/cache-config/traffic_ops_ort.pl
deleted file mode 100755
index 2c35f6a42e..0000000000
--- a/cache-config/traffic_ops_ort.pl
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/perl
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-use Getopt::Long;
-
-my $dispersion = undef;
-my $retries = 5;
-my $wait_for_parents = 1;
-my $login_dispersion = 0;
-my $reval_wait_time = 60;
-my $reval_in_use = 0;
-my $rev_proxy_disable = 0;
-my $skip_os_check = 0;
-my $override_hostname_short = '';
-my $to_timeout_ms = 30000;
-my $syncds_updates_ipallow = 0;
-my $traffic_ops_insecure = 0;
-my $via_string_release = 0;
-my $dns_local_bind = 0;
-my $disable_parent_config_comments = 0;
-
-print "ERROR traffic_ops_ort.pl is deprecated and will be removed in the next
major version! Please upgrade to t3c\n";
-
-GetOptions( "dispersion=i" => \$dispersion, # dispersion (in seconds)
- "retries=i" => \$retries,
- "wait_for_parents=i" => \$wait_for_parents,
- "login_dispersion=i" => \$login_dispersion,
- "rev_proxy_disable=i" => \$rev_proxy_disable,
- "skip_os_check=i" => \$skip_os_check,
- "override_hostname_short=s" => \$override_hostname_short,
- "to_timeout_ms=i" => \$to_timeout_ms,
- "syncds_updates_ipallow=i" => \$syncds_updates_ipallow,
- "traffic_ops_insecure=i" => \$traffic_ops_insecure,
- "via_string_release=i" => \$via_string_release,
- "dns_local_bind=i" => \$dns_local_bind,
- "disable_parent_config_comments=i" =>
\$disable_parent_config_comments,
- );
-
-my $cmd = 't3c apply -vv';
-
-if ( defined $dispersion ) {
- my $sleeptime = rand($dispersion);
- print "ERROR t3c no longer has a dispersion feature, Please upgrade to
t3c, and use shell commands to randomly sleep if necessary. Sleeping for
rand($dispersion)=$sleeptime\n";
- sleep($sleeptime);
-}
-if ( defined $retries ) {
- $cmd .= ' --num-retries=' . $retries;
-}
-if ( defined $wait_for_parents && $wait_for_parents == 0 ) {
- $cmd .= ' --wait-for-parents=false';
-}
-if ( defined $login_dispersion ) {
- my $sleeptime = rand($login_dispersion);
- print "ERROR t3c no longer has any dispersion feature, Please upgrade
to t3c, and use shell commands to randomly sleep if necessary. Sleeping for
rand($login_dispersion)=$sleeptime\n";
- sleep($sleeptime);
-}
-if ( defined $rev_proxy_disable && $rev_proxy_disable == 1 ) {
- $cmd .= ' --rev-proxy-disable=true';
-}
-if ( defined $skip_os_check ) {
- $cmd .= ' --skip-os-check=' . $skip_os_check;
-}
-if ( defined $override_hostname_short ) {
- $cmd .= ' --cache-host-name=' . $override_hostname_short;
-} else {
- $cmd .= ' --cache-host-name=' . `hostname -s`;
-}
-if ( defined $to_timeout_ms ) {
- $cmd .= ' --traffic-ops-timeout-milliseconds=' . $to_timeout_ms;
-}
-if ( $syncds_updates_ipallow == 1 ) {
- $cmd .= ' --syncds-updates-ipallow=true';
-}
-if ( defined $traffic_ops_insecure ) {
- $cmd .= ' --traffic-ops-insecure=' . $traffic_ops_insecure;
-}
-if ( $via_string_release != 1 ) {
- $cmd .= ' --omit-via-string-release=true';
-}
-if ( $dns_local_bind == 1 ) {
- $cmd .= ' --dns-local-bind=true';
-}
-if ( $disable_parent_config_comments == 1 ) {
- $cmd .= ' --disable-parent-config-comments=true';
-}
-
-my $mode = $ARGV[0];
-if ( defined $mode ) {
- $cmd .= ' --run-mode=' . $mode;
-}
-if ( defined( $ARGV[2] ) ) {
- my $to_url = $ARGV[2];
- $to_url =~ s/\/*$//g;
- $cmd .= ' --traffic-ops-url=' . $to_url;
-}
-if ( defined( $ARGV[3] ) ) {
- my ( $to_user, $to_pass ) = split( /:/, $ARGV[3] );
- $cmd .= ' --traffic-ops-user=' . $to_user;
- $cmd .= ' --traffic-ops-password=' . $to_pass;
-}
-else {
- &usage();
- exit 1;
-}
-
-sub usage {
- print
"====-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-====\n";
- print "Usage: ./traffic_ops_ort.pl <Mode> <Log_Level> <Traffic_Ops_URL>
<Traffic_Ops_Login> [optional flags]\n";
- print "Usage: ./traffic_ops_ort.pl <Mode> <Log_Level> <Traffic_Ops_URL>
<Traffic_Ops_Login> [optional flags]\n";
- print "\t<Mode> = interactive - asks questions during config
process.\n";
- print "\t<Mode> = report - prints config differences and exits.\n";
- print "\t<Mode> = badass - attempts to fix all config differences that
it can.\n";
- print "\t<Mode> = syncds - syncs delivery services with what is
configured in Traffic Ops.\n";
- print "\t<Mode> = revalidate - checks for updated revalidations in
Traffic Ops and applies them. Requires Traffic Ops 2.1.\n";
- print "\n";
- print "\t<Log_Level> => ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL,
NONE\n";
- print "\n";
- print "\t<Traffic_Ops_URL> = URL to Traffic Ops host. Example:
https://trafficops.company.net\n";
- print "\n";
- print "\t<Traffic_Ops_Login> => Example: 'username:password' \n";
- print "\n\t[optional flags]:\n";
- print "\t dispersion=<time> => wait a random number
between 0 and <time> before starting. Default = 300.\n";
- print "\t login_dispersion=<time> => wait a random number
between 0 and <time> before login. Default = 0.\n";
- print "\t retries=<number> => retry connection to
Traffic Ops URL <number> times. Default = 3.\n";
- print "\t wait_for_parents=<0|1> => do not update if
parent_pending = 1 in the update json. Default = 1, wait for parents.\n";
- print "\t rev_proxy_disable=<0|1> => bypass the reverse proxy
even if one has been configured Default = 0.\n";
- print "\t skip_os_check=<0|1> => bypass the check for a
supported CentOS version. Default = 0.\n";
- print "\t override_hostname_short=<text> => override the short
hostname of the OS for config generation. Default = ''.\n";
- print "\t to_timeout_ms=<time> => the Traffic Ops request
timeout in milliseconds. Default = 30000 (30 seconds).\n";
- print "\t syncds_updates_ipallow=<0|1> => Update ip_allow.config in
syncds mode, which may trigger an ATS bug blocking random addresses on load!
Default = 0, only update on badass and restart.\n";
- print "\t traffic_ops_insecure=<0|1> => Turns off certificate
checking when connecting to Traffic Ops.\n";
- print "\t via_string_release=<0|1> => change the ATS via string
to be the rpm release instead of the actual ATS version number\n";
- print "\t dns_local_bind=<0|1> => set the server service
addresses to the ATS config dns local bind address\n";
- print "\t disable_parent_config_comments=<0|1> => do not write
line comments to the parent.config file\n";
- print
"====-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-====\n";
- exit 1;
-}
-
-exec ("$cmd");
diff --git a/infrastructure/ansible/roles/ats/defaults/main.yml
b/infrastructure/ansible/roles/ats/defaults/main.yml
index 16c89fca44..ba38627ff0 100644
--- a/infrastructure/ansible/roles/ats/defaults/main.yml
+++ b/infrastructure/ansible/roles/ats/defaults/main.yml
@@ -38,20 +38,10 @@ ort_crontab:
syncds:
schedule: '0,20,40 * * * *'
user: root
- job: >-
- {%- if ort_version is not defined or ort_version == omit or ort_version
>= '6.0.0-11351' -%}
- t3c apply --run-mode=syncds --cache-host-name='{{
(ansible_nodename.split('.')) | first }}' -vv --traffic-ops-url='{{
ort_traffic_ops_url }}' --traffic-ops-user='{{ ort_traffic_ops_username }}'
--traffic-ops-password='{{ ort_traffic_ops_password }}' &>
/tmp/trafficcontrol-cache-config/syncds.log
- {%- else -%}
- traffic_ops_ort.pl syncds warn {{ ort_traffic_ops_url }} '{{
ort_traffic_ops_username }}:{{ ort_traffic_ops_password }}'
--login_dispersion=35 --dispersion=420 &>/tmp/ort/syncds.log
- {%- endif -%}
+ job: "t3c apply --run-mode=syncds --cache-host-name='{{
(ansible_nodename.split('.')) | first }}' -vv --traffic-ops-url='{{
ort_traffic_ops_url }}' --traffic-ops-user='{{ ort_traffic_ops_username }}'
--traffic-ops-password='{{ ort_traffic_ops_password }}' &>
/tmp/trafficcontrol-cache-config/syncds.log"
# Perform a check for user requested content invalidations every minute
reval:
schedule: '1-19,21-39,41-59 * * * *'
user: root
- job: >-
- {%- if ort_version is not defined or ort_version == omit or ort_version
>= '6.0.0-11351' -%}
- t3c apply --run-mode=revalidate --cache-host-name='{{
(ansible_nodename.split('.')) | first }}' -vv --traffic-ops-url='{{
ort_traffic_ops_url }}' --traffic-ops-user='{{ ort_traffic_ops_username }}'
--traffic-ops-password='{{ ort_traffic_ops_password }}' &>
/tmp/trafficcontrol-cache-config/reval.log
- {%- else -%}
- traffic_ops_ort.pl revalidate warn {{ ort_traffic_ops_url }} '{{
ort_traffic_ops_username }}:{{ ort_traffic_ops_password }}'
--login_dispersion=35 &>/tmp/ort/reval.log
- {%- endif -%}
+ job: "t3c apply --run-mode=revalidate --cache-host-name='{{
(ansible_nodename.split('.')) | first }}' -vv --traffic-ops-url='{{
ort_traffic_ops_url }}' --traffic-ops-user='{{ ort_traffic_ops_username }}'
--traffic-ops-password='{{ ort_traffic_ops_password }}' &>
/tmp/trafficcontrol-cache-config/reval.log"
ats_clear_data: false
diff --git a/infrastructure/ansible/roles/ats/tasks/ats.yml
b/infrastructure/ansible/roles/ats/tasks/ats.yml
index 46e7714118..84d9e0429b 100644
--- a/infrastructure/ansible/roles/ats/tasks/ats.yml
+++ b/infrastructure/ansible/roles/ats/tasks/ats.yml
@@ -22,23 +22,6 @@
retries: 5
delay: 5
-- name: Deploy the udev device mapper script to a more reliable location
- # with /opt on separate lvm part, udev on boot may fail
- copy:
- remote_src: true
- src: >-
- {%- if ort_version is not defined or ort_version == omit or ort_version
>= '6.0.0-11351' -%}
- /usr/bin/supermicro_udev_mapper.pl
- {%- else -%}
- /opt/ort/supermicro_udev_mapper.pl
- {%- endif -%}
- dest: /bin/supermicro_udev_mapper.pl
- remote_src: true
- owner: root
- group: root
- mode: 0755
- ignore_errors: true
-
- name: Deploy ORT/t3c Crontab
template:
src: crontab.j2
@@ -66,12 +49,7 @@
- name: Run ORT Badass
shell:
executable: "{{ lookup('pipe','command -v bash') }}"
- cmd: >-
- {%- if ort_version is not defined or ort_version == omit or ort_version
>= '6.0.0-11351' -%}
- pkill -9 t3c || true; t3c apply --run-mode=badass --git=yes
--cache-host-name='{{ (ansible_nodename.split('.')) | first }}' -vv
--traffic-ops-url='{{ ort_traffic_ops_url }}' --traffic-ops-user='{{
ort_traffic_ops_username }}' --traffic-ops-password='{{
ort_traffic_ops_password }}' --wait-for-parents=false 2>&1 | tee
/tmp/trafficcontrol-cache-config/badass_out; exit ${PIPESTATUS[0]}
- {%- else -%}
- pkill -9 _ort || true; traffic_ops_ort.pl -dispersion=0
--wait_for_parents=0 --login_dispersion=0 --retries=1 badass warn {{
ort_traffic_ops_url }} '{{ ort_traffic_ops_username }}:{{
ort_traffic_ops_password }}' 2>&1 | tee /tmp/badass_out; exit ${PIPESTATUS[0]}
- {%- endif -%}
+ cmd: "pkill -9 t3c || true; t3c apply --run-mode=badass --git=yes
--cache-host-name='{{ (ansible_nodename.split('.')) | first }}' -vv
--traffic-ops-url='{{ ort_traffic_ops_url }}' --traffic-ops-user='{{
ort_traffic_ops_username }}' --traffic-ops-password='{{
ort_traffic_ops_password }}' --wait-for-parents=false 2>&1 | tee
/tmp/trafficcontrol-cache-config/badass_out; exit ${PIPESTATUS[0]}"
no_log: True
- name: Reboot
diff --git a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml
b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml
index 734719168c..990510a698 100644
--- a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml
+++ b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml
@@ -830,12 +830,6 @@ dl_ds_default_profile_layers:
value: INT 500
mid:
common:
- - name: location
- configFile: 40-ats.rules
- value: "/etc/udev/rules.d/"
- - name: udev_syncds
- configFile: 40-ats.rules
- value: 'KERNEL==\"sd*\", DRIVERS==\"mpt3sas\",
PROGRAM=\"/bin/supermicro_udev_mapper.pl %k\", SYMLINK+=\"ats/%c\",
OWNER=\"ats\"'
- name: weight
configFile: parent.config
value: '1.0'
diff --git a/infrastructure/ansible/roles/grove/tasks/grove.yml
b/infrastructure/ansible/roles/grove/tasks/grove.yml
index a73c5bc722..a9922bc262 100644
--- a/infrastructure/ansible/roles/grove/tasks/grove.yml
+++ b/infrastructure/ansible/roles/grove/tasks/grove.yml
@@ -42,13 +42,6 @@
path: /opt/ort
state: directory
-- name: Create an empty ORT file
- copy:
- dest: "/opt/ort/traffic_ops_ort.pl"
- content: |
- #!/usr/bin/perl
- # empty for Grove, prevents systems previously running ORT from
overriding TO Update Flag
-
- name: Create an empty t3c file
copy:
dest: "/usr/bin/t3c"