This package is meant to fully implement the Traffic Ops Operational
Readiness Test - which was originally written in a single, chickenscratch
Perl script. When the
main() function is run, it acts (more or less)
exactly like that legacy script, with the ability to set system configuration
files and start, stop, and restart HTTP cache servers etc.
This package provides an executable script named traffic_ops_ort
There are two main ways to invoke traffic_ops_ort. The first method uses what’s referred to as the “legacy call signature” and is meant to match the Perl command line arguments.
traffic_ops_ort [-k] [-h] [-v] [--dispersion DISP] [--login_dispersion DISP] [--retries RETRIES] [--wait_for_parents INT] [--rev_proxy_disable] [--ts_root PATH] MODE LOG_LEVEL TO_URL LOGIN``
The second method - called the “new call signature” - aims to reduce the complexity of the
ORT command line. Rather than require a URL and “login string” for connecting and
authenticating with the Traffic Ops server, these pieces of information are optional and may be
provided by the
--to_password options, respectively. If they are NOT provided, then their values
will be obtained from the
variables, respectively. Note that traffic_ops_ort cannot be run using the new call
signature without providing a definition for each of these, either on the command line or in the
traffic_ops_ort [-k] [-h] [-v] [--dispersion DISP] [--login_dispersion DISP] [--retries RETRIES] [--wait_for_parents INT] [--rev_proxy_disable] [--ts_root PATH] [-l LOG_LEVEL] [-u USER] [-p PASSWORD] [--to_url URL] MODE
These two call signatures should not be mixed, and traffic_ops_ort will exit with an error if they are.
Arguments and Flags¶
Print usage information and exit
Print version information and exit
An optional flag which, when used, disables the checking of SSL certificates for validity
Wait a random number between 0 and
DISPseconds before starting. This option only has any effect if
SYNCDS. (Default: 300)
Wait a random number between 0 and
DISPseconds before authenticating with Traffic Ops. (Default: 0)
If connection to Traffic Ops fails, retry
RETRIEStimes before giving up (Default: 3).
INTis anything but 0, do not apply updates if parents of this server have pending updates. This option requires an integer argument for legacy compatibility reasons; 0 is considered
False, anything else is
True. (Default: 1)
Make requests directly to the Traffic Ops server, bypassing a reverse proxy if one exists.
An optional flag which, if present, specifies the absolute path to the install directory of Apache Traffic Server. A common alternative to the default is
Specifies traffic_ops_ort’s mode of operation. Must be one of:
Runs as though the mode was BADASS, but doesn’t actually change anything on the system.
This is normally useful with a verbose
LOG_LEVELto check the state of the system
- Runs as though the mode was BADASS, but asks the user for confirmation before making changes
- Will not restart Apache Traffic Server, install packages, or enable/disable system services and will exit immediately if this server does not have revalidations pending. Also, the only configuration file that will be updated is regex_revalidate.config.
- Will not restart Apache Traffic Server, and will exit immediately if this server does not have updates pending. Otherwise, the same as BADASS
- Applies all pending configuration in Traffic Ops, and attempts to solve encountered problems when possible. This will install packages, enable/disable system services, and will start or restart Apache Traffic Server as necessary.
Sets the verbosity of output provided by traffic_ops_ort. This argument is positional in the legacy call signature, but optional in the new call signature, wherein it has a default value of “WARN”. Must be one of (case-insensitive):
- Will output nothing, not even fatal errors.
- Will only output error messages that indicate an unrecoverable error.
- A synonym for “CRITICAL”
- Will output more general errors about conditions that are causing problems of some kind.
- In addition to error information, will output warnings about conditions that may cause problems, or possible misconfiguration.
- Outputs informational messages about what traffic_ops_ort is doing as it progresses.
Outputs detailed debug information, including stack traces.
Not all stack traces indicate problems with traffic_ops_ort. Stack traces are printed whenever an exception is encountered, whether or not it could be handled.
- A synonym for “DEBUG”
- A synonym for “DEBUG”
All logging is sent to STDERR. INTERACTIVE
MODEprompts are printed to STDOUT
This must be at minimum an FQDN that resolves to the Traffic Ops server, but may optionally include the schema and/or port number. E.g.
trafficops.infra.ciab.testare all acceptable, and in fact are all equivalent. When given a value without a schema, HTTPS will be the assumed protocol, and when a port number is not present, 443 will be assumed except in the case that the schema is provided and is
http://(case-insensitive) in which case 80 will be assumed.
This argument is positional in the legacy call signature, but is optional in the new call signature. When the new call signature is used and this option is not present on the command line, its value will be obtained from
TO_URL. Note that traffic_ops_ort cannot be run using the new call signature unless this value is defined, either on the command line or in the execution environment.
The information used to authenticate with Traffic Ops. This must consist of a username and a password, delimited by a colon (
admin:twelve. This argument is not used in the new call signature, instead
--to_passwordare used to separately set the authentication user and password, respectively.
The first colon found in this string is considered the delimiter. There is no way to escape the delimeter. This effectively means that usernames containing colons cannot be used to authenticate with Traffic Ops, though passwords containing colons should be fine.
Specifies the username of the user as whom to authenticate when connecting to Traffic Ops. This option is only available using the new call signature. If not provided when using said new call signature, the value will be obtained from the
TO_USERenvironment variable. Note that traffic_ops_ort cannot be run using the new call signature unless this value is defined, either on the command line or in the execution environment.
Specifies the password of the user identified by
--to_userif overridden) to use when authenticating to Traffic Ops. This option is only available using the new call signature. If not provided when using said new call signature, the value will be obtained from the
TO_PASSWORDenvironment variable. Note that traffic_ops_ort cannot be run using the new call signature unless this value is defined, either on the command line or in the execution environment.
Should be set to the URL of a Traffic Ops server. This doesn’t need to be a full URL, an FQDN will do just as well. It may also omit the port number on which the Traffic Ops server listens for incoming connections - port 443 will be assumed unless
TO_URLis prefixed by
http://(case-insensitive), in which case port 80 will be assumed. The value of this environment variable will only be considered if traffic_ops_ort was invoked using the new call signature, which allows it to be overridden on the command line by the value of
The username to use when authenticating to the Traffic Ops server. The value of this environment variable will only be considered if traffic_ops_ort was invoked using the new call signature, which allows it to be overridden on the command line by the value of
Strings with Special Meaning to ORT¶
When processing configuration files, if traffic_ops_ort encounters any of the strings in the Replacement Strings table it will perform the indicated replacement. This means that these strings can be used to create templates in Profile Parameters and certain Delivery Service configuration fields.
||The IPv4 address of the cache server on which traffic_ops_ort is running.|
||The full hostname (i.e. including the full domain to which it belongs) of the cache server on which traffic_ops_ort is running.|
||The (short) hostname of the cache server on which traffic_ops_ort is running.|
||A newline character (
||If the cache server on which traffic_ops_ort is
being run has a TCP port configured to something besides
||This string is only valid in the content of files named “remap.config”. It is further described in Remap Override|
Deprecated since version ATCv4.0: The use of
__RETURN__ in lieu of a true newline character is (finally) no longer necessary,
and the ability to do so will be removed in the future.
There is currently no way to indicate that a server’s IPv6 address should be inserted - only IPv4 is supported.
##OVERRIDE## special string is a temporary solution and will be
deprecated once Delivery Service Versioning is implemented. For this reason it is suggested that
it not be used unless absolutely necessary.
##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
##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
##OVERRIDE## Raw Remap Text to add the plugin.
# This is the original line as generated by Traffic Ops map http://from.example.com/ http://to.example.com/ # This is the raw remap text as configured on the delivery service ##OVERRIDE## map http://from.example.com/ http://to.example.com/ some_plugin.so # The resulting content is what actually winds up in the remap.config file: ##OVERRIDE## map http://from.example.com/ http://to.example.com/ some_plugin.so ##OVERRIDDEN## map http://from.example.com/ http://to.example.com/
The “from” URL must exactly match for this to properly work (e.g. including trailing
URL ‘/’), otherwise ATS may fail to initialize or reload while
To assist in troubleshooting, it is strongly recommended that any
##OVERRIDE## rules in
use should be documented on the original Delivery Service.
Runs the main routine based on the parsed arguments to the script
Parameters: args (
Namespace) – A parsed argument list as returned from
Returns: an exit code for the script. Raises: AttributeError – when the namespace is missing required arguments