You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/04/23 21:59:15 UTC

[GitHub] [trafficcontrol] rob05c opened a new pull request #5781: Deprecate ort.pl, change to proxy t3c

rob05c opened a new pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781


   Also adds the arguments to t3c that ort had but t3c didn't.
   Also fixes t3c to log atstccfg stderr logs instead of dropping them.
   
   Includes changlog.
   No docs, no interface change. Includes ort readme and changelog documenting its deprecation.
   No new tests, no interface change, changes to existing arguments are covered by `traffic_ops_ort.pl` and `t3c` integration tests.
   
   - [x] This PR is not related to any other Issue
   
   ## Which Traffic Control components are affected by this PR?
   - Traffic Ops ORT
   
   ## What is the best way to verify this PR?
   Run tests. Run ort, verify behavior is unchanged.
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   Not a bug fix.
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [ ] This PR includes tests OR I have explained why tests are unnecessary
   - [ ] This PR includes documentation OR I have explained why documentation is unnecessary
   - [ ] This PR includes an update to CHANGELOG.md OR such an update is not necessary
   - [ ] This PR includes any and all required license headers
   - [ ] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   
   ## Additional Information
   <!-- If you would like to include any additional information on the PR for
   potential reviewers please put it here.
   
   Some examples of this would be:
   
   - Before and after screenshots/gifs of the Traffic Portal if it is affected
   - Links to other dependent Pull Requests
   - References to relevant context (e.g. new/updates to dependent libraries,
   mailing list records, blueprints)
   
   Feel free to leave this section blank (or, preferably, delete it entirely).
   -->
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you 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.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-836963754


   Fixed merge conflicts.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-826968983


   Are we able to run `t3c` in CiaB instead of `ORT.py`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] jrushford commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
jrushford commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r625896461



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -216,6 +219,11 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
+

Review comment:
       t3c has a Usage function in config/config.go and the function should be updated to reflect these 3 new options.  Currently t3c -h doesn't show them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619517828



##########
File path: traffic_ops_ort/README.md
##########
@@ -1,105 +1,3 @@
 # ORT
 
-ORT, traffic_ops_ort.pl, is used to apply configuration from Traffic Control, stored in Traffic Ops, to the cache.
-
-Typical usage is to install ORT on the cache machine, and then run it periodically via a CRON job.
-
-## Options
-
-ORT has the following command-line options:
-
-
-option                  | default | description
------------------------ | ------- | ---
-dispersion              | 300     | wait a random number of seconds between 0 and <time> before starting.
-retries                 | 5       | retry connection to Traffic Ops URL <number> times.
-wait_for_parents        | 1       | do not update if parent_pending = 1 in the update json.
-login_dispersion        | 0       | wait a random number of seconds between 0 and <time> before login.
-rev_proxy_disable       | 0       | bypass the reverse proxy even if one has been configured.
-skip_os_check           | 0       | bypass the check for a supported CentOS version.
-override_hostname_short | ""      | override the short hostname of the OS for config generation.
-
-# Modes
-
-ORT can be run in a number of modes.
-
-The syncds mode is the normal mode of operation, which should typically be run periodically via cron or a similar tool.
-
-The badass mode is typically an emergency-fix mode, which will override and replace all files with the configuration generated from the current Traffic Ops data, regardless whether ORT (presumably incorrectly) thinks the files need updating or not. It is recommended to run this mode when something goes wrong, and the configuration on the cache is incorrect, and the data in Traffic Ops and config generation is believed to be correct. It is not recommended to run this in normal operation; use syncds mode for normal operation.
-
-The revalidate mode will apply Revalidations from Traffic Ops (regex_revalidate.config) but no other configuration. This mode was intended to quickly apply revalidations when ORT took a long time to run. It is less relevant with ORT's current speed, but may still be useful on slow networks or very large deployments.
-
-mode        | description
-------------| ---
-interactive | asks questions during config process
-report      | prints config differences and exits
-badass      | attempts to fix all config differences that it can
-syncds      | syncs delivery services with what is configured in Traffic Ops
-revalidate  | checks for updated revalidations in Traffic Ops and applies them
-
-# Behavior
-
-When ORT is run, it will:
-
-1. Delete all of its temporary directories over a week old. Currently, the base temp directory is hard-coded to /tmp/ort.
-1. Determine if Updates have been Queued on the server (by checking the Server's Update Pending or Revalidate Pending flag in Traffic Ops).
-    1. If Updates were not queued and the script is running in syncds mode (the normal mode), exit.
-1. Get the config files from Traffic Ops, via atstccfg.
-1. Process CentOS Yum packages.
-    1. These are specified via Parameters on the Server's Profile, with the Config File 'package', where the Parameter Name is the package name, and the Parameter Value is the package version.
-    1. Uninstall any packages which are installed but whose version does not match.
-    1. Install all packages in the Server Profile.
-1. Process chkconfig directives.
-    1. These are specified via Parameters on the Server's Profile, with the Config File 'chkconfig', where the Parameter Name is the package name, and the Parameter Value is the chkconfig directive line.
-    1. All chkconfig directives in the Server's Profile are applied to the CentOS chkconfig.
-    1. **NOTE** the default profiles distributed by Traffic Control have an ATS chkconfig with a runlevel before networking is enabled, which is likely incorrect.
-    1. **NOTE** this is not used by CentOS 7+ and ATS 7+. SystemD does not use chkconfig, and ATS 7+ uses a SystemD script not an init script.
-1. Process each config file
-    1. If ORT is in revalidate mode, this will only be regex_revalidate.config
-    1. Perform any special processing. See [Special Processing](#special-processing).
-    1. If a file exists at the path of the file, load it from disk and compare the two.
-    1. If there are no changes, don't apply the new file.
-    1. If there are changes, backup the existing file in the temp directory, and write the new file.
-1. If configuration was changed which requires an ATS reload to apply, perform a service reload of ATS.
-1. If configuration was changed which requires an ATS restart to apply, and ORT is in badass mode, perform a service restart of ATS.
-1. If a sysctl.conf config file was changed, and ORT is in badass mode, run `sysctl -p`.
-1. If a ntpd.conf config file was changed, and ORT is in badass mode, perform a service restart of ntpd.
-1. Update Traffic Ops to unset the Update Pending or Revalidate Pending flag of this Server.
-
-# Special Processing
-
-Certain config files perform extra processing.
-
-## Global replacements
-
-All config files have certain text directives replaced. This is done by the atstccfg config generator before the file is returned to ORT.
-
-* `__SERVER_TCP_PORT__` is replaced with the Server's Port from Traffic Ops; unless the server's port is 80, 0, or null, in which case any occurrences preceded by a colon are removed.
-* `__CACHE_IPV4__` is replaced with the Server's IP address from Traffic Ops.
-* `__HOSTNAME__` is replaced with the Server's (short) HostName from Traffic Ops.
-* `__FULL_HOSTNAME__` is replaced with the Server's HostName, a dot, and the Server's DomainName from Traffic Ops (i.e. the Server's Fully Qualified Domain Name).
-* `__RETURN__` is replaced with a newline character, and any whitespace before or after it is removed.
-
-## remap.config
-
-ORT processes `##OVERRIDE##` directives in the remap.config file.
-
-The ##OVERRIDE## template string allows the Delivery Service Raw Remap Text field to override to fully override the Delivery Service’s line in the remap.config ATS configuration file, generated by Traffic Ops. The end result is the original, generated line commented out, prepended with ##OVERRIDDEN## and the ##OVERRIDE## rule is activated in its place. This behavior is used to incrementally deploy plugins used in this configuration file. Normally, this entails cloning the Delivery Service that will have the plugin, ensuring it is assigned to a subset of the cache servers that serve the Delivery Service content, then using this ##OVERRIDE## rule to create a remap.config rule that will use the plugin, overriding the normal rule. Simply grow the subset over time at the desired rate to slowly deploy the plugin. When it encompasses all cache servers that serve the original Delivery Service’s content, the “override Delivery Service” can be deleted and the original can use a non-##
 OVERRIDE## Raw Remap Text to add the plugin.
-
-## 50-ats.rules
-
-This is presumed to be a udev file for devices which are block devices to be used as disk storage by ATS.
-
-ORT verifies all devices in the file are owned by the owner listed in the file, and logs errors otherwise.
-
-ORT verifies all devices in the file do not have filesystems. If any device has a filesystem, ORT assumes it was a mistake to assign as an ATS storage device, and logs a fatal error.
-
-# Logging
-
-ORT outputs its immediate log to `stdout`, therefore it will log wherever you direct it. The recommended system location is `/var/log/ort/ort.log`.
-
-ORT uses the helper tool `atstccfg` to generate config files. Its log is output at `/var/log/ort/atstccfg.log`.
-
-# Trivia
-
-ORT stands for "Operational Readiness Test." The acronym is a legacy artifact and does not reflect the current purpose, which is to apply configuration from Traffic Ops.
+ORT, traffic_ops_ort.pl, is deprecated and will be removed in the next major version. Please use [/t3c/README.md](/uri "t3c").

Review comment:
       That link is broken: https://github.com/apache/trafficcontrol/blob/master/uri
   
   I think for GitHub's renderer you can use relative path links like `./t3c` (but I didn't test that)

##########
File path: traffic_ops_ort/traffic_ops_ort.pl
##########
@@ -63,2624 +50,67 @@
             "disable_parent_config_comments=i" => \$disable_parent_config_comments,
           );
 
-if ( $#ARGV < 1 ) {
-	&usage();
-}
+my $cmd = '/opt/ort/t3c --log-location-error=stdout --log-location-warning=stdout --log-location-info=stdout';
 
-my $log_level = 0;
-$ARGV[1] = uc( $ARGV[1] );
-given ( $ARGV[1] ) {
-	when ("ALL")   { $log_level = 255; }
-	when ("TRACE") { $log_level = 127; }
-	when ("DEBUG") { $log_level = 63; }
-	when ("INFO")  { $log_level = 31; }
-	when ("WARN")  { $log_level = 15; }
-	when ("ERROR") { $log_level = 7; }
-	when ("FATAL") { $log_level = 3; }
-	when ("NONE")  { $log_level = 1; }
-	default        { &usage(); }
+if ( defined $dispersion ) {
+	$cmd .= ' --dispersion=' . $dispersion;
 }
-
-my $TO_URL = undef;
-my $TO_USER = undef;
-my $TO_PASS = undef;
-
-if ( defined( $ARGV[2] ) ) {
-	if ( $ARGV[2] !~ /^https*:\/\/.*$/ ) {
-		&usage();
-	}
-	else {
-		$TO_URL = $ARGV[2];
-		$TO_URL =~ s/\/*$//g;
-	}
+if ( defined $retries ) {
+	$cmd .= ' --num-retries=' . $retries;
 }
-else {
-	&usage();
+if ( defined  $wait_for_parents && $wait_for_parents == 0 ) {
+	$cmd .= ' --wait-for-parents=false';
 }
-
-if ( defined( $ARGV[3] ) ) {
-	if ( $ARGV[3] !~ m/^.*\:.*$/ ) {
-		&usage();
-	}
-	else {
-		( $TO_USER, $TO_PASS ) = split( /:/, $ARGV[3] );
-	}
+if ( defined $login_dispersion ) {
+	$cmd .= ' --login-dispersion=' . $login_dispersion;
 }
-else {
-	&usage();
+if ( defined $rev_proxy_disable && $rev_proxy_disable == 1 ) {
+	$cmd .= ' --rev-proxy-disable=true';
 }
-
-#### Script mode constants ####
-my $INTERACTIVE = 0;
-my $REPORT      = 1;
-my $BADASS      = 2;
-my $SYNCDS      = 3;
-my $REVALIDATE  = 4;
-#### Logging constants for bit shifting ####
-my $ALL   = 7;
-my $TRACE = 6;
-my $DEBUG = 5;
-my $INFO  = 4;
-my $WARN  = 3;
-my $ERROR = 2;
-my $FATAL = 1;
-my $NONE  = 0;
-
-my $RELEASE = &os_version();
-( $log_level >> $DEBUG ) && print "DEBUG OS release is $RELEASE.\n";
-
-my $script_mode = &check_script_mode();
-&check_run_user();
-&check_only_copy_running();
-&check_log_level();
-
-#### Constants to track update status ####
-my $UPDATE_TROPS_NOTNEEDED  = 0;
-my $UPDATE_TROPS_NEEDED     = 1;
-my $UPDATE_TROPS_SUCCESSFUL = 2;
-my $UPDATE_TROPS_FAILED     = 3;
-
-#### Other constants #####
-my $START_FAILED        = 0;
-my $START_SUCCESSFUL    = 1;
-my $ALREADY_RUNNING     = 2;
-my $START_NOT_ATTEMPTED = 3;
-my $CLEAR               = 0;
-my $PLUGIN_NO           = 0;
-my $PLUGIN_YES          = 1;
-#### Constants for config file changes ####
-my $CFG_FILE_UNCHANGED         = 0;
-my $CFG_FILE_NOT_PROCESSED     = 1;
-my $CFG_FILE_CHANGED           = 2;
-my $CFG_FILE_PREREQ_FAILED     = 3;
-my $CFG_FILE_ALREADY_PROCESSED = 4;
-
-my $unixtime       = time();
-my $hostname_short = `/bin/hostname -s`;
-if ($override_hostname_short ne '') {
-	$hostname_short = $override_hostname_short;
+if ( defined $skip_os_check ) {
+	$cmd .= ' --skip-os-check=' . $skip_os_check;
 }
-chomp($hostname_short);
-
-my $atstccfg_timeout_arg='';
-if (length $to_timeout_ms > 0) {
-		$atstccfg_timeout_arg = "--traffic-ops-timeout-milliseconds=$to_timeout_ms";
+if ( defined $override_hostname_short ) {
+	$cmd .= ' --cache-host-name=' . $override_hostname_short;
+} else {
+	$cmd .= ' --cache-host-name=' . `hostname -s`;
 }
-
-my $atstccfg_cmd = '/opt/ort/atstccfg';
-
-my $atstccfg_arg_disable_proxy = '';
-if ($rev_proxy_disable != 0) {
-	$atstccfg_arg_disable_proxy = '--traffic-ops-disable-proxy';
+if ( defined $to_timeout_ms ) {
+	$cmd .= ' --traffic-ops-timeout-milliseconds=' . $to_timeout_ms;
 }
-
-my $atstccfg_insecure_arg = "";
-if ($traffic_ops_insecure == 1) {
-	$atstccfg_insecure_arg = "--traffic-ops-insecure";
+if ( $syncds_updates_ipallow == 1 ) {
+	$cmd .= ' --syncds-updates-ipallow=true';
 }
-
-my $atstccfg_via_string_release = "";
-if ($via_string_release == 1) {
-	$atstccfg_via_string_release = "--via-string-release";
+if ( defined $traffic_ops_insecure ) {
+	$cmd .= ' --traffic-ops-insecure=' . $traffic_ops_insecure;
 }
-
-my $atstccfg_dns_local_bind = "";
-if ($dns_local_bind == 1) {
-	$atstccfg_dns_local_bind = "--dns-local-bind";
+if ( $via_string_release != 1 ) {
+	$cmd .= ' --omit-via-string-release=true';
 }
-
-my $atstccfg_parent_config_comments = "";
-if ($disable_parent_config_comments == 1) {
-	$atstccfg_parent_config_comments = "--disable-parent-config-comments";
+if ( $dns_local_bind == 1 ) {
+	$cmd .= ' --dns-local-bind=true';
 }
-
-my $TMP_BASE  = "/tmp/ort";
-
-my $LOG_BASE  = "/var/log/ort"; # TODO add inferring ORT install location, and allowing / vs /opt install
-my $atstccfg_log_path = $LOG_BASE . '/atstccfg.log';
-
-# add any special yum options for your environment here; this variable is used with all yum commands
-my $YUM_OPTS = "";
-( $log_level >> $DEBUG ) && print "DEBUG YUM_OPTS: $YUM_OPTS.\n";
-
-my $TS_HOME      = "/opt/trafficserver";
-my $TRAFFIC_CTL = $TS_HOME . "/bin/traffic_ctl";
-
-my $out          = `/usr/bin/yum $YUM_OPTS clean expire-cache 2>&1`;
-my $return       = &check_output($out);
-my @config_files = ();
-
-#### Process reboot tracker
-my $traffic_ctl_needed           = 0;
-my $sysctl_p_needed              = 0;
-my $trafficserver_restart_needed = 0;
-
-#### Process installed tracker
-my $installed_new_ssl_keys    = 0;
-my %install_tracker;
-
-my $cfg_file_tracker = undef;
-
-my $ats_config_dir = get_ats_config_dir();
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Start main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-
-#### Delete /tmp dirs older than one week
-if ( $script_mode == $BADASS || $script_mode == $INTERACTIVE || $script_mode == $SYNCDS || $script_mode == $REVALIDATE ) {
-	&smart_mkdir($TMP_BASE);
-	&clean_tmp_dirs();
+if ( $disable_parent_config_comments == 1 ) {
+	$cmd .= ' --disable-parent-config-comments=true';
 }
 
-my $header_comment = &get_header_comment();
-
-#### If this is a syncds run, check to see if we can bail.
-my $syncds_update = 0;
-
-if ( $script_mode == $REVALIDATE ) {
-	( $syncds_update ) = &check_revalidate_state();
-	if ( $syncds_update < 1 ) {
-		exit 1;
-	}
+my $mode = $ARGV[0];
+if ( defined $mode ) {
+	$cmd .= ' --run-mode=' . $mode;
 }
-else {
-	( $syncds_update ) = &check_syncds_state();
+if ( defined( $ARGV[2] ) ) {
+	my $to_url = $ARGV[2];
+	$to_url =~ s/\/*$//g;
+	$cmd .= ' --traffic-ops-url=' . $to_url;
 }
-
-$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-if ( $script_mode == $REVALIDATE ) {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Revalidating, no package processing needed ========\n";
+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 {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start processing packages ========\n";
-	&process_packages( $hostname_short );
-	# get the ats user's UID after package installation in case this is the initial badass
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start second package processing run ========\n";
-	&process_chkconfig( $hostname_short );
-}
-
-&process_config_files();
-
-foreach my $file ( keys ( %{$cfg_file_tracker} ) ) {
-	if ( exists($cfg_file_tracker->{$file}->{'remap_plugin_config_file'}) && $cfg_file_tracker->{$file}->{'remap_plugin_config_file'} ) {
-		if ( exists($cfg_file_tracker->{$file}->{'change_applied'}) && $cfg_file_tracker->{$file}->{'change_applied'} ) {
-			( $log_level >> $DEBUG ) && print "\nDEBUG $file is a remap plugin config file, and was changed. remap.config needs touched.  ========\n";
-			&touch_file('remap.config');
-			last;
-		}
-	}
-}
-
-if ( ($installed_new_ssl_keys) && !$cfg_file_tracker->{'ssl_multicert.config'}->{'change_applied'} ) {
-	my $return = &touch_file('ssl_multicert.config');
-	if ($return) {
-		if ( $syncds_update == $UPDATE_TROPS_NEEDED ) {
-			$syncds_update = $UPDATE_TROPS_SUCCESSFUL;
-		}
-		$traffic_ctl_needed++;
-	}
-}
-
-&start_restart_services();
-
-if ( $sysctl_p_needed && $script_mode != $SYNCDS ) {
-	&run_sysctl_p();
-}
-
-if ( $script_mode != $REPORT ) {
-	&update_trops();
-}
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### End main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Subroutines
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-# Returns the ATS config directory, if it can find it.
-# Tries rpm (yum) first, then falls back to find.
-# If it fails to find it, logs an error and returns the empty string.
-sub get_ats_config_dir {
-	my $dir = `rpm -ql trafficserver | grep -E 'etc/trafficserver\$' | tail -1`;
-	$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	if ( $dir eq "" ) {
-		$dir = `find / -type d -path '*/etc/trafficserver' | tail -1`;
-		$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	}
-	if ( ! length $dir ) {
-		# if it became undefined somehow, make sure we're returning ""
-		$dir = "";
-	}
-	if ( $dir eq "" ) {
-		( $log_level >> $ERROR ) && print "ERROR Failed to find config directory, using empty string!\n";
-	}
-	return $dir;
-}
-
-sub revalidate_while_sleeping {
-	$syncds_update = &check_revalidate_state(1);
-	if ( $syncds_update > 0 ) {
-		$script_mode = $REVALIDATE;
-		$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-		&process_config_files();
-
-		&start_restart_services();
-
-		&update_trops();
-
-		$traffic_ctl_needed = 0;
-	}
-}
-
-sub os_version {
-	my $release = "UNKNOWN";
-	if (`uname -r` =~ m/.+(el\d)((?:\.\w+)|(?:_\w+))*\.x86_64/)  {
-		$release = uc $1;
-	}
-	if (!exists $supported_el_release{$release} && !$skip_os_check) {
-		die("skip_os_check: $skip_os_check dispersion: $dispersion unsupported el_version: $release");
-	}
-	return $release;
-}
-
-sub usage {
-	print "====-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-====\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";
+	&usage();

Review comment:
       I think you deleted this sub

##########
File path: traffic_ops_ort/traffic_ops_ort.pl
##########
@@ -48,6 +33,8 @@
 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";

Review comment:
       Should this be going to stderr?

##########
File path: traffic_ops_ort/t3c/torequest/torequest.go
##########
@@ -274,6 +277,14 @@ func (r *TrafficOpsReq) atsTcExecCommand(cmdstr string, queueState int, revalSta
 		return nil, errors.New("Error from atstccfg: " + err.Error() + ": " + errbuf.String())
 	}
 
+	if errStr := errbuf.String(); len(errStr) != 0 {
+		log.Warnln(`atstccfg stderr start
+` + errStr + `
+atstccfg stderr end`)
+	} else {
+		log.Warnln(`atstccfg stderr was empty`)
+	}
+

Review comment:
       needs `go fmt`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r629556992



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -218,6 +221,9 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
 	defaultEnableH2 := getopt.BoolLong("default-client-enable-h2", '2', "Whether to enable HTTP/2 on Delivery Services by default, if they have no explicit Parameter. This is irrelevant if ATS records.config is not serving H2. If omitted, H2 is disabled.")
 	defaultClientTLSVersions := getopt.StringLong("default-client-tls-versions", 'v', "", "Comma-delimited list of default TLS versions for Delivery Services with no Parameter, e.g. --default-tls-versions='1.1,1.2,1.3'. If omitted, all versions are enabled.")

Review comment:
       The ORT integration tests GHA fails because the `-v` flag is used twice:
   
   ```go
   2021-05-10T17:05:35.7619221Z     t3c-dns-local-bind_test.go:38: ERROR: t3c badass failed: exit status 1: stdout:  stderr: /tmp/go/src/github.com/apache/trafficcontrol/traffic_ops_ort/t3c/config/config.go:228: -v already declared at /tmp/go/src/github.com/apache/trafficcontrol/traffic_ops_ort/t3c/config/config.go:225
   2021-05-10T17:05:35.7622426Z         
   2021-05-10T17:05:38.5006065Z     types.go:58: ---- DeleteTestTypes ----
   2021-05-10T17:05:38.5006834Z User: traffic_ops, Password: twelve, Hostname: db, DB: traffic_ops
   2021-05-10T17:15:32.7954658Z panic: test timed out after 10m0s
   2021-05-10T17:15:32.7962891Z 
   2021-05-10T17:15:32.7963360Z goroutine 85 [running]:
   2021-05-10T17:15:32.7965135Z testing.(*M).startAlarm.func1()
   2021-05-10T17:15:32.7965696Z 	/usr/local/go/src/testing/testing.go:1618 +0xe5
   2021-05-10T17:15:32.7966348Z created by time.goFunc
   2021-05-10T17:15:32.7966986Z 	/usr/local/go/src/time/sleep.go:167 +0x45
   2021-05-10T17:15:32.7967267Z 
   2021-05-10T17:15:32.7967667Z goroutine 1 [chan receive, 10 minutes]:
   2021-05-10T17:15:32.7968206Z testing.(*T).Run(0xc000232480, 0xa4e88c, 0x13, 0xa7d058, 0x496306)
   2021-05-10T17:15:32.7968764Z 	/usr/local/go/src/testing/testing.go:1169 +0x2da
   2021-05-10T17:15:32.7969353Z testing.runTests.func1(0xc000232300)
   2021-05-10T17:15:32.7970069Z 	/usr/local/go/src/testing/testing.go:1439 +0x78
   2021-05-10T17:15:32.7970594Z testing.tRunner(0xc000232300, 0xc000243878)
   2021-05-10T17:15:32.7971094Z 	/usr/local/go/src/testing/testing.go:1123 +0xef
   2021-05-10T17:15:32.7971765Z testing.runTests(0xc00020c620, 0xe25580, 0x5, 0x5, 0xc01e786d2f38b694, 0x8bbdf5f0f3, 0xe35220, 0x0)
   2021-05-10T17:15:32.7972419Z 	/usr/local/go/src/testing/testing.go:1437 +0x2fe
   2021-05-10T17:15:32.7972893Z testing.(*M).Run(0xc000074100, 0x0)
   2021-05-10T17:15:32.7973380Z 	/usr/local/go/src/testing/testing.go:1345 +0x1eb
   2021-05-10T17:15:32.7974967Z github.com/apache/trafficcontrol/traffic_ops_ort/testing/ort-tests.TestMain(0xc000074100)
   2021-05-10T17:15:32.7976246Z 	/root/go/src/github.com/apache/trafficcontrol/traffic_ops_ort/testing/ort-tests/traffic_ops_ort_test.go:115 +0x916
   2021-05-10T17:15:32.7976922Z main.main()
   2021-05-10T17:15:32.7977451Z 	_testmain.go:53 +0x165
   2021-05-10T17:15:32.7977875Z 
   2021-05-10T17:15:32.7978235Z goroutine 5 [select, 10 minutes]:
   2021-05-10T17:15:32.7978855Z database/sql.(*DB).connectionOpener(0xc0003368f0, 0xb07b80, 0xc000067bc0)
   2021-05-10T17:15:32.7979468Z 	/usr/local/go/src/database/sql/sql.go:1126 +0xf5
   2021-05-10T17:15:32.7981230Z created by database/sql.OpenDB
   2021-05-10T17:15:32.7981799Z 	/usr/local/go/src/database/sql/sql.go:740 +0x12a
   2021-05-10T17:15:32.7999839Z exit status 2
   2021-05-10T17:15:32.8001262Z FAIL	github.com/apache/trafficcontrol/traffic_ops_ort/testing/ort-tests	600.198s
   2021-05-10T17:15:32.8398667Z ERROR: ORT tests failure
   2021-05-10T17:15:33.0119381Z 3
   2021-05-10T17:15:33.0859032Z Child process " docker-compose -f /home/runner/work/trafficcontrol/trafficcontrol/traffic_ops_ort/testing/docker/docker-compose.yml run ort_test " exited with status code 3 !
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r629671166



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -216,6 +219,11 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
+

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r629518439



##########
File path: docs/source/glossary.rst
##########
@@ -275,7 +275,7 @@ Glossary
 		The source of content for the CDN. Usually a redundant HTTP/1.1 webserver.
 
 	ORT
-		The "Operational Readiness Test" script that stitches the configuration configured in Traffic Portal and generated by Traffic Ops into the :term:`cache servers`.
+		The previous Traffic Control cache config app, replaced by :term:`t3c`.
 
 		.. seealso:: See :ref:`traffic-ops-ort` for a Python implementation of ORT that is (theoretically) compatible with the one actually provided in Apache Traffic Control releases.

Review comment:
       Removed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r629520907



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -216,6 +219,11 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
+

Review comment:
       v2 does, I'm pretty sure.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] jrushford commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
jrushford commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r625896461



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -216,6 +219,11 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
+

Review comment:
       t3c has a Usage function in config/config.go and the function should be updated to reflect these 3 new options.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r625300465



##########
File path: docs/source/glossary.rst
##########
@@ -275,7 +275,7 @@ Glossary
 		The source of content for the CDN. Usually a redundant HTTP/1.1 webserver.
 
 	ORT
-		The "Operational Readiness Test" script that stitches the configuration configured in Traffic Portal and generated by Traffic Ops into the :term:`cache servers`.
+		The previous Traffic Control cache config app, replaced by :term:`t3c`.
 
 		.. seealso:: See :ref:`traffic-ops-ort` for a Python implementation of ORT that is (theoretically) compatible with the one actually provided in Apache Traffic Control releases.

Review comment:
       `traffic-ops-ort` label no longer exists - although I think this admonition directive has a few problems
   
   * It mentions ORT.py but doesn't redirect to that section
   * It probably shouldn't mention ORT.py anymore since there's no plan to support that in production environments
   * It should probably actually be underneath `t3c` since that's what it actually describes/what the link ought to be.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619521842



##########
File path: traffic_ops_ort/traffic_ops_ort.pl
##########
@@ -48,6 +33,8 @@
 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";

Review comment:
       That sounds fine to me




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619595381



##########
File path: traffic_ops_ort/traffic_ops_ort.pl
##########
@@ -63,295 +50,73 @@
             "disable_parent_config_comments=i" => \$disable_parent_config_comments,
           );
 
-if ( $#ARGV < 1 ) {
-	&usage();
-}
+my $cmd = '/opt/ort/t3c --log-location-error=stdout --log-location-warning=stdout --log-location-info=stdout';
 
-my $log_level = 0;
-$ARGV[1] = uc( $ARGV[1] );
-given ( $ARGV[1] ) {
-	when ("ALL")   { $log_level = 255; }
-	when ("TRACE") { $log_level = 127; }
-	when ("DEBUG") { $log_level = 63; }
-	when ("INFO")  { $log_level = 31; }
-	when ("WARN")  { $log_level = 15; }
-	when ("ERROR") { $log_level = 7; }
-	when ("FATAL") { $log_level = 3; }
-	when ("NONE")  { $log_level = 1; }
-	default        { &usage(); }
+if ( defined $dispersion ) {
+	$cmd .= ' --dispersion=' . $dispersion;
 }
-
-my $TO_URL = undef;
-my $TO_USER = undef;
-my $TO_PASS = undef;
-
-if ( defined( $ARGV[2] ) ) {
-	if ( $ARGV[2] !~ /^https*:\/\/.*$/ ) {
-		&usage();
-	}
-	else {
-		$TO_URL = $ARGV[2];
-		$TO_URL =~ s/\/*$//g;
-	}
+if ( defined $retries ) {
+	$cmd .= ' --num-retries=' . $retries;
 }
-else {
-	&usage();
+if ( defined  $wait_for_parents && $wait_for_parents == 0 ) {
+	$cmd .= ' --wait-for-parents=false';
 }
-
-if ( defined( $ARGV[3] ) ) {
-	if ( $ARGV[3] !~ m/^.*\:.*$/ ) {
-		&usage();
-	}
-	else {
-		( $TO_USER, $TO_PASS ) = split( /:/, $ARGV[3] );
-	}
+if ( defined $login_dispersion ) {
+	$cmd .= ' --login-dispersion=' . $login_dispersion;
 }
-else {
-	&usage();
+if ( defined $rev_proxy_disable && $rev_proxy_disable == 1 ) {
+	$cmd .= ' --rev-proxy-disable=true';
 }
-
-#### Script mode constants ####
-my $INTERACTIVE = 0;
-my $REPORT      = 1;
-my $BADASS      = 2;
-my $SYNCDS      = 3;
-my $REVALIDATE  = 4;
-#### Logging constants for bit shifting ####
-my $ALL   = 7;
-my $TRACE = 6;
-my $DEBUG = 5;
-my $INFO  = 4;
-my $WARN  = 3;
-my $ERROR = 2;
-my $FATAL = 1;
-my $NONE  = 0;
-
-my $RELEASE = &os_version();
-( $log_level >> $DEBUG ) && print "DEBUG OS release is $RELEASE.\n";
-
-my $script_mode = &check_script_mode();
-&check_run_user();
-&check_only_copy_running();
-&check_log_level();
-
-#### Constants to track update status ####
-my $UPDATE_TROPS_NOTNEEDED  = 0;
-my $UPDATE_TROPS_NEEDED     = 1;
-my $UPDATE_TROPS_SUCCESSFUL = 2;
-my $UPDATE_TROPS_FAILED     = 3;
-
-#### Other constants #####
-my $START_FAILED        = 0;
-my $START_SUCCESSFUL    = 1;
-my $ALREADY_RUNNING     = 2;
-my $START_NOT_ATTEMPTED = 3;
-my $CLEAR               = 0;
-my $PLUGIN_NO           = 0;
-my $PLUGIN_YES          = 1;
-#### Constants for config file changes ####
-my $CFG_FILE_UNCHANGED         = 0;
-my $CFG_FILE_NOT_PROCESSED     = 1;
-my $CFG_FILE_CHANGED           = 2;
-my $CFG_FILE_PREREQ_FAILED     = 3;
-my $CFG_FILE_ALREADY_PROCESSED = 4;
-
-my $unixtime       = time();
-my $hostname_short = `/bin/hostname -s`;
-if ($override_hostname_short ne '') {
-	$hostname_short = $override_hostname_short;
+if ( defined $skip_os_check ) {
+	$cmd .= ' --skip-os-check=' . $skip_os_check;
 }
-chomp($hostname_short);
-
-my $atstccfg_timeout_arg='';
-if (length $to_timeout_ms > 0) {
-		$atstccfg_timeout_arg = "--traffic-ops-timeout-milliseconds=$to_timeout_ms";
+if ( defined $override_hostname_short ) {
+	$cmd .= ' --cache-host-name=' . $override_hostname_short;
+} else {
+	$cmd .= ' --cache-host-name=' . `hostname -s`;
 }
-
-my $atstccfg_cmd = '/opt/ort/atstccfg';
-
-my $atstccfg_arg_disable_proxy = '';
-if ($rev_proxy_disable != 0) {
-	$atstccfg_arg_disable_proxy = '--traffic-ops-disable-proxy';
+if ( defined $to_timeout_ms ) {
+	$cmd .= ' --traffic-ops-timeout-milliseconds=' . $to_timeout_ms;
 }
-
-my $atstccfg_insecure_arg = "";
-if ($traffic_ops_insecure == 1) {
-	$atstccfg_insecure_arg = "--traffic-ops-insecure";
+if ( $syncds_updates_ipallow == 1 ) {
+	$cmd .= ' --syncds-updates-ipallow=true';
 }
-
-my $atstccfg_via_string_release = "";
-if ($via_string_release == 1) {
-	$atstccfg_via_string_release = "--via-string-release";
+if ( defined $traffic_ops_insecure ) {
+	$cmd .= ' --traffic-ops-insecure=' . $traffic_ops_insecure;
 }
-
-my $atstccfg_dns_local_bind = "";
-if ($dns_local_bind == 1) {
-	$atstccfg_dns_local_bind = "--dns-local-bind";
+if ( $via_string_release != 1 ) {
+	$cmd .= ' --omit-via-string-release=true';
 }
-
-my $atstccfg_parent_config_comments = "";
-if ($disable_parent_config_comments == 1) {
-	$atstccfg_parent_config_comments = "--disable-parent-config-comments";
+if ( $dns_local_bind == 1 ) {
+	$cmd .= ' --dns-local-bind=true';
 }
-
-my $TMP_BASE  = "/tmp/ort";
-
-my $LOG_BASE  = "/var/log/ort"; # TODO add inferring ORT install location, and allowing / vs /opt install
-my $atstccfg_log_path = $LOG_BASE . '/atstccfg.log';
-
-# add any special yum options for your environment here; this variable is used with all yum commands
-my $YUM_OPTS = "";
-( $log_level >> $DEBUG ) && print "DEBUG YUM_OPTS: $YUM_OPTS.\n";
-
-my $TS_HOME      = "/opt/trafficserver";
-my $TRAFFIC_CTL = $TS_HOME . "/bin/traffic_ctl";
-
-my $out          = `/usr/bin/yum $YUM_OPTS clean expire-cache 2>&1`;
-my $return       = &check_output($out);
-my @config_files = ();
-
-#### Process reboot tracker
-my $traffic_ctl_needed           = 0;
-my $sysctl_p_needed              = 0;
-my $trafficserver_restart_needed = 0;
-
-#### Process installed tracker
-my $installed_new_ssl_keys    = 0;
-my %install_tracker;
-
-my $cfg_file_tracker = undef;
-
-my $ats_config_dir = get_ats_config_dir();
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Start main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-
-#### Delete /tmp dirs older than one week
-if ( $script_mode == $BADASS || $script_mode == $INTERACTIVE || $script_mode == $SYNCDS || $script_mode == $REVALIDATE ) {
-	&smart_mkdir($TMP_BASE);
-	&clean_tmp_dirs();
+if ( $disable_parent_config_comments == 1 ) {
+	$cmd .= ' --disable-parent-config-comments=true';
 }
 
-my $header_comment = &get_header_comment();
-
-#### If this is a syncds run, check to see if we can bail.
-my $syncds_update = 0;
-
-if ( $script_mode == $REVALIDATE ) {
-	( $syncds_update ) = &check_revalidate_state();
-	if ( $syncds_update < 1 ) {
-		exit 1;
-	}
+my $mode = $ARGV[0];
+if ( defined $mode ) {
+	$cmd .= ' --run-mode=' . $mode;
 }
-else {
-	( $syncds_update ) = &check_syncds_state();
+if ( defined( $ARGV[2] ) ) {
+	my $to_url = $ARGV[2];
+	$to_url =~ s/\/*$//g;
+	$cmd .= ' --traffic-ops-url=' . $to_url;
 }
-
-$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-if ( $script_mode == $REVALIDATE ) {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Revalidating, no package processing needed ========\n";
+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 {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start processing packages ========\n";
-	&process_packages( $hostname_short );
-	# get the ats user's UID after package installation in case this is the initial badass
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start second package processing run ========\n";
-	&process_chkconfig( $hostname_short );
-}
-
-&process_config_files();
-
-foreach my $file ( keys ( %{$cfg_file_tracker} ) ) {
-	if ( exists($cfg_file_tracker->{$file}->{'remap_plugin_config_file'}) && $cfg_file_tracker->{$file}->{'remap_plugin_config_file'} ) {
-		if ( exists($cfg_file_tracker->{$file}->{'change_applied'}) && $cfg_file_tracker->{$file}->{'change_applied'} ) {
-			( $log_level >> $DEBUG ) && print "\nDEBUG $file is a remap plugin config file, and was changed. remap.config needs touched.  ========\n";
-			&touch_file('remap.config');
-			last;
-		}
-	}
-}
-
-if ( ($installed_new_ssl_keys) && !$cfg_file_tracker->{'ssl_multicert.config'}->{'change_applied'} ) {
-	my $return = &touch_file('ssl_multicert.config');
-	if ($return) {
-		if ( $syncds_update == $UPDATE_TROPS_NEEDED ) {
-			$syncds_update = $UPDATE_TROPS_SUCCESSFUL;
-		}
-		$traffic_ctl_needed++;
-	}
-}
-
-&start_restart_services();
-
-if ( $sysctl_p_needed && $script_mode != $SYNCDS ) {
-	&run_sysctl_p();
-}
-
-if ( $script_mode != $REPORT ) {
-	&update_trops();
-}
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### End main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Subroutines
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-# Returns the ATS config directory, if it can find it.
-# Tries rpm (yum) first, then falls back to find.
-# If it fails to find it, logs an error and returns the empty string.
-sub get_ats_config_dir {
-	my $dir = `rpm -ql trafficserver | grep -E 'etc/trafficserver\$' | tail -1`;
-	$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	if ( $dir eq "" ) {
-		$dir = `find / -type d -path '*/etc/trafficserver' | tail -1`;
-		$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	}
-	if ( ! length $dir ) {
-		# if it became undefined somehow, make sure we're returning ""
-		$dir = "";
-	}
-	if ( $dir eq "" ) {
-		( $log_level >> $ERROR ) && print "ERROR Failed to find config directory, using empty string!\n";
-	}
-	return $dir;
-}
-
-sub revalidate_while_sleeping {
-	$syncds_update = &check_revalidate_state(1);
-	if ( $syncds_update > 0 ) {
-		$script_mode = $REVALIDATE;
-		$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-		&process_config_files();
-
-		&start_restart_services();
-
-		&update_trops();
-
-		$traffic_ctl_needed = 0;
-	}
-}
-
-sub os_version {
-	my $release = "UNKNOWN";
-	if (`uname -r` =~ m/.+(el\d)((?:\.\w+)|(?:_\w+))*\.x86_64/)  {
-		$release = uc $1;
-	}
-	if (!exists $supported_el_release{$release} && !$skip_os_check) {
-		die("skip_os_check: $skip_os_check dispersion: $dispersion unsupported el_version: $release");
-	}
-	return $release;
+	&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";

Review comment:
       accidentally duplicated line




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-836964374


   > There are a lot of warnings being generated about "t3c" not being in the glossary 
   
   Added to the glossary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619527608



##########
File path: traffic_ops_ort/README.md
##########
@@ -1,105 +1,3 @@
 # ORT
 
-ORT, traffic_ops_ort.pl, is used to apply configuration from Traffic Control, stored in Traffic Ops, to the cache.
-
-Typical usage is to install ORT on the cache machine, and then run it periodically via a CRON job.
-
-## Options
-
-ORT has the following command-line options:
-
-
-option                  | default | description
------------------------ | ------- | ---
-dispersion              | 300     | wait a random number of seconds between 0 and <time> before starting.
-retries                 | 5       | retry connection to Traffic Ops URL <number> times.
-wait_for_parents        | 1       | do not update if parent_pending = 1 in the update json.
-login_dispersion        | 0       | wait a random number of seconds between 0 and <time> before login.
-rev_proxy_disable       | 0       | bypass the reverse proxy even if one has been configured.
-skip_os_check           | 0       | bypass the check for a supported CentOS version.
-override_hostname_short | ""      | override the short hostname of the OS for config generation.
-
-# Modes
-
-ORT can be run in a number of modes.
-
-The syncds mode is the normal mode of operation, which should typically be run periodically via cron or a similar tool.
-
-The badass mode is typically an emergency-fix mode, which will override and replace all files with the configuration generated from the current Traffic Ops data, regardless whether ORT (presumably incorrectly) thinks the files need updating or not. It is recommended to run this mode when something goes wrong, and the configuration on the cache is incorrect, and the data in Traffic Ops and config generation is believed to be correct. It is not recommended to run this in normal operation; use syncds mode for normal operation.
-
-The revalidate mode will apply Revalidations from Traffic Ops (regex_revalidate.config) but no other configuration. This mode was intended to quickly apply revalidations when ORT took a long time to run. It is less relevant with ORT's current speed, but may still be useful on slow networks or very large deployments.
-
-mode        | description
-------------| ---
-interactive | asks questions during config process
-report      | prints config differences and exits
-badass      | attempts to fix all config differences that it can
-syncds      | syncs delivery services with what is configured in Traffic Ops
-revalidate  | checks for updated revalidations in Traffic Ops and applies them
-
-# Behavior
-
-When ORT is run, it will:
-
-1. Delete all of its temporary directories over a week old. Currently, the base temp directory is hard-coded to /tmp/ort.
-1. Determine if Updates have been Queued on the server (by checking the Server's Update Pending or Revalidate Pending flag in Traffic Ops).
-    1. If Updates were not queued and the script is running in syncds mode (the normal mode), exit.
-1. Get the config files from Traffic Ops, via atstccfg.
-1. Process CentOS Yum packages.
-    1. These are specified via Parameters on the Server's Profile, with the Config File 'package', where the Parameter Name is the package name, and the Parameter Value is the package version.
-    1. Uninstall any packages which are installed but whose version does not match.
-    1. Install all packages in the Server Profile.
-1. Process chkconfig directives.
-    1. These are specified via Parameters on the Server's Profile, with the Config File 'chkconfig', where the Parameter Name is the package name, and the Parameter Value is the chkconfig directive line.
-    1. All chkconfig directives in the Server's Profile are applied to the CentOS chkconfig.
-    1. **NOTE** the default profiles distributed by Traffic Control have an ATS chkconfig with a runlevel before networking is enabled, which is likely incorrect.
-    1. **NOTE** this is not used by CentOS 7+ and ATS 7+. SystemD does not use chkconfig, and ATS 7+ uses a SystemD script not an init script.
-1. Process each config file
-    1. If ORT is in revalidate mode, this will only be regex_revalidate.config
-    1. Perform any special processing. See [Special Processing](#special-processing).
-    1. If a file exists at the path of the file, load it from disk and compare the two.
-    1. If there are no changes, don't apply the new file.
-    1. If there are changes, backup the existing file in the temp directory, and write the new file.
-1. If configuration was changed which requires an ATS reload to apply, perform a service reload of ATS.
-1. If configuration was changed which requires an ATS restart to apply, and ORT is in badass mode, perform a service restart of ATS.
-1. If a sysctl.conf config file was changed, and ORT is in badass mode, run `sysctl -p`.
-1. If a ntpd.conf config file was changed, and ORT is in badass mode, perform a service restart of ntpd.
-1. Update Traffic Ops to unset the Update Pending or Revalidate Pending flag of this Server.
-
-# Special Processing
-
-Certain config files perform extra processing.
-
-## Global replacements
-
-All config files have certain text directives replaced. This is done by the atstccfg config generator before the file is returned to ORT.
-
-* `__SERVER_TCP_PORT__` is replaced with the Server's Port from Traffic Ops; unless the server's port is 80, 0, or null, in which case any occurrences preceded by a colon are removed.
-* `__CACHE_IPV4__` is replaced with the Server's IP address from Traffic Ops.
-* `__HOSTNAME__` is replaced with the Server's (short) HostName from Traffic Ops.
-* `__FULL_HOSTNAME__` is replaced with the Server's HostName, a dot, and the Server's DomainName from Traffic Ops (i.e. the Server's Fully Qualified Domain Name).
-* `__RETURN__` is replaced with a newline character, and any whitespace before or after it is removed.
-
-## remap.config
-
-ORT processes `##OVERRIDE##` directives in the remap.config file.
-
-The ##OVERRIDE## template string allows the Delivery Service Raw Remap Text field to override to fully override the Delivery Service’s line in the remap.config ATS configuration file, generated by Traffic Ops. The end result is the original, generated line commented out, prepended with ##OVERRIDDEN## and the ##OVERRIDE## rule is activated in its place. This behavior is used to incrementally deploy plugins used in this configuration file. Normally, this entails cloning the Delivery Service that will have the plugin, ensuring it is assigned to a subset of the cache servers that serve the Delivery Service content, then using this ##OVERRIDE## rule to create a remap.config rule that will use the plugin, overriding the normal rule. Simply grow the subset over time at the desired rate to slowly deploy the plugin. When it encompasses all cache servers that serve the original Delivery Service’s content, the “override Delivery Service” can be deleted and the original can use a non-##
 OVERRIDE## Raw Remap Text to add the plugin.
-
-## 50-ats.rules
-
-This is presumed to be a udev file for devices which are block devices to be used as disk storage by ATS.
-
-ORT verifies all devices in the file are owned by the owner listed in the file, and logs errors otherwise.
-
-ORT verifies all devices in the file do not have filesystems. If any device has a filesystem, ORT assumes it was a mistake to assign as an ATS storage device, and logs a fatal error.
-
-# Logging
-
-ORT outputs its immediate log to `stdout`, therefore it will log wherever you direct it. The recommended system location is `/var/log/ort/ort.log`.
-
-ORT uses the helper tool `atstccfg` to generate config files. Its log is output at `/var/log/ort/atstccfg.log`.
-
-# Trivia
-
-ORT stands for "Operational Readiness Test." The acronym is a legacy artifact and does not reflect the current purpose, which is to apply configuration from Traffic Ops.
+ORT, traffic_ops_ort.pl, is deprecated and will be removed in the next major version. Please use [/t3c/README.md](/uri "t3c").

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-831407654


   > There are a lot of warnings being generated about "t3c" not being in the glossary but being presented as a term. "ORT" is in the glossary and it looks like you're mostly replacing usages of "ORT" with "t3c" - if that's globally the case then you can just replace the ORT glossary section entirely.
   
   Done.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman merged pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
zrhoffman merged pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-826972597


   > Are we able to run t3c in CiaB instead of ORT.py?
   
   `t3c` itself doesn't use Perl, which I believe was the issue. 
   
   If we want to actually install the RPM -- which we really, really, really should to catch production issues -- the RPM still has a dependency of base `perl` for the `traffic_ops_ort.pl` shim, but that shouldn't be an issue. I believe the issue was libraries; CentOS should have `perl` installed by default (and moreover it's part of LSB).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r620703589



##########
File path: docs/source/admin/traffic_server.rst
##########
@@ -74,54 +74,47 @@ Installing Traffic Server
 
 		#. Assuming a Traffic Monitor is already installed somewhere, check the "Cache States" table in its Web UI to verify that the :abbr:`ATS (Apache Traffic Server)` server appears.
 
-.. _traffic-ops-ort:
+.. _t3c:
 
 Configuring Traffic Server
 ==========================
-All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`ORT`. The :file:`traffic_ops_ort.pl` file should be installed on all :term:`cache servers` (See `Installing the ORT Script`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
+All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`t3c`. The :file:`t3c` file should be installed on all :term:`cache servers` (See `Installing the Cache Config Tool`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
 
 .. _config-generation:
 
-ORT Config File Generation
+Cache Config File Generation
 --------------------------

Review comment:
       This underline needs to be updated to be the same as the new heading's length.

##########
File path: docs/source/admin/traffic_server.rst
##########
@@ -74,54 +74,47 @@ Installing Traffic Server
 
 		#. Assuming a Traffic Monitor is already installed somewhere, check the "Cache States" table in its Web UI to verify that the :abbr:`ATS (Apache Traffic Server)` server appears.
 
-.. _traffic-ops-ort:
+.. _t3c:
 
 Configuring Traffic Server
 ==========================
-All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`ORT`. The :file:`traffic_ops_ort.pl` file should be installed on all :term:`cache servers` (See `Installing the ORT Script`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
+All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`t3c`. The :file:`t3c` file should be installed on all :term:`cache servers` (See `Installing the Cache Config Tool`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
 
 .. _config-generation:
 
-ORT Config File Generation
+Cache Config File Generation
 --------------------------
 
-In the past, ATS config files were generated by Traffic Ops. Traffic Control is in the process of moving ATS config file generation to a library for generic use, and to an application which uses the library and resides on the cache.
+In the past, ATS config files were generated by Traffic Ops. Cache config generation is now performed on cache servers themselves, via a library for generic use, and an application which uses the library and resides on the cache server. That application, ``t3c``, is in the process of being rewritten as many small POSIX-style applications which will behave similar to the ``git`` ecosystem.
 
 The library, ``lib/go-atscfg``, allows users to write their own applications and servers, if they wish to generate ATS configuration files and deploy them to caches via other means. For example, if you wish to generate config files with an additional service, or continue generating config files on Traffic Ops itself via a plugin or local service.
 
-The app, ``atstccfg``, is installed by the traffic_ops_ort RPM alongside the ORT script. This app makes standard API calls to Traffic Ops, and uses their data to build the ATS config files. The ORT script now requests all config through the app, which generates config files it has, and requests directly from Traffic Ops the files it doesn't recognize.
+The app ``atstccfg`` is installed by the cache config RPM alongside ``t3c``. This app is a helper to ``t3c`` and does not have a stable interface, and should never need to be called directly by Traffic Control administrators.
 
-This provides several benefits. Primarily, reduces the overhead and risk of the monolithic Traffic Ops installation and upgrade process, and allows operators to canary-test config changes one cache at a time, and in the event of an error, only rolling back a few canary caches rather than the entire Traffic Ops instance.
+The cache-side config generation provides several benefits. Primarily, it reduces the overhead and risk of the monolithic Traffic Ops installation and upgrade process, and allows operators to canary-test config changes one cache at a time, and in the event of an error, only rolling back a few canary caches rather than the entire Traffic Ops instance.
 
-In order to see which config files are generated by a given ``ORT`` or ``atstccfg`` version, run ``/opt/ort/atstccfg --print-generated-files``.
+.. _installing-t3c:
 
-.. _installing-ort:
-
-Installing the ORT Script
+Installing the Cache Config Tool
 -------------------------

Review comment:
       Same as above RE: title underline length




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-836973859


   > Are we able to run t3c in CiaB instead of ORT.py?
   
   > The issue was that ORT needed access to systemd, which I believe is still true under t3c
   
   https://github.com/apache/trafficcontrol/issues/5829


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r629519407



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -216,6 +219,11 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
+

Review comment:
       Does github.com/pborman/getopt have any kind of auto-generated usage we could use, so we don't have to keep updating it?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] jrushford commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
jrushford commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r625896461



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -216,6 +219,11 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
+

Review comment:
       @rob05c t3c has a Usage function in config/config.go and the function should be updated to reflect these 3 new options.  Currently t3c -h doesn't show them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-827191212


   > `t3c` itself doesn't use Perl, which I believe was the issue.
   
   The issue was that ORT needed access to systemd, which I believe is still true under `t3c`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r629567880



##########
File path: traffic_ops_ort/t3c/config/config.go
##########
@@ -218,6 +221,9 @@ func GetCfg() (Cfg, error) {
 	dnsLocalBindPtr := getopt.BoolLong("dns-local-bind", 'b', "[true | false] whether to use the server's Service Addresses to set the ATS DNS local bind address")
 	helpPtr := getopt.BoolLong("help", 'h', "Print usage information and exit")
 	useGitStr := getopt.StringLong("git", 'g', "auto", "Create and use a git repo in the config directory. Options are yes, no, and auto. If yes, create and use. If auto, use if it exist. Default is auto.")
+	syncdsUpdatesIPAllowPtr := getopt.BoolLong("syncds-updates-ipallow", 'S', "Whether syncds mode will update ipallow. This exists because ATS had a bug where reloading after changing ipallow would block everything. Default is false.")
+	omitViaStringReleasePtr := getopt.BoolLong("omit-via-string-release", 'v', "Whether to set the records.config via header to the ATS release from the RPM. Default true.")
+	disableParentConfigCommentsPtr := getopt.BoolLong("disable-parent-config-comments", 'c', "Whether to disable verbose parent.config comments. Default false.")
 	defaultEnableH2 := getopt.BoolLong("default-client-enable-h2", '2', "Whether to enable HTTP/2 on Delivery Services by default, if they have no explicit Parameter. This is irrelevant if ATS records.config is not serving H2. If omitted, H2 is disabled.")
 	defaultClientTLSVersions := getopt.StringLong("default-client-tls-versions", 'v', "", "Comma-delimited list of default TLS versions for Delivery Services with no Parameter, e.g. --default-tls-versions='1.1,1.2,1.3'. If omitted, all versions are enabled.")

Review comment:
       Ah, another PR added that after I made this one. Fixed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619521507



##########
File path: traffic_ops_ort/traffic_ops_ort.pl
##########
@@ -63,2624 +50,67 @@
             "disable_parent_config_comments=i" => \$disable_parent_config_comments,
           );
 
-if ( $#ARGV < 1 ) {
-	&usage();
-}
+my $cmd = '/opt/ort/t3c --log-location-error=stdout --log-location-warning=stdout --log-location-info=stdout';
 
-my $log_level = 0;
-$ARGV[1] = uc( $ARGV[1] );
-given ( $ARGV[1] ) {
-	when ("ALL")   { $log_level = 255; }
-	when ("TRACE") { $log_level = 127; }
-	when ("DEBUG") { $log_level = 63; }
-	when ("INFO")  { $log_level = 31; }
-	when ("WARN")  { $log_level = 15; }
-	when ("ERROR") { $log_level = 7; }
-	when ("FATAL") { $log_level = 3; }
-	when ("NONE")  { $log_level = 1; }
-	default        { &usage(); }
+if ( defined $dispersion ) {
+	$cmd .= ' --dispersion=' . $dispersion;
 }
-
-my $TO_URL = undef;
-my $TO_USER = undef;
-my $TO_PASS = undef;
-
-if ( defined( $ARGV[2] ) ) {
-	if ( $ARGV[2] !~ /^https*:\/\/.*$/ ) {
-		&usage();
-	}
-	else {
-		$TO_URL = $ARGV[2];
-		$TO_URL =~ s/\/*$//g;
-	}
+if ( defined $retries ) {
+	$cmd .= ' --num-retries=' . $retries;
 }
-else {
-	&usage();
+if ( defined  $wait_for_parents && $wait_for_parents == 0 ) {
+	$cmd .= ' --wait-for-parents=false';
 }
-
-if ( defined( $ARGV[3] ) ) {
-	if ( $ARGV[3] !~ m/^.*\:.*$/ ) {
-		&usage();
-	}
-	else {
-		( $TO_USER, $TO_PASS ) = split( /:/, $ARGV[3] );
-	}
+if ( defined $login_dispersion ) {
+	$cmd .= ' --login-dispersion=' . $login_dispersion;
 }
-else {
-	&usage();
+if ( defined $rev_proxy_disable && $rev_proxy_disable == 1 ) {
+	$cmd .= ' --rev-proxy-disable=true';
 }
-
-#### Script mode constants ####
-my $INTERACTIVE = 0;
-my $REPORT      = 1;
-my $BADASS      = 2;
-my $SYNCDS      = 3;
-my $REVALIDATE  = 4;
-#### Logging constants for bit shifting ####
-my $ALL   = 7;
-my $TRACE = 6;
-my $DEBUG = 5;
-my $INFO  = 4;
-my $WARN  = 3;
-my $ERROR = 2;
-my $FATAL = 1;
-my $NONE  = 0;
-
-my $RELEASE = &os_version();
-( $log_level >> $DEBUG ) && print "DEBUG OS release is $RELEASE.\n";
-
-my $script_mode = &check_script_mode();
-&check_run_user();
-&check_only_copy_running();
-&check_log_level();
-
-#### Constants to track update status ####
-my $UPDATE_TROPS_NOTNEEDED  = 0;
-my $UPDATE_TROPS_NEEDED     = 1;
-my $UPDATE_TROPS_SUCCESSFUL = 2;
-my $UPDATE_TROPS_FAILED     = 3;
-
-#### Other constants #####
-my $START_FAILED        = 0;
-my $START_SUCCESSFUL    = 1;
-my $ALREADY_RUNNING     = 2;
-my $START_NOT_ATTEMPTED = 3;
-my $CLEAR               = 0;
-my $PLUGIN_NO           = 0;
-my $PLUGIN_YES          = 1;
-#### Constants for config file changes ####
-my $CFG_FILE_UNCHANGED         = 0;
-my $CFG_FILE_NOT_PROCESSED     = 1;
-my $CFG_FILE_CHANGED           = 2;
-my $CFG_FILE_PREREQ_FAILED     = 3;
-my $CFG_FILE_ALREADY_PROCESSED = 4;
-
-my $unixtime       = time();
-my $hostname_short = `/bin/hostname -s`;
-if ($override_hostname_short ne '') {
-	$hostname_short = $override_hostname_short;
+if ( defined $skip_os_check ) {
+	$cmd .= ' --skip-os-check=' . $skip_os_check;
 }
-chomp($hostname_short);
-
-my $atstccfg_timeout_arg='';
-if (length $to_timeout_ms > 0) {
-		$atstccfg_timeout_arg = "--traffic-ops-timeout-milliseconds=$to_timeout_ms";
+if ( defined $override_hostname_short ) {
+	$cmd .= ' --cache-host-name=' . $override_hostname_short;
+} else {
+	$cmd .= ' --cache-host-name=' . `hostname -s`;
 }
-
-my $atstccfg_cmd = '/opt/ort/atstccfg';
-
-my $atstccfg_arg_disable_proxy = '';
-if ($rev_proxy_disable != 0) {
-	$atstccfg_arg_disable_proxy = '--traffic-ops-disable-proxy';
+if ( defined $to_timeout_ms ) {
+	$cmd .= ' --traffic-ops-timeout-milliseconds=' . $to_timeout_ms;
 }
-
-my $atstccfg_insecure_arg = "";
-if ($traffic_ops_insecure == 1) {
-	$atstccfg_insecure_arg = "--traffic-ops-insecure";
+if ( $syncds_updates_ipallow == 1 ) {
+	$cmd .= ' --syncds-updates-ipallow=true';
 }
-
-my $atstccfg_via_string_release = "";
-if ($via_string_release == 1) {
-	$atstccfg_via_string_release = "--via-string-release";
+if ( defined $traffic_ops_insecure ) {
+	$cmd .= ' --traffic-ops-insecure=' . $traffic_ops_insecure;
 }
-
-my $atstccfg_dns_local_bind = "";
-if ($dns_local_bind == 1) {
-	$atstccfg_dns_local_bind = "--dns-local-bind";
+if ( $via_string_release != 1 ) {
+	$cmd .= ' --omit-via-string-release=true';
 }
-
-my $atstccfg_parent_config_comments = "";
-if ($disable_parent_config_comments == 1) {
-	$atstccfg_parent_config_comments = "--disable-parent-config-comments";
+if ( $dns_local_bind == 1 ) {
+	$cmd .= ' --dns-local-bind=true';
 }
-
-my $TMP_BASE  = "/tmp/ort";
-
-my $LOG_BASE  = "/var/log/ort"; # TODO add inferring ORT install location, and allowing / vs /opt install
-my $atstccfg_log_path = $LOG_BASE . '/atstccfg.log';
-
-# add any special yum options for your environment here; this variable is used with all yum commands
-my $YUM_OPTS = "";
-( $log_level >> $DEBUG ) && print "DEBUG YUM_OPTS: $YUM_OPTS.\n";
-
-my $TS_HOME      = "/opt/trafficserver";
-my $TRAFFIC_CTL = $TS_HOME . "/bin/traffic_ctl";
-
-my $out          = `/usr/bin/yum $YUM_OPTS clean expire-cache 2>&1`;
-my $return       = &check_output($out);
-my @config_files = ();
-
-#### Process reboot tracker
-my $traffic_ctl_needed           = 0;
-my $sysctl_p_needed              = 0;
-my $trafficserver_restart_needed = 0;
-
-#### Process installed tracker
-my $installed_new_ssl_keys    = 0;
-my %install_tracker;
-
-my $cfg_file_tracker = undef;
-
-my $ats_config_dir = get_ats_config_dir();
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Start main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-
-#### Delete /tmp dirs older than one week
-if ( $script_mode == $BADASS || $script_mode == $INTERACTIVE || $script_mode == $SYNCDS || $script_mode == $REVALIDATE ) {
-	&smart_mkdir($TMP_BASE);
-	&clean_tmp_dirs();
+if ( $disable_parent_config_comments == 1 ) {
+	$cmd .= ' --disable-parent-config-comments=true';
 }
 
-my $header_comment = &get_header_comment();
-
-#### If this is a syncds run, check to see if we can bail.
-my $syncds_update = 0;
-
-if ( $script_mode == $REVALIDATE ) {
-	( $syncds_update ) = &check_revalidate_state();
-	if ( $syncds_update < 1 ) {
-		exit 1;
-	}
+my $mode = $ARGV[0];
+if ( defined $mode ) {
+	$cmd .= ' --run-mode=' . $mode;
 }
-else {
-	( $syncds_update ) = &check_syncds_state();
+if ( defined( $ARGV[2] ) ) {
+	my $to_url = $ARGV[2];
+	$to_url =~ s/\/*$//g;
+	$cmd .= ' --traffic-ops-url=' . $to_url;
 }
-
-$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-if ( $script_mode == $REVALIDATE ) {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Revalidating, no package processing needed ========\n";
+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 {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start processing packages ========\n";
-	&process_packages( $hostname_short );
-	# get the ats user's UID after package installation in case this is the initial badass
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start second package processing run ========\n";
-	&process_chkconfig( $hostname_short );
-}
-
-&process_config_files();
-
-foreach my $file ( keys ( %{$cfg_file_tracker} ) ) {
-	if ( exists($cfg_file_tracker->{$file}->{'remap_plugin_config_file'}) && $cfg_file_tracker->{$file}->{'remap_plugin_config_file'} ) {
-		if ( exists($cfg_file_tracker->{$file}->{'change_applied'}) && $cfg_file_tracker->{$file}->{'change_applied'} ) {
-			( $log_level >> $DEBUG ) && print "\nDEBUG $file is a remap plugin config file, and was changed. remap.config needs touched.  ========\n";
-			&touch_file('remap.config');
-			last;
-		}
-	}
-}
-
-if ( ($installed_new_ssl_keys) && !$cfg_file_tracker->{'ssl_multicert.config'}->{'change_applied'} ) {
-	my $return = &touch_file('ssl_multicert.config');
-	if ($return) {
-		if ( $syncds_update == $UPDATE_TROPS_NEEDED ) {
-			$syncds_update = $UPDATE_TROPS_SUCCESSFUL;
-		}
-		$traffic_ctl_needed++;
-	}
-}
-
-&start_restart_services();
-
-if ( $sysctl_p_needed && $script_mode != $SYNCDS ) {
-	&run_sysctl_p();
-}
-
-if ( $script_mode != $REPORT ) {
-	&update_trops();
-}
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### End main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Subroutines
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-# Returns the ATS config directory, if it can find it.
-# Tries rpm (yum) first, then falls back to find.
-# If it fails to find it, logs an error and returns the empty string.
-sub get_ats_config_dir {
-	my $dir = `rpm -ql trafficserver | grep -E 'etc/trafficserver\$' | tail -1`;
-	$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	if ( $dir eq "" ) {
-		$dir = `find / -type d -path '*/etc/trafficserver' | tail -1`;
-		$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	}
-	if ( ! length $dir ) {
-		# if it became undefined somehow, make sure we're returning ""
-		$dir = "";
-	}
-	if ( $dir eq "" ) {
-		( $log_level >> $ERROR ) && print "ERROR Failed to find config directory, using empty string!\n";
-	}
-	return $dir;
-}
-
-sub revalidate_while_sleeping {
-	$syncds_update = &check_revalidate_state(1);
-	if ( $syncds_update > 0 ) {
-		$script_mode = $REVALIDATE;
-		$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-		&process_config_files();
-
-		&start_restart_services();
-
-		&update_trops();
-
-		$traffic_ctl_needed = 0;
-	}
-}
-
-sub os_version {
-	my $release = "UNKNOWN";
-	if (`uname -r` =~ m/.+(el\d)((?:\.\w+)|(?:_\w+))*\.x86_64/)  {
-		$release = uc $1;
-	}
-	if (!exists $supported_el_release{$release} && !$skip_os_check) {
-		die("skip_os_check: $skip_os_check dispersion: $dispersion unsupported el_version: $release");
-	}
-	return $release;
-}
-
-sub usage {
-	print "====-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-====\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";
+	&usage();

Review comment:
       Added back.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c removed a comment on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c removed a comment on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-836964374


   > There are a lot of warnings being generated about "t3c" not being in the glossary 
   
   Added to the glossary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-825953301


   > There should be some documentation changes associated with this...
   
   There is also a section that auto-docs the `traffic_ops_ort` Python package - you can get rid of that if you think it's confusing. I was gonna wait until we could get rid of the actual code, but since there's no plan to use it as a replacement for the old ORT anymore there's no reason users need it to be documented, so it can get stripped out of the docs any time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r629515939



##########
File path: traffic_ops_ort/traffic_ops_ort.pl
##########
@@ -63,295 +50,73 @@
             "disable_parent_config_comments=i" => \$disable_parent_config_comments,
           );
 
-if ( $#ARGV < 1 ) {
-	&usage();
-}
+my $cmd = '/opt/ort/t3c --log-location-error=stdout --log-location-warning=stdout --log-location-info=stdout';
 
-my $log_level = 0;
-$ARGV[1] = uc( $ARGV[1] );
-given ( $ARGV[1] ) {
-	when ("ALL")   { $log_level = 255; }
-	when ("TRACE") { $log_level = 127; }
-	when ("DEBUG") { $log_level = 63; }
-	when ("INFO")  { $log_level = 31; }
-	when ("WARN")  { $log_level = 15; }
-	when ("ERROR") { $log_level = 7; }
-	when ("FATAL") { $log_level = 3; }
-	when ("NONE")  { $log_level = 1; }
-	default        { &usage(); }
+if ( defined $dispersion ) {
+	$cmd .= ' --dispersion=' . $dispersion;
 }
-
-my $TO_URL = undef;
-my $TO_USER = undef;
-my $TO_PASS = undef;
-
-if ( defined( $ARGV[2] ) ) {
-	if ( $ARGV[2] !~ /^https*:\/\/.*$/ ) {
-		&usage();
-	}
-	else {
-		$TO_URL = $ARGV[2];
-		$TO_URL =~ s/\/*$//g;
-	}
+if ( defined $retries ) {
+	$cmd .= ' --num-retries=' . $retries;
 }
-else {
-	&usage();
+if ( defined  $wait_for_parents && $wait_for_parents == 0 ) {
+	$cmd .= ' --wait-for-parents=false';
 }
-
-if ( defined( $ARGV[3] ) ) {
-	if ( $ARGV[3] !~ m/^.*\:.*$/ ) {
-		&usage();
-	}
-	else {
-		( $TO_USER, $TO_PASS ) = split( /:/, $ARGV[3] );
-	}
+if ( defined $login_dispersion ) {
+	$cmd .= ' --login-dispersion=' . $login_dispersion;
 }
-else {
-	&usage();
+if ( defined $rev_proxy_disable && $rev_proxy_disable == 1 ) {
+	$cmd .= ' --rev-proxy-disable=true';
 }
-
-#### Script mode constants ####
-my $INTERACTIVE = 0;
-my $REPORT      = 1;
-my $BADASS      = 2;
-my $SYNCDS      = 3;
-my $REVALIDATE  = 4;
-#### Logging constants for bit shifting ####
-my $ALL   = 7;
-my $TRACE = 6;
-my $DEBUG = 5;
-my $INFO  = 4;
-my $WARN  = 3;
-my $ERROR = 2;
-my $FATAL = 1;
-my $NONE  = 0;
-
-my $RELEASE = &os_version();
-( $log_level >> $DEBUG ) && print "DEBUG OS release is $RELEASE.\n";
-
-my $script_mode = &check_script_mode();
-&check_run_user();
-&check_only_copy_running();
-&check_log_level();
-
-#### Constants to track update status ####
-my $UPDATE_TROPS_NOTNEEDED  = 0;
-my $UPDATE_TROPS_NEEDED     = 1;
-my $UPDATE_TROPS_SUCCESSFUL = 2;
-my $UPDATE_TROPS_FAILED     = 3;
-
-#### Other constants #####
-my $START_FAILED        = 0;
-my $START_SUCCESSFUL    = 1;
-my $ALREADY_RUNNING     = 2;
-my $START_NOT_ATTEMPTED = 3;
-my $CLEAR               = 0;
-my $PLUGIN_NO           = 0;
-my $PLUGIN_YES          = 1;
-#### Constants for config file changes ####
-my $CFG_FILE_UNCHANGED         = 0;
-my $CFG_FILE_NOT_PROCESSED     = 1;
-my $CFG_FILE_CHANGED           = 2;
-my $CFG_FILE_PREREQ_FAILED     = 3;
-my $CFG_FILE_ALREADY_PROCESSED = 4;
-
-my $unixtime       = time();
-my $hostname_short = `/bin/hostname -s`;
-if ($override_hostname_short ne '') {
-	$hostname_short = $override_hostname_short;
+if ( defined $skip_os_check ) {
+	$cmd .= ' --skip-os-check=' . $skip_os_check;
 }
-chomp($hostname_short);
-
-my $atstccfg_timeout_arg='';
-if (length $to_timeout_ms > 0) {
-		$atstccfg_timeout_arg = "--traffic-ops-timeout-milliseconds=$to_timeout_ms";
+if ( defined $override_hostname_short ) {
+	$cmd .= ' --cache-host-name=' . $override_hostname_short;
+} else {
+	$cmd .= ' --cache-host-name=' . `hostname -s`;
 }
-
-my $atstccfg_cmd = '/opt/ort/atstccfg';
-
-my $atstccfg_arg_disable_proxy = '';
-if ($rev_proxy_disable != 0) {
-	$atstccfg_arg_disable_proxy = '--traffic-ops-disable-proxy';
+if ( defined $to_timeout_ms ) {
+	$cmd .= ' --traffic-ops-timeout-milliseconds=' . $to_timeout_ms;
 }
-
-my $atstccfg_insecure_arg = "";
-if ($traffic_ops_insecure == 1) {
-	$atstccfg_insecure_arg = "--traffic-ops-insecure";
+if ( $syncds_updates_ipallow == 1 ) {
+	$cmd .= ' --syncds-updates-ipallow=true';
 }
-
-my $atstccfg_via_string_release = "";
-if ($via_string_release == 1) {
-	$atstccfg_via_string_release = "--via-string-release";
+if ( defined $traffic_ops_insecure ) {
+	$cmd .= ' --traffic-ops-insecure=' . $traffic_ops_insecure;
 }
-
-my $atstccfg_dns_local_bind = "";
-if ($dns_local_bind == 1) {
-	$atstccfg_dns_local_bind = "--dns-local-bind";
+if ( $via_string_release != 1 ) {
+	$cmd .= ' --omit-via-string-release=true';
 }
-
-my $atstccfg_parent_config_comments = "";
-if ($disable_parent_config_comments == 1) {
-	$atstccfg_parent_config_comments = "--disable-parent-config-comments";
+if ( $dns_local_bind == 1 ) {
+	$cmd .= ' --dns-local-bind=true';
 }
-
-my $TMP_BASE  = "/tmp/ort";
-
-my $LOG_BASE  = "/var/log/ort"; # TODO add inferring ORT install location, and allowing / vs /opt install
-my $atstccfg_log_path = $LOG_BASE . '/atstccfg.log';
-
-# add any special yum options for your environment here; this variable is used with all yum commands
-my $YUM_OPTS = "";
-( $log_level >> $DEBUG ) && print "DEBUG YUM_OPTS: $YUM_OPTS.\n";
-
-my $TS_HOME      = "/opt/trafficserver";
-my $TRAFFIC_CTL = $TS_HOME . "/bin/traffic_ctl";
-
-my $out          = `/usr/bin/yum $YUM_OPTS clean expire-cache 2>&1`;
-my $return       = &check_output($out);
-my @config_files = ();
-
-#### Process reboot tracker
-my $traffic_ctl_needed           = 0;
-my $sysctl_p_needed              = 0;
-my $trafficserver_restart_needed = 0;
-
-#### Process installed tracker
-my $installed_new_ssl_keys    = 0;
-my %install_tracker;
-
-my $cfg_file_tracker = undef;
-
-my $ats_config_dir = get_ats_config_dir();
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Start main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-
-#### Delete /tmp dirs older than one week
-if ( $script_mode == $BADASS || $script_mode == $INTERACTIVE || $script_mode == $SYNCDS || $script_mode == $REVALIDATE ) {
-	&smart_mkdir($TMP_BASE);
-	&clean_tmp_dirs();
+if ( $disable_parent_config_comments == 1 ) {
+	$cmd .= ' --disable-parent-config-comments=true';
 }
 
-my $header_comment = &get_header_comment();
-
-#### If this is a syncds run, check to see if we can bail.
-my $syncds_update = 0;
-
-if ( $script_mode == $REVALIDATE ) {
-	( $syncds_update ) = &check_revalidate_state();
-	if ( $syncds_update < 1 ) {
-		exit 1;
-	}
+my $mode = $ARGV[0];
+if ( defined $mode ) {
+	$cmd .= ' --run-mode=' . $mode;
 }
-else {
-	( $syncds_update ) = &check_syncds_state();
+if ( defined( $ARGV[2] ) ) {
+	my $to_url = $ARGV[2];
+	$to_url =~ s/\/*$//g;
+	$cmd .= ' --traffic-ops-url=' . $to_url;
 }
-
-$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-if ( $script_mode == $REVALIDATE ) {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Revalidating, no package processing needed ========\n";
+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 {
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start processing packages ========\n";
-	&process_packages( $hostname_short );
-	# get the ats user's UID after package installation in case this is the initial badass
-	( $log_level >> $INFO ) && print "\nINFO: ======== Start second package processing run ========\n";
-	&process_chkconfig( $hostname_short );
-}
-
-&process_config_files();
-
-foreach my $file ( keys ( %{$cfg_file_tracker} ) ) {
-	if ( exists($cfg_file_tracker->{$file}->{'remap_plugin_config_file'}) && $cfg_file_tracker->{$file}->{'remap_plugin_config_file'} ) {
-		if ( exists($cfg_file_tracker->{$file}->{'change_applied'}) && $cfg_file_tracker->{$file}->{'change_applied'} ) {
-			( $log_level >> $DEBUG ) && print "\nDEBUG $file is a remap plugin config file, and was changed. remap.config needs touched.  ========\n";
-			&touch_file('remap.config');
-			last;
-		}
-	}
-}
-
-if ( ($installed_new_ssl_keys) && !$cfg_file_tracker->{'ssl_multicert.config'}->{'change_applied'} ) {
-	my $return = &touch_file('ssl_multicert.config');
-	if ($return) {
-		if ( $syncds_update == $UPDATE_TROPS_NEEDED ) {
-			$syncds_update = $UPDATE_TROPS_SUCCESSFUL;
-		}
-		$traffic_ctl_needed++;
-	}
-}
-
-&start_restart_services();
-
-if ( $sysctl_p_needed && $script_mode != $SYNCDS ) {
-	&run_sysctl_p();
-}
-
-if ( $script_mode != $REPORT ) {
-	&update_trops();
-}
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### End main flow
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-#### Subroutines
-####-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-####
-
-# Returns the ATS config directory, if it can find it.
-# Tries rpm (yum) first, then falls back to find.
-# If it fails to find it, logs an error and returns the empty string.
-sub get_ats_config_dir {
-	my $dir = `rpm -ql trafficserver | grep -E 'etc/trafficserver\$' | tail -1`;
-	$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	if ( $dir eq "" ) {
-		$dir = `find / -type d -path '*/etc/trafficserver' | tail -1`;
-		$dir =~ s/^\s+|\s+$//g; # trim leading and trailing whitespace
-	}
-	if ( ! length $dir ) {
-		# if it became undefined somehow, make sure we're returning ""
-		$dir = "";
-	}
-	if ( $dir eq "" ) {
-		( $log_level >> $ERROR ) && print "ERROR Failed to find config directory, using empty string!\n";
-	}
-	return $dir;
-}
-
-sub revalidate_while_sleeping {
-	$syncds_update = &check_revalidate_state(1);
-	if ( $syncds_update > 0 ) {
-		$script_mode = $REVALIDATE;
-		$cfg_file_tracker = &get_cfg_file_list( $hostname_short, $script_mode );
-
-		&process_config_files();
-
-		&start_restart_services();
-
-		&update_trops();
-
-		$traffic_ctl_needed = 0;
-	}
-}
-
-sub os_version {
-	my $release = "UNKNOWN";
-	if (`uname -r` =~ m/.+(el\d)((?:\.\w+)|(?:_\w+))*\.x86_64/)  {
-		$release = uc $1;
-	}
-	if (!exists $supported_el_release{$release} && !$skip_os_check) {
-		die("skip_os_check: $skip_os_check dispersion: $dispersion unsupported el_version: $release");
-	}
-	return $release;
+	&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";

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619528616



##########
File path: traffic_ops_ort/t3c/torequest/torequest.go
##########
@@ -274,6 +277,14 @@ func (r *TrafficOpsReq) atsTcExecCommand(cmdstr string, queueState int, revalSta
 		return nil, errors.New("Error from atstccfg: " + err.Error() + ": " + errbuf.String())
 	}
 
+	if errStr := errbuf.String(); len(errStr) != 0 {
+		log.Warnln(`atstccfg stderr start
+` + errStr + `
+atstccfg stderr end`)
+	} else {
+		log.Warnln(`atstccfg stderr was empty`)
+	}
+

Review comment:
       oh yeah. Just looked wonky at a glance.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619520393



##########
File path: traffic_ops_ort/t3c/torequest/torequest.go
##########
@@ -274,6 +277,14 @@ func (r *TrafficOpsReq) atsTcExecCommand(cmdstr string, queueState int, revalSta
 		return nil, errors.New("Error from atstccfg: " + err.Error() + ": " + errbuf.String())
 	}
 
+	if errStr := errbuf.String(); len(errStr) != 0 {
+		log.Warnln(`atstccfg stderr start
+` + errStr + `
+atstccfg stderr end`)
+	} else {
+		log.Warnln(`atstccfg stderr was empty`)
+	}
+

Review comment:
       This has `gofmt`. I think what you're seeing is the multi-line string literal? That's normal.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r619520949



##########
File path: traffic_ops_ort/traffic_ops_ort.pl
##########
@@ -48,6 +33,8 @@
 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";

Review comment:
       It's following the pattern of the existing ort.pl, e.g. https://github.com/apache/trafficcontrol/blob/master/traffic_ops_ort/traffic_ops_ort.pl#L388
   
   I think it should follow the previous pattern as closely as possible, so as to be picked up automatically by any existing tooling users might have.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#issuecomment-827192319


   > The issue was that ORT needed access to systemd, which I believe is still true under t3c
   
   Ah, I'm not sure, but if it does, we intend to add flags to allow avoiding that.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5781: Deprecate ort.pl, change to proxy t3c

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5781:
URL: https://github.com/apache/trafficcontrol/pull/5781#discussion_r625205545



##########
File path: docs/source/admin/traffic_server.rst
##########
@@ -74,54 +74,47 @@ Installing Traffic Server
 
 		#. Assuming a Traffic Monitor is already installed somewhere, check the "Cache States" table in its Web UI to verify that the :abbr:`ATS (Apache Traffic Server)` server appears.
 
-.. _traffic-ops-ort:
+.. _t3c:
 
 Configuring Traffic Server
 ==========================
-All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`ORT`. The :file:`traffic_ops_ort.pl` file should be installed on all :term:`cache servers` (See `Installing the ORT Script`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
+All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`t3c`. The :file:`t3c` file should be installed on all :term:`cache servers` (See `Installing the Cache Config Tool`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
 
 .. _config-generation:
 
-ORT Config File Generation
+Cache Config File Generation
 --------------------------

Review comment:
       Done.

##########
File path: docs/source/admin/traffic_server.rst
##########
@@ -74,54 +74,47 @@ Installing Traffic Server
 
 		#. Assuming a Traffic Monitor is already installed somewhere, check the "Cache States" table in its Web UI to verify that the :abbr:`ATS (Apache Traffic Server)` server appears.
 
-.. _traffic-ops-ort:
+.. _t3c:
 
 Configuring Traffic Server
 ==========================
-All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`ORT`. The :file:`traffic_ops_ort.pl` file should be installed on all :term:`cache servers` (See `Installing the ORT Script`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
+All of the :abbr:`ATS (Apache Traffic Server)` application configuration files are generated by Traffic Ops and installed by :term:`t3c`. The :file:`t3c` file should be installed on all :term:`cache servers` (See `Installing the Cache Config Tool`_), usually in ``/opt/ort``. It is used to do the initial install of the configuration files when the :term:`cache server` is being deployed, and to keep the configuration files up-to-date when the :term:`cache server` is already in service.
 
 .. _config-generation:
 
-ORT Config File Generation
+Cache Config File Generation
 --------------------------
 
-In the past, ATS config files were generated by Traffic Ops. Traffic Control is in the process of moving ATS config file generation to a library for generic use, and to an application which uses the library and resides on the cache.
+In the past, ATS config files were generated by Traffic Ops. Cache config generation is now performed on cache servers themselves, via a library for generic use, and an application which uses the library and resides on the cache server. That application, ``t3c``, is in the process of being rewritten as many small POSIX-style applications which will behave similar to the ``git`` ecosystem.
 
 The library, ``lib/go-atscfg``, allows users to write their own applications and servers, if they wish to generate ATS configuration files and deploy them to caches via other means. For example, if you wish to generate config files with an additional service, or continue generating config files on Traffic Ops itself via a plugin or local service.
 
-The app, ``atstccfg``, is installed by the traffic_ops_ort RPM alongside the ORT script. This app makes standard API calls to Traffic Ops, and uses their data to build the ATS config files. The ORT script now requests all config through the app, which generates config files it has, and requests directly from Traffic Ops the files it doesn't recognize.
+The app ``atstccfg`` is installed by the cache config RPM alongside ``t3c``. This app is a helper to ``t3c`` and does not have a stable interface, and should never need to be called directly by Traffic Control administrators.
 
-This provides several benefits. Primarily, reduces the overhead and risk of the monolithic Traffic Ops installation and upgrade process, and allows operators to canary-test config changes one cache at a time, and in the event of an error, only rolling back a few canary caches rather than the entire Traffic Ops instance.
+The cache-side config generation provides several benefits. Primarily, it reduces the overhead and risk of the monolithic Traffic Ops installation and upgrade process, and allows operators to canary-test config changes one cache at a time, and in the event of an error, only rolling back a few canary caches rather than the entire Traffic Ops instance.
 
-In order to see which config files are generated by a given ``ORT`` or ``atstccfg`` version, run ``/opt/ort/atstccfg --print-generated-files``.
+.. _installing-t3c:
 
-.. _installing-ort:
-
-Installing the ORT Script
+Installing the Cache Config Tool
 -------------------------

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org