You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by zr...@apache.org on 2022/01/19 20:53:10 UTC
[trafficcontrol] branch master updated: Updates to Ansible Roles (#6247)
This is an automated email from the ASF dual-hosted git repository.
zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new e04486a Updates to Ansible Roles (#6247)
e04486a is described below
commit e04486a8c075013009edcd0d47ff5a9ec0e96386
Author: Jonathan G <jh...@users.noreply.github.com>
AuthorDate: Wed Jan 19 13:52:56 2022 -0700
Updates to Ansible Roles (#6247)
* Initial contribution of Ansible-based lab deployment efforts
* Upgrade Ansible dependency due to changes in yum module behavior
Prior to 2.7 it appears that the yum module had been waiting for yum's lockfile to be removed, but in 2.8 it now errors out immediately.
* Upgrade TS golang dependencies to match TO
This also gets the version to become available via regular epel.
* Convert from the package module to yum in order to provide needed parameters to be consistent with Ansible 2.7 behavior
* Nitpick documentation fixes per PR feedback
* Documentation updates around terms and abbreviations
* Documentation fixes relating to section headers
* Documentation updates surrounding images
This includes switching out the raster png for source svg
* Documentation fixes surrounding unicode arrows
* Documentation updates surrounding the use of atc-file
* Documentation updates surrounding the use of superscript
* Documentation updates surrounding links to external projects
* Tidy the svg sources and add missing apache license header
* Documentation update to convert spaces to tabs per PR feedback
* Updates to dynamic inventory script per PR feedback.
This addresses several points of feedback such as Python3 support, python best practices, better argument handling, & argument consistency with other ATC tooling.
* Add note about how to get the Python native client setup.
* Fix documentation reference on case-sensitive filesystems.
* Parameterize the specific version of Postgres 9.6 that's used.
This allows for rollbacks in the event of a Postgresql regression in a minor release.
* Enable 1Gb logrolling on the ATS output log
* Update Tomcat-native dependency for TR
* Update TP default configuration based on latest commits into master
* Remove setup of the postgres yum repo as that should be out of scope for a generic core role
* Switch example playbook documentation to json-based vars
* More agressively restart postgres
* Downcase the cdn routing names
Post-install is case-sensitive, but the API isn't. This bypasses an issue with the default not being idempotent across reruns.
* Refactor the external python association script into a custom filter plugin
This significantly helps with code cleanup/clarity.
* Teach dataset loader how to automatically differentiate cache profiles by hardware
This adds support for mixed cache hardware that doesn't use the same kinds of hardware. It's still a round-robin based association, but the hardware variances are excluded. This also necessitated a refactor in how profiles were mapped to components. Instead of using whitelist+blacklist, it's now just a regex match.
* Fix cache parameter templating
* Fix bug with ram disk filters on parameter generation
* Update hardware variation in cache parameters
This fixes a bug where the 'value' key was missing leading to default usages thus making TM unable to poll grove properly. It's also far less awkward to read.
* Update golang dependency for TS
EPEL no longer offers 1.11.5
* key used for ds request override changed
* Give a grace period after issuing the reboot
It's possible that in the time it takes for SSH to stop accepting connections, the wait_for_connection check might have accidentally passed causing tasks afterward to fail due to connectivity loss.
* Add an optional ATS cache disk reset
When constructing reproducible infrastructure on physical hosts, ensure that past environments don't pollute new runs with warm cache data from a prior life.
* Add additional sanity checks for ATS readiness
Ensure ATS is responding on normal ports and with astats properly before returning control.
* Add ORT Directory placeholder for Grove
The override for ORT presently fails in cases where ORT was never installed.
* Update Golang dependencies in TS
EPEL appears to have dropped a new version
* Disable logging on more tasks
* Add an extra protection when it comes to rpm version detection
Not entirely sure how it happens, but sometimes the version string is empty which causes the version compare to fail.
* Add influxdb/smtp configurations
* Address feedback
* Fix for ansible 2.9.1 and python3
* Improve protections against intermittent network faults on GET
* Convert from a generic default set of server params to per component defaults
This allows for better hints or behavior for the deployed environment without providing per-host overrides out of scope.
* Fix MSO aliases and add a general fallback case for missing components
In case the component default doesn't exist, fallback to the generic one
* Update to new golang version in EPEL for TS
* Make interpolation resolution more explicit
* added ecsEnabled field to traffic portal properties
* added ecsEnabled default field to traffic portal properties
* Move the ats udev drive mapper script to a more reliable location
If ort is installed to an lvm partition than bin, it may be mounted at a different time and thus cause drive mounting to fail. This ensures the udev mapper script is always available during boot correctly.
* Switched to using DailyRollingFileAppender and Added date pattern for rolling
removed MaxFileSize adn MaxBackup which are not supported in DailyRollingFileAppender
* initial add of crontab template.
* added cronjob data
* added crontab data
* replaced /opt/traffic-router/var/log with {{tr_log_dir}}
* Moved license header to top
* fixed bug.. added quotes
* Update Tomcat Native library dependency
1.2.21 was removed from EPEL. 1.2.23 is the current version.
* Corrected syntax in traffic-router role
* Update the golang dependencies with EPEL changes
Switching to use a wildcard for golang patches to reduce frequency of breakage while still maintaining major/minor compatibility.
* Allow TR install to use additional repos
There is a bug where additional repos weren't being enabled properly for TR installs. This could lead to inconsistent component versions when using the "latest" or default package names.
* Add some better handling for being sure goose is available to traffic_ops
* Switch from deprecated admin.pl script in TO
The admin.pl script was deprecated in ATCv4 and has now been removed in master.
* Add a variable to enable TLS 1.1
* Use TLS 1.1 in the Traffic Vault example
* By default, enable TLS 1.1 for Traffic Vault
* Explicitly set the maximum TLS version to use to communicate with Riak
* riak.conf template: MaxTLSVersion, not maxversion
* Add additional debugging to help triage intermittent failures due to Goose not being found
* Add additional debugging to help triage intermittent failures due to Goose not being found
* Add additional debugging to help triage intermittent failures due to Goose not being found
* Add additional debugging to help triage intermittent failures due to Goose not being found
* Add additional debugging to help triage intermittent failures due to Goose not being found
* Add additional debugging to help triage intermittent failures due to Goose not being found
* Bump the timeouts for URI requests to TO during the dataset loader
* Take a more heavyhanded solution to transfer encoding issues with Ansible/Python
Even with upgrading to python 3.8, this still seems to sometimes be a problem. This is a more heavyhanded approach to bypass python entirely. It's selectively only used here as this seems to be the main task being affected.
* Add some delays when retrying requests just in case of ephemeral issues running through the retries too fast
* Increase consistency with ephemeral web request problems
* Loweered dns_max_threads per recent deployment issues
* Support running the dataset loader outside the ansible control host
I've been chasing intermittent issues with regard to dropped packets or connections breaking python3 or urllib3 whereas it's not been an issue with python2.7 and urllib. This has manifested itself as "incomplete read" exceptions being thrown inside the URI module. This adds support so that when using the import_role module for the dataset loader it can delegate the default host upon which it runs. This means that the URI calls instead of referencing a normal TO url, would reference [...]
* Fix to use the correct variable name
* Further tuning of the max TR DNS threads
* Remove debugging around postinstall and goose issues
* fixes tp base url variable
* Add Skeleton Enabling Anonymous Blocking in ansible-env
I have added configuration for TR anonymous blocking in generic
ansible-env. I have set up the parameters in TR and created a delivery
service that has the feature enabled.
* Adding changes for use_ims flag
* Update Coersion of IMS param to JSON Boolean
Looks like Perl has issues with `True` versus `true` maybe
* adds supported_ds_metrics to cdn.conf with the default value
* updates array syntax
* Fixup because of json/j2 issues with unicode
* Add new optional port range to limit the dynamic port range of riak
This is primarily for firewall rule exceptions per
https://docs.riak.com/riak/kv/latest/using/security/index.html
* Add support for TODB Standby and Replicas
* Externalize groups in dataset loader
Not a great practice to require role consumers to have groups named
identically when you can parameterize it instead. This also handles
cases where they don't exist more gracefully.
* Add shortcircuit logic to skip assigning grove DS when not using grove
* Improve idempotency with cdn update.
TO API forces downcasing on cdn names, but postinstall doesn't. This
helps if the dataset loader is run more than once and the postinstall
cdn name wasn't downcased.
* Update golang version available from epel in TS
* More idempotency fixes with cdn case sensitivity
* Add a way to supply a consistent static IPv6 address for a server to DSL
The default_ipv6_address fact isn't consistent when multiple IP are
using the same default IPv6 gateway. This is mostly true in cases like
when IPv6 autoconf is being used. It's possible to have both a static
address and a SLAAC assigned address within the same router address
prefix.
* Additional CDN case sensitivity fixes for DSL
* Weasel fixes
* Bugfix to alternate ipv6 address location
* Address differences in go rpm naming dependencies
* Fixes for ansible 2.10 and jinja2
* Update repo .mailmap
* Update default ATS logging params
* Bump the default ATS TM query time
* Update default ATS crash logger path
* Fix issue with default ATS handling of gzip encoding missmatches
* Adjust ATS Edge default startup behavior to wait for disks
* Enable Supermicro udev rules by default on ATS Mids
* Update default ATS performance and reliability params
* Update ATS Edge defaults from ATS 8
* Add ATS8 Edge support
* Update ATS Mid defaults from ATS 8
* Add ATS8 Mid support
* Normalize ATS Profile Templates for better human understanding
* Fixup to profile normalization
* Fixup to profile normalization
* Remove redundant ATS profile parameters
This also coerces a few of the fields that should have been updated to
ATS 8 values.
* Add an playbook to help with maintinance of the ATS profile defaults
* Fixup to maintenance playbook and documentation
* Fixes to quoting on ATS log formatting parameters
* Support non-ip ansible_host vars
* Ansible lint fixes
* Fixup to todb linter fixes
* ansible-lint fixes
* Fix bug where postgres replication user or credential were missing
* Make TO optional for TODB testing
* Fixes for postgres13 support
* Add let's encrypt support to TO config
* Update TP DS form defaults
* Update comment on TP defaults not to reference API 1.3
* Typo fix for replication/standby todb
* Fix quoting issue in ats8 defaults
* Fix source host for moving around udev script from ort
* Fix blending of server data in dataset loader
* Fixup
* Simplify server var override and add safety
* Only create DS Profiles if they're necessary
* Fix server creation idempotency after TO change
* Performance improvement from cdn duplication bug
* Refactor on performance fix
* Fix for loading component server defaults
* Fix some quirks where mids listen differently than edges for conns
* more ats role updates
* Bump the timeouts when waiting for ATS reboots to complete
* Switch ORT to use t3c
* Switch initializing SOLR to curl
Riak has a known problems with TLS1.2. By switching these interactions
to curl explicitly we can disable it at the client since this isn't
normally exposed to ansible. It may or may not work as it was depending
on exactly what combinations of python, urllib, openssl, and ansible you
were using. This should generally be more reliable though.
* Linter fixes
* Fix bug where the wrong user was setup as replication in todb
* Add support for ipv4 and ipv6 in pg_hba.conf
* Centos8 fixes
* Update TODB role metadata for better namespace and Centos8
* Add initial molecule testing support covering TODB
* Fixup to molecule requirements lookup
* Add molecule lint and verify to fakeOrigin role for Centos7/8
* Linter fixes
* Centos8 fix
* updates to todb templates for syntax issues
* Fix t3c bug with local git repo
* Adjust default for dataset loader health threshold kbps calculation
* Fix dataset loader units on bandwidth threshold
* Update Changelog
* Remove leftover doc from bad merge
* Debugging molecule GHA systemd
* Remove TODB postgres requirements around locale which may not exist.
* Revert "Debugging molecule GHA systemd"
This reverts commit c973a27528ce022feda3603e24985fb9649ef1cb.
* Update set_server_status task
Newer versions of the ATC API returns a list object for server requests.
This updates the set_server_status to handle the response as a list object.
* Remove removed ssl certificate ansible module argument
Co-authored-by: Jeremy Mitchell <mi...@gmail.com>
Co-authored-by: Michael Hoppal <Mi...@comcast.com>
Co-authored-by: mjacks258 <ma...@comcast.com>
Co-authored-by: jpappa200 <jo...@cable.comcast.com>
Co-authored-by: Jeff Howell <je...@comcast.com>
Co-authored-by: Zach Hoffman <za...@zrhoffman.net>
Co-authored-by: Dylan Souza <dy...@comcast.com>
Co-authored-by: Srijeet Chatterjee <sr...@comcast.com>
Co-authored-by: Ashish Paudyal <ap...@cable.comcast.com>
---
.github/workflows/ansible.molecule.fo.yml | 91 +
.github/workflows/ansible.molecule.todb.yml | 92 +
.mailmap | 4 +
CHANGELOG.md | 1 +
infrastructure/ansible/.gitignore | 1 +
infrastructure/ansible/roles/ats/defaults/main.yml | 1 +
infrastructure/ansible/roles/ats/tasks/ats.yml | 78 +-
.../ansible/roles/dataset_loader/.gitignore | 2 +
.../ansible/roles/dataset_loader/README.md | 10 +-
.../roles/dataset_loader/analyze.ats.profiles.yml | 505 +++
.../ansible/roles/dataset_loader/defaults/main.yml | 3510 +++++---------------
.../filter_plugins/dsloader.filter.util.py | 79 +
.../dataset_loader/parameter.diff.exclusions.yml | 77 +
.../dataset_loader/profile.parameter.conversion.md | 179 +
.../tasks/assign_steering_targets.yml | 3 +
.../tasks/cache_parameter_loader.yml | 69 +
.../tasks/create_ds_profiles_params.yml | 7 +
.../roles/dataset_loader/tasks/dataset_loader.yml | 716 ++--
.../roles/dataset_loader/tasks/ds_loader.yml | 37 +-
.../ansible/roles/dataset_loader/tasks/main.yml | 2 +-
.../dataset_loader/tasks/parameter_loader.yml | 21 +-
.../dataset_loader/tasks/update_mso_servers.yml | 15 +-
.../roles/dataset_loader/templates/parameter.j2 | 4 +-
infrastructure/ansible/roles/fakeOrigin/README.md | 2 +-
.../ansible/roles/fakeOrigin/defaults/main.yml | 4 +-
.../ansible/roles/fakeOrigin/handlers/main.yml | 2 +-
.../ansible/roles/fakeOrigin/meta/main.yml | 25 +-
.../main.yml => molecule/default/converge.yml} | 3 +-
.../roles/fakeOrigin/molecule/default/molecule.yml | 75 +
.../roles/fakeOrigin/molecule/default/verify.yml | 53 +
.../ansible/roles/fakeOrigin/molecule/driver.yml | 330 ++
.../scenario.requirement.vars.yml} | 7 +-
.../ansible/roles/fakeOrigin/tasks/fakeOrigin.yml | 6 +-
.../ansible/roles/fakeOrigin/tasks/main.yml | 2 +-
.../ansible/roles/molecule_shared/.ansible-lint | 69 +
.../tasks/main.yml => molecule_shared/.gitignore} | 5 +-
.../tasks/main.yml => molecule_shared/.yamllint} | 15 +-
.../ansible/roles/molecule_shared/ansible.cfg | 16 +
.../ansible/roles/molecule_shared/dependency.yml | 237 ++
.../ansible/roles/molecule_shared/prepare.yml | 149 +
.../roles/molecule_shared/regenerate.ssl.ca.yml | 118 +
.../roles/to_api/tasks/set_server_status.yml | 6 +-
.../ansible/roles/traffic-router/defaults/main.yml | 8 +
.../roles/traffic-router/tasks/traffic_router.yml | 12 +-
.../templates/crontab.j2} | 18 +-
.../ansible/roles/traffic-vault/defaults/main.yml | 2 +
.../roles/traffic-vault/templates/riak.conf.j2 | 5 +
.../ansible/roles/traffic_ops/defaults/main.yml | 8 +-
.../roles/traffic_ops/tasks/traffic_ops.yml | 103 +-
.../roles/traffic_ops/templates/cdn.conf.j2 | 7 +
.../ansible/roles/traffic_opsdb/README.md | 12 +-
.../ansible/roles/traffic_opsdb/defaults/main.yml | 21 +-
.../ansible/roles/traffic_opsdb/handlers/main.yml | 2 +-
.../ansible/roles/traffic_opsdb/meta/main.yml | 23 +-
.../molecule/default/converge.yml} | 3 +-
.../traffic_opsdb/molecule/default/molecule.yml | 75 +
.../traffic_opsdb/molecule/default/verify.yml | 49 +
.../roles/traffic_opsdb/molecule/driver.yml | 154 +
.../molecule/scenario.requirement.vars.yml} | 5 +-
.../molecule/triad/converge.yml} | 3 +-
.../traffic_opsdb/molecule/triad/molecule.yml | 127 +
.../roles/traffic_opsdb/molecule/triad/verify.yml | 102 +
.../tasks/initialize_traffic_opsdb.yml | 11 +-
.../ansible/roles/traffic_opsdb/tasks/main.yml | 6 +
.../traffic_opsdb/tasks/replicas_traffic_opsdb.yml | 69 +
.../traffic_opsdb/tasks/standby_traffic_opsdb.yml | 69 +
.../roles/traffic_opsdb/tasks/traffic_opsdb.yml | 70 +-
.../roles/traffic_opsdb/templates/pg_hba.conf.j2 | 169 +-
.../traffic_opsdb/templates/postgresql.conf.j2 | 8 +-
.../templates/recovery.conf.j2} | 19 +-
.../ansible/roles/traffic_opsdb/vars/main.yml | 44 +-
.../ansible/roles/traffic_portal/defaults/main.yml | 9 +-
72 files changed, 4552 insertions(+), 3289 deletions(-)
diff --git a/.github/workflows/ansible.molecule.fo.yml b/.github/workflows/ansible.molecule.fo.yml
new file mode 100644
index 0000000..6952849
--- /dev/null
+++ b/.github/workflows/ansible.molecule.fo.yml
@@ -0,0 +1,91 @@
+# 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.
+---
+name: Molecule - FO
+
+on:
+ create:
+ push:
+ branches:
+ - master
+ paths:
+ - .github/workflows/ansible.molecule.fo.yml
+ - infrastructure/ansible/roles/molecule_shared/**
+ - infrastructure/ansible/roles/fakeOrigin/**
+ pull_request:
+ paths:
+ - .github/workflows/ansible.molecule.fo.yml
+ - infrastructure/ansible/roles/molecule_shared/**
+ - infrastructure/ansible/roles/fakeOrigin/**
+ types: [opened, reopened, ready_for_review, synchronize]
+
+jobs:
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out the codebase.
+ uses: actions/checkout@v2
+
+ - name: Set up Python 3.
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install test dependencies.
+ run: pip3 install ansible molecule[docker] yamllint ansible-lint jmespath
+
+ - name: Run Molecule tests.
+ run: molecule --debug -vvvvv lint
+ env:
+ PY_COLORS: '1'
+ ANSIBLE_FORCE_COLOR: '1'
+ MOLECULE_DISTRO: 'centos8'
+ working-directory: ${{ github.workspace }}/infrastructure/ansible/roles/fakeOrigin
+
+ verify:
+ name: Verify
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ distro:
+ - centos8
+ - centos7
+ scenario:
+ - default
+
+ steps:
+ - name: Check out the codebase.
+ uses: actions/checkout@v2
+
+ - name: Set up Python 3.
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install test dependencies.
+ run: pip3 install ansible molecule[docker] yamllint ansible-lint jmespath
+
+ - name: Run Molecule tests.
+ run: molecule --debug -vvvvv converge && molecule --debug -vvvvv verify
+ env:
+ PY_COLORS: '1'
+ ANSIBLE_FORCE_COLOR: '1'
+ MOLECULE_DISTRO: ${{ matrix.distro }}
+ MOLECULE_SCENARIO_NAME: ${{ matrix.scenario }}
+ working-directory: ${{ github.workspace }}/infrastructure/ansible/roles/fakeOrigin
diff --git a/.github/workflows/ansible.molecule.todb.yml b/.github/workflows/ansible.molecule.todb.yml
new file mode 100644
index 0000000..13807a1
--- /dev/null
+++ b/.github/workflows/ansible.molecule.todb.yml
@@ -0,0 +1,92 @@
+# 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.
+---
+name: Molecule - TODB
+
+on:
+ create:
+ push:
+ branches:
+ - master
+ paths:
+ - .github/workflows/ansible.molecule.todb.yml
+ - infrastructure/ansible/roles/molecule_shared/**
+ - infrastructure/ansible/roles/traffic_opsdb/**
+ pull_request:
+ paths:
+ - .github/workflows/ansible.molecule.todb.yml
+ - infrastructure/ansible/roles/molecule_shared/**
+ - infrastructure/ansible/roles/traffic_opsdb/**
+ types: [opened, reopened, ready_for_review, synchronize]
+
+jobs:
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out the codebase.
+ uses: actions/checkout@v2
+
+ - name: Set up Python 3.
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install test dependencies.
+ run: pip3 install ansible molecule[docker] yamllint ansible-lint jmespath
+
+ - name: Run Molecule tests.
+ run: molecule --debug -vvvvv lint
+ env:
+ PY_COLORS: '1'
+ ANSIBLE_FORCE_COLOR: '1'
+ MOLECULE_DISTRO: 'centos8'
+ working-directory: ${{ github.workspace }}/infrastructure/ansible/roles/traffic_opsdb
+
+ verify:
+ name: Verify
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ distro:
+ - centos8
+ - centos7
+ scenario:
+ - default
+ - triad
+
+ steps:
+ - name: Check out the codebase.
+ uses: actions/checkout@v2
+
+ - name: Set up Python 3.
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install test dependencies.
+ run: pip3 install ansible molecule[docker] yamllint ansible-lint jmespath
+
+ - name: Run Molecule tests.
+ run: molecule --debug -vvvvv converge && molecule --debug -vvvvv verify
+ env:
+ PY_COLORS: '1'
+ ANSIBLE_FORCE_COLOR: '1'
+ MOLECULE_DISTRO: ${{ matrix.distro }}
+ MOLECULE_SCENARIO_NAME: ${{ matrix.scenario }}
+ working-directory: ${{ github.workspace }}/infrastructure/ansible/roles/traffic_opsdb
diff --git a/.mailmap b/.mailmap
index 2de866d..5b0a8f8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -46,3 +46,7 @@
<ni...@gmail.com> <ni...@qwilt.com>
<la...@cable.comcast.com> <lw...@users.noreply.github.com>
<yo...@cisco.com> <ro...@trafficstat1.x1.cdn.com>
+<jh...@apache.org> <jh...@users.noreply.github.com>
+<jh...@apache.org> <Jo...@comcast.com>
+<jh...@apache.org> <jo...@comcast.com>
+<jh...@apache.org> <jh...@acu.edu>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0ea095d..76e5a93 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added a new Traffic Monitor configuration option -- `short_hostname_override` -- to traffic_monitor.cfg to allow overriding the system hostname that Traffic Monitor uses.
- Added a new Traffic Monitor configuration option -- `stat_polling` (default: true) -- to traffic_monitor.cfg to disable stat polling.
- A new Traffic Portal server command-line option `-c` to specify a configuration file, and the ability to set `log: null` to log to stdout (consult documentation for details).
+- Multiple improvements to Ansible roles as discussed at ApacheCon 2021
- SANs information to the SSL key endpoint and Traffic Portal page.
- Added definition for `heartbeat.polling.interval` for CDN Traffic Monitor config in API documentation.
- New `pkg` script options, `-h`, `-s`, `-S`, and `-L`.
diff --git a/infrastructure/ansible/.gitignore b/infrastructure/ansible/.gitignore
index 0a8848a..31b634b 100644
--- a/infrastructure/ansible/.gitignore
+++ b/infrastructure/ansible/.gitignore
@@ -17,3 +17,4 @@
#
*.retry
inventory
+.cache
diff --git a/infrastructure/ansible/roles/ats/defaults/main.yml b/infrastructure/ansible/roles/ats/defaults/main.yml
index 6a43450..16c89fc 100644
--- a/infrastructure/ansible/roles/ats/defaults/main.yml
+++ b/infrastructure/ansible/roles/ats/defaults/main.yml
@@ -54,3 +54,4 @@ ort_crontab:
{%- else -%}
traffic_ops_ort.pl revalidate warn {{ ort_traffic_ops_url }} '{{ ort_traffic_ops_username }}:{{ ort_traffic_ops_password }}' --login_dispersion=35 &>/tmp/ort/reval.log
{%- endif -%}
+ats_clear_data: false
diff --git a/infrastructure/ansible/roles/ats/tasks/ats.yml b/infrastructure/ansible/roles/ats/tasks/ats.yml
index 397d6a6..e454552 100644
--- a/infrastructure/ansible/roles/ats/tasks/ats.yml
+++ b/infrastructure/ansible/roles/ats/tasks/ats.yml
@@ -12,7 +12,7 @@
# limitations under the License.
#
-- name: Install ORT
+- name: Install ORT/t3c
yum:
name:
- "{{ ort_pkg_name }}"
@@ -33,12 +33,13 @@
/opt/ort/supermicro_udev_mapper.pl
{%- endif -%}
dest: /bin/supermicro_udev_mapper.pl
+ remote_src: true
owner: root
group: root
mode: 0755
ignore_errors: true
-- name: Deploy ORT Crontab
+- name: Deploy ORT/t3c Crontab
template:
src: crontab.j2
dest: /etc/cron.d/ats
@@ -67,7 +68,7 @@
executable: "{{ lookup('pipe','command -v bash') }}"
cmd: >-
{%- if ort_version is not defined or ort_version == omit or ort_version >= '6.0.0-11351' -%}
- pkill -9 t3c || true; t3c apply --run-mode=badass --cache-host-name='{{ (ansible_nodename.split('.')) | first }}' -vv --traffic-ops-url='{{ ort_traffic_ops_url }}' --traffic-ops-user='{{ ort_traffic_ops_username }}' --traffic-ops-password='{{ ort_traffic_ops_password }}' --wait-for-parents=false 2>&1 | tee /tmp/trafficcontrol-cache-config/badass_out; exit ${PIPESTATUS[0]}
+ pkill -9 t3c || true; t3c apply --run-mode=badass --git=yes --cache-host-name='{{ (ansible_nodename.split('.')) | first }}' -vv --traffic-ops-url='{{ ort_traffic_ops_url }}' --traffic-ops-user='{{ ort_traffic_ops_username }}' --traffic-ops-password='{{ ort_traffic_ops_password }}' --wait-for-parents=false 2>&1 | tee /tmp/trafficcontrol-cache-config/badass_out; exit ${PIPESTATUS[0]}
{%- else -%}
pkill -9 _ort || true; traffic_ops_ort.pl -dispersion=0 --wait_for_parents=0 --login_dispersion=0 --retries=1 badass warn {{ ort_traffic_ops_url }} '{{ ort_traffic_ops_username }}:{{ ort_traffic_ops_password }}' 2>&1 | tee /tmp/badass_out; exit ${PIPESTATUS[0]}
{%- endif -%}
@@ -78,9 +79,72 @@
async: 1
poll: 0
+- name: Allow the host to go down
+ pause:
+ seconds: 60
+
- name: Wait for the reboot to complete
wait_for_connection:
- connect_timeout: 20
- sleep: 5
- delay: 5
- timeout: 300
+ connect_timeout: 40
+ sleep: 10
+ delay: 10
+ timeout: 600
+
+- name: Reset ATS Cache Data
+ block:
+ - name: Stop ATS gracefully
+ systemd:
+ name: trafficserver
+ state: stopped
+ ignore_errors: yes
+
+ - name: Ask ATS to destroy all its data nicely
+ command: /opt/trafficserver/bin/traffic_server -Cclear
+
+ - name: Get list of targeted ATS cache disks
+ shell: cat /opt/trafficserver/etc/trafficserver/storage.config | grep -v '#' | cut -d' ' -f1
+ register: cachedisk_results
+ changed_when: false
+
+ - name: Remove from fstab
+ lineinfile:
+ path: /etc/fstab
+ state: absent
+ regexp: "{{ item }}.*"
+ with_items: "{{ cachedisk_results.stdout_lines }}"
+
+ - name: Unmount the disk
+ command: "umount -l {{ item }}"
+ with_items: "{{ cachedisk_results.stdout_lines }}"
+ register: umountresults
+ failed_when: false
+ changed_when: "'not mounted' not in umountresults.stderr"
+
+ - name: Nuke the disk partition table
+ command: "dd if=/dev/zero of={{ item }} bs=2048 count=1"
+ with_items: "{{ cachedisk_results.stdout_lines }}"
+ register: ddresults
+ changed_when: "'2048 bytes (2.0 kB) copied' in ddresults.stderr"
+
+ - name: Restart ATS with clean cache disks
+ systemd:
+ name: trafficserver
+ state: started
+ when: ats_clear_data | default(false)
+
+- name: Ensure ATS is listening - 80
+ wait_for:
+ host: "{{ hostvars[inventory_hostname].ansible_host }}"
+ port: 80
+
+- name: Ensure ATS is listening - 443
+ wait_for:
+ host: "{{ hostvars[inventory_hostname].ansible_host }}"
+ port: 443
+ when: hostvars[inventory_hostname].component == "atsec"
+
+- name: Ensure Astats responds
+ uri:
+ url: http://localhost/_astats
+ validate_certs: false
+ when: hostvars[inventory_hostname].component == "atsec"
diff --git a/infrastructure/ansible/roles/dataset_loader/.gitignore b/infrastructure/ansible/roles/dataset_loader/.gitignore
index 888d365..95ab35d 100644
--- a/infrastructure/ansible/roles/dataset_loader/.gitignore
+++ b/infrastructure/ansible/roles/dataset_loader/.gitignore
@@ -16,3 +16,5 @@
# under the License.
#
profile.parameters.*
+ats_profile_diff_output.json
+ats_profile_diff_output.yml
diff --git a/infrastructure/ansible/roles/dataset_loader/README.md b/infrastructure/ansible/roles/dataset_loader/README.md
index 2d19fb8..eb3bfe6 100644
--- a/infrastructure/ansible/roles/dataset_loader/README.md
+++ b/infrastructure/ansible/roles/dataset_loader/README.md
@@ -64,11 +64,7 @@ Example Playbook
tasks:
- name: Load environment specific vars
include_vars:
- file: "{{ lookup('env', 'PWD') }}/ansible/vars.yml"
-
- - name: Load environment specific vault
- include_vars:
- file: "{{ lookup('env', 'PWD') }}/ansible/vault"
+ file: "{{ lookup('env', 'PWD') }}/ansible/vars.json"
no_log: true
- name: Deploy the Initial ATC Dataset
@@ -77,8 +73,8 @@ Example Playbook
vars:
load_dataset: true
dl_shallow_czf_url: http://examplewebserver.local/czf.json
- dl_allow_ip4: "{{ (['127.0.0.1','192.168.100.0/24'] + (groups['traffic_monitor'] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | list)) | join(',') }}"
- dl_allow_ip6: "{{ (['::1'] + (groups['traffic_monitor'] | map('extract', hostvars, ['ansible_default_ipv6', 'address']) | list)) | join(',') }}"
+ dl_allow_ip4: "{{ (['127.0.0.1','192.168.100.0/24'] + (dl_hosts_tm | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | list)) | join(',') }}"
+ dl_allow_ip6: "{{ (['::1'] + (dl_hosts_tm | map('extract', hostvars, ['ansible_default_ipv6', 'address']) | list)) | join(',') }}"
dl_to_url: "{{ to_url }}"
dl_ds_merged_cdns: "{{ dl_ds_default_cdns | combine(dl_ds_test_cdns) }}"
dl_ds_test_cdns:
diff --git a/infrastructure/ansible/roles/dataset_loader/analyze.ats.profiles.yml b/infrastructure/ansible/roles/dataset_loader/analyze.ats.profiles.yml
new file mode 100644
index 0000000..fcceeb7
--- /dev/null
+++ b/infrastructure/ansible/roles/dataset_loader/analyze.ats.profiles.yml
@@ -0,0 +1,505 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+- hosts: localhost
+ connection: local
+ gather_facts: No
+
+ module_defaults:
+ uri:
+ validate_certs: no
+ follow_redirects: all
+ return_content: yes
+ body_format: json
+ status_code: 200,400
+ timeout: 600
+ headers:
+ Cookie: "{{ dl_mojo_token.set_cookie | default(omit) }}"
+
+ vars:
+ exclution_file_path: "{{ playbook_dir }}/parameter.diff.exclusions.yml"
+
+ # Vars from the role defaults just so that things render properly
+ Target_cdn_delegation: foo
+ dl_anonymous_ip_url: foo
+ dl_anonymous_db_url: foo
+ dl_shallow_czf_url: foo
+ Target_cdn_delegation_fqdn: foo
+ dl_geolocation_url: foo
+ Target_cdn_name: foo
+ dl_allow_ip4: 1.1.1.1
+ dl_allow_ip6: ::1
+ cache_hardware_profile_index:
+ 0: 0
+ Target_hardware_profile:
+ value:
+ ram_cache_size: 0
+ primary_network_interface: eth0
+ network_bandwidth_limit: 100
+ dl_ds_reserved_bandwidth_percentage: 10
+ load_avg_limit: 10
+ target_xmlId: foo
+ dl_hosts_fakeorigin:
+ - foo
+ dl_atsec_ram_cache_max_obj_size_mb: 0
+ Target_hardware_profile_cache_disk_letters: foo
+ Target_hardware_profile_cache_disk_prefix: foo
+ Target_hardware_profile_ram_disk_letters: foo
+ Target_hardware_profile_ram_disk_prefix: foo
+
+ # Copypasta prevention
+ drop_value_query: "[].{configFile: configFile, name: name}"
+ drop_configFile_query: "[].{name: name, value: value}"
+ drop_value_regex: "([^ ]+ [^ ]+) (?:[^ ]+ .+)$"
+ target_host_fqdn: "{{ override_target_host_fqdn | default(((target_host_discovery|default({})).results|default({}))|to_json|from_json|json_query('[?rc == `0`].item|[0]')) }}"
+ base_host_fqdn: "{{ override_base_host_fqdn | default((base_host_discovery.results|default({}))|to_json|from_json|json_query('[?rc == `0`].item|[0]')) }}"
+ profile_id_query: "response[?name == `{{ profile_name }}`].id |[0]"
+ target_profile_id: "{{ get_all_profiles.stdout | from_json | json_query(profile_id_query) }}"
+ remap_path_query: "[?configFile == `remap.config` && name == `location` ].value|[0]"
+ trailing_slash: "{{ '/' if remap_path[-1] != '/' else '' }}"
+ parameter_filter_query: "[?!({% for e in parameter_diff_exclusions %}(contains(configFile,`{{ e.configFile }}`) && contains(name,`{{ e.name }}`)){%- if not loop.last %} || {% endif -%}{% endfor %})]"
+ scrub_query: "response[].{configFile: configFile,name: name,value: value}"
+ dl_ats_version_query: "[?configFile == `package` && name == `trafficserver` ].value|[0]"
+ host_stdout_filter_query: "[?item == `{{ host_fqdn }}`].stdout | [0]"
+ param_to_record: "{{ item.name }} {{ item.value }}"
+ item_valdrop: "{{ [item] | to_json | from_json | json_query(drop_value_query) }}"
+ base_value_query: "[?configFile == `{{ item.configFile }}` && name == `{{ item.name }}`].value | [0]"
+ outdiff:
+ configFile: "{{ item.configFile }}"
+ name: "{{ item.name }}"
+ value:
+ dataset_loader: "{{ base_value }}"
+ traffic_ops: "{{ item.value }}"
+
+ vars_files:
+ - defaults/main.yml
+ - "{{ exclution_file_path }}"
+
+ tasks:
+ - name: Get Data
+ block:
+ - name: Get TO Data
+ block:
+ - name: Get TO Cookie
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/user/login"
+ method: POST
+ body: '{ "u":"{{ dl_to_user }}", "p":"{{ dl_to_user_password }}" }'
+ headers:
+ Content-Type: "application/x-www-form-urlencoded"
+ register: dl_mojo_token
+ no_log: true
+ retries: 10
+ delay: 10
+
+ # https://github.com/ansible/ansible/issues/50300
+ #- name: Get All Profiles
+ # uri:
+ # url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
+ # method: GET
+ # register: get_all_profiles
+ # no_log: true
+ # retries: 10
+ # delay: 10
+ # until: get_all_profiles['status']|default(0) == 200
+
+ - name: Get all Profiles - with curl workaround
+ command: "curl -X GET -Lsk --fail -b '{{ dl_mojo_token.set_cookie }}' '{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles'"
+ args:
+ warn: no
+ register: get_all_profiles
+ changed_when: false
+ no_log: true
+ retries: 10
+ delay: 10
+
+ - name: Assert we have valid profiles to work with
+ assert:
+ that: "{{ item.test }}"
+ fail_msg: "{{ item.fail_msg }}"
+ quiet: yes
+ vars:
+ profile_names_query: "response[].name"
+ profile_names: "{{ get_all_profiles.stdout | from_json | json_query(profile_names_query) }}"
+ loop_control:
+ label: "{{ item.label }}"
+ with_items:
+ - test: TARGET_PROFILE in profile_names
+ fail_msg: "Target Profile '{{ TARGET_PROFILE }}' could not be located in TrafficOps"
+ label: Check Target Profile Existance
+ - test: BASE_PROFILE in profile_names
+ fail_msg: "Base Profile '{{ BASE_PROFILE }}' could not be located in TrafficOps"
+ label: Check Base Profile Existance
+
+ - name: Get Target Profile Parameters to diff
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ TARGET_PROFILE }}/parameters"
+ method: GET
+ register: get_target_profile_parameters
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_target_profile_parameters['status']|default(0) == 200
+
+ - name: Get Base Profile Parameters to diff
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ BASE_PROFILE }}/parameters"
+ method: GET
+ register: get_base_profile_parameters
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_base_profile_parameters['status']|default(0) == 200
+
+ - name: Get ATS defaults - Target
+ block:
+ - name: Get Servers with Target Profile
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/servers?profileId={{ target_profile_id }}"
+ method: GET
+ register: get_servers_with_target_profile
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_target_profile_parameters['status']|default(0) == 200
+ vars:
+ profile_name: "{{ TARGET_PROFILE }}"
+ when: override_target_host_fqdn is not defined
+
+ - name: Ensure Servers are attached to the target profile
+ assert:
+ that:
+ - (get_servers_with_target_profile.json.response | default([])) | length > 0
+ fail_msg: "There are no servers attached to the target profile '{{ TARGET_PROFILE }}' in TrafficOps"
+ quiet: yes
+ when: override_target_host_fqdn is not defined
+
+ - name: Find hosts that respond with TrafficServer installed - Target
+ command: "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Loglevel=ERROR -o BatchMode=yes -o ConnectTimeout=5 {{ dl_to_user }}@{{ item }} (/usr/sbin/pidof trafficserver || /usr/sbin/pidof traffic_server) >/dev/null && rpm -q trafficserver"
+ with_items: "{{ (get_servers_with_target_profile.json.response|to_json|from_json|json_query('[].join(`.`,[hostName, domainName])')|default([])) if override_target_host_fqdn is not defined else [override_target_host_fqdn] }}"
+ register: target_host_discovery
+ changed_when: false
+ ignore_errors: yes
+ when: (target_host_discovery|default(default_rc)).rc != 0
+ vars:
+ default_rc:
+ rc: 1
+
+ - name: Record the ATS version reported by the chosen host
+ set_fact:
+ target_ats_version: "{{ target_host_discovery.results | json_query(host_stdout_filter_query) }}"
+ vars:
+ host_fqdn: "{{ target_host_fqdn }}"
+
+ - name: Ensure at least one attached server to the target profile are valid
+ assert:
+ that:
+ - (target_host_discovery.results|json_query('[?rc == `0`].item')) | length > 0
+ fail_msg: "Of the servers attached to target profile '{{ TARGET_PROFILE }}' none are reachable, have ATS installed, and are running an ATS process"
+ success_msg: "Eligible target profile host found: {{ target_host_fqdn }}"
+
+ - name: Get defaults for ATS on target configuration
+ command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Loglevel=ERROR -o BatchMode=yes -o ConnectTimeout=5 {{ dl_to_user }}@{{ target_host_fqdn }} {{ remap_path }}{{ trailing_slash }}../../bin/traffic_ctl config defaults --records
+ register: target_ats_defaults
+ changed_when: false
+ vars:
+ remap_path: "{{ get_target_profile_parameters.json.response | to_json | from_json | json_query(remap_path_query) }}"
+
+ - name: Get ATS defaults - Base
+ block:
+ - name: Get Servers with Base Profile
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/servers?profileId={{ target_profile_id }}"
+ method: GET
+ register: get_servers_with_base_profile
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_target_profile_parameters['status']|default(0) == 200
+ vars:
+ profile_name: "{{ BASE_PROFILE }}"
+ when: override_base_host_fqdn is not defined
+
+ - name: Ensure Servers are attached to the base profile
+ assert:
+ that:
+ - (get_servers_with_base_profile.json.response | default([])) | length > 0
+ fail_msg: "There are no servers attached to the base profile '{{ BASE_PROFILE }}' in TrafficOps"
+ quiet: yes
+ when: override_base_host_fqdn is not defined
+
+ - name: Find hosts that respond with TrafficServer installed - Base
+ command: "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Loglevel=ERROR -o BatchMode=yes -o ConnectTimeout=5 {{ dl_to_user }}@{{ item }} (/usr/sbin/pidof trafficserver || /usr/sbin/pidof traffic_server) >/dev/null && rpm -q trafficserver"
+ with_items: "{{ (get_servers_with_base_profile.json.response|to_json|from_json|json_query('[].join(`.`,[hostName, domainName])')|default([])) if override_base_host_fqdn is not defined else [override_base_host_fqdn] }}"
+ register: base_host_discovery
+ changed_when: false
+ ignore_errors: yes
+ when: (base_host_discovery|default(default_rc)).rc != 0
+ vars:
+ default_rc:
+ rc: 1
+
+ - name: Record the ATS version reported by the chosen host
+ set_fact:
+ base_ats_version: "{{ base_host_discovery.results | json_query(host_stdout_filter_query) }}"
+ vars:
+ host_fqdn: "{{ base_host_fqdn }}"
+
+ - name: Ensure at least one attached server to the base profile are valid
+ assert:
+ that:
+ - (base_host_discovery.results|json_query('[?rc == `0`].item')) | length > 0
+ fail_msg: "Of the servers attached to base profile '{{ BASE_PROFILE }}' none are reachable, have ATS installed, and are running an ATS process"
+ success_msg: "Eligible base profile host found: {{ base_host_fqdn }}"
+
+ - name: Get defaults for ATS on base profile configuration
+ command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Loglevel=ERROR -o BatchMode=yes -o ConnectTimeout=5 {{ dl_to_user }}@{{ base_host_fqdn }} {{ remap_path }}{{ trailing_slash }}../../bin/traffic_ctl config defaults --records
+ register: base_ats_defaults
+ changed_when: false
+ vars:
+ remap_path: "{{ get_target_profile_parameters.json.response | to_json | from_json | json_query(remap_path_query) }}"
+
+ - name: Process TO Data
+ block:
+ - name: Scrub out the target runtime fields that break the diff
+ set_fact:
+ dl_ats_version: "{{ get_target_profile_parameters.json.response | to_json | from_json | json_query(dl_ats_version_query) }}"
+ target_params: "{{ get_target_profile_parameters.json | to_json | from_json | json_query(scrub_query) | sort(attribute='name,configFile,value') }}"
+
+ - name: Get Target Default Params for comparison
+ set_fact:
+ dsl_params_target: "{{ tiers[target_profile_tier] | sort(attribute='name,configFile,value') }}"
+ vars:
+ target_profile_description_query: "response[?name == `{{ TARGET_PROFILE | lower }}`].description|[0]"
+ target_profile_description: "{{ get_all_profiles.stdout | lower | to_json | from_json | json_query(target_profile_description_query) }}"
+ target_profile_tier: "{{ 'edge_params' if ('edge' in (TARGET_PROFILE | lower)) or ('edge' in target_profile_description) else 'mid_params' }}"
+ tiers:
+ edge_params: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.edge.common + dl_ds_default_profile_layers.ats.edge['v'+dl_ds_ats_major_version] }}"
+ mid_params: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.mid.common + dl_ds_default_profile_layers.ats.mid['v'+dl_ds_ats_major_version] }}"
+
+ - name: Scrub out the base runtime fields that break the diff
+ set_fact:
+ dl_ats_version: "{{ get_base_profile_parameters.json.response | to_json | from_json | json_query(dl_ats_version_query) }}"
+ base_params: "{{ get_base_profile_parameters.json | to_json | from_json | json_query(scrub_query) | sort(attribute='name,configFile,value') }}"
+
+ - name: Get Base Default Params for comparison
+ set_fact:
+ dsl_params_base: "{{ tiers[target_profile_tier] | sort(attribute='name,configFile,value') }}"
+ vars:
+ target_profile_description_query: "response[?name == `{{ BASE_PROFILE | lower }}`].description|[0]"
+ target_profile_description: "{{ get_all_profiles.stdout | lower | to_json | from_json | json_query(target_profile_description_query) }}"
+ target_profile_tier: "{{ 'edge_params' if ('edge' in (BASE_PROFILE | lower)) or ('edge' in target_profile_description) else 'mid_params' }}"
+ tiers:
+ edge_params: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.edge.common + dl_ds_default_profile_layers.ats.edge['v'+dl_ds_ats_major_version] }}"
+ mid_params: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.mid.common + dl_ds_default_profile_layers.ats.mid['v'+dl_ds_ats_major_version] }}"
+
+ - name: Generate Profile Parameter Diff - Target
+ block:
+ - name: Compute diff
+ set_fact:
+ params_missing_from_target_set: "{{ dsl_params_target | difference(target_params) | to_json | from_json | json_query(parameter_filter_query) }}"
+ params_missing_from_dsl_set_in_target: "{{ target_params | difference(dsl_params_target) | to_json | from_json | json_query(parameter_filter_query) }}"
+ params_missing_from_target_set_valdrop: "{{ dsl_params_target | difference(target_params) | to_json | from_json | json_query(parameter_filter_query) | to_json | from_json | json_query(drop_value_query) }}"
+ params_missing_from_dsl_set_in_target_valdrop: "{{ target_params | difference(dsl_params_target) | to_json | from_json | json_query(parameter_filter_query) | to_json | from_json | json_query(drop_value_query) }}"
+
+ - name: Process diff - dsl -> target
+ set_fact:
+ params_missing_from_target_in_dsl: "{{ ((params_missing_from_target_in_dsl | default([])) + [item]) if item_valdrop|intersect(params_missing_from_target_set_valdrop) == [] else ((params_missing_from_target_in_dsl | default([])) + []) }}"
+ params_changed_from_target_set_in_dsl: "{{ ((params_changed_from_target_set_in_dsl | default([])) + [item]) if item_valdrop|intersect(params_missing_from_target_set_valdrop) != [] else ((params_changed_from_target_set_in_dsl | default([])) + []) }}"
+ with_items: "{{ params_missing_from_dsl_set_in_target }}"
+
+ - name: Process diff - target -> dsl
+ set_fact:
+ params_missing_from_dsl_in_target: "{{ ((params_missing_from_dsl_in_target | default([])) + [item]) if item_valdrop|intersect(params_missing_from_dsl_set_in_target_valdrop) == [] else ((params_missing_from_dsl_in_target | default([])) + []) }}"
+ params_changed_from_dsl_set_in_target: "{{ ((params_changed_from_dsl_set_in_target | default([])) + [item]) if item_valdrop|intersect(params_missing_from_dsl_set_in_target_valdrop) != [] else ((params_changed_from_dsl_set_in_target | default([])) + []) }}"
+ with_items: "{{ params_missing_from_target_set }}"
+
+ - name: Render the differences in a more useful way
+ set_fact:
+ param_differences_in_target: "{{ (param_differences_in_target | default([])) + [outdiff] }}"
+ with_items: "{{ params_changed_from_target_set_in_dsl }}"
+ vars:
+ base_value: "{{ params_changed_from_dsl_set_in_target | to_json | from_json | json_query(base_value_query) }}"
+
+ - name: Generate Profile Parameter Diff - Base
+ block:
+ - name: Compute diff
+ set_fact:
+ params_missing_from_base_set: "{{ dsl_params_base | difference(base_params) | to_json | from_json | json_query(parameter_filter_query) }}"
+ params_missing_from_dsl_set_in_target_in_base: "{{ base_params | difference(dsl_params_base) | to_json | from_json | json_query(parameter_filter_query) }}"
+ params_missing_from_base_set_valdrop: "{{ dsl_params_base | difference(base_params) | to_json | from_json | json_query(parameter_filter_query) | to_json | from_json | json_query(drop_value_query) }}"
+ params_missing_from_dsl_set_in_target_in_base_valdrop: "{{ base_params | difference(dsl_params_base) | to_json | from_json | json_query(parameter_filter_query) | to_json | from_json | json_query(drop_value_query) }}"
+
+ - name: Process diff - defaults -> base
+ set_fact:
+ params_missing_from_base_in_dsl: "{{ ((params_missing_from_base_in_dsl | default([])) + [item]) if item_valdrop|intersect(params_missing_from_base_set_valdrop) == [] else ((params_missing_from_base_in_dsl | default([])) + []) }}"
+ params_changed_from_base_set_in_dsl: "{{ ((params_changed_from_base_set_in_dsl | default([])) + [item]) if item_valdrop|intersect(params_missing_from_base_set_valdrop) != [] else ((params_changed_from_base_set_in_dsl | default([])) + []) }}"
+ with_items: "{{ params_missing_from_dsl_set_in_target_in_base }}"
+
+ - name: Process diff - base -> defaults
+ set_fact:
+ params_missing_from_dsl_in_base: "{{ ((params_missing_from_dsl_in_base | default([])) + [item]) if item_valdrop|intersect(params_missing_from_dsl_set_in_target_in_base_valdrop) == [] else ((params_missing_from_dsl_in_base | default([])) + []) }}"
+ params_changed_from_dsl_set_in_base: "{{ ((params_changed_from_dsl_set_in_base | default([])) + [item]) if item_valdrop|intersect(params_missing_from_dsl_set_in_target_in_base_valdrop) != [] else ((params_changed_from_dsl_set_in_base | default([])) + []) }}"
+ with_items: "{{ params_missing_from_base_set }}"
+
+ - name: Render the differences in a more useful way
+ set_fact:
+ param_differences_in_base: "{{ (param_differences_in_base | default([])) + [outdiff] }}"
+ with_items: "{{ params_changed_from_base_set_in_dsl }}"
+ vars:
+ base_value: "{{ params_changed_from_dsl_set_in_base | to_json | from_json | json_query(base_value_query) }}"
+
+ - name: Generate ATS Default Diff
+ block:
+ - name: Compute Diff
+ set_fact:
+ defaults_missing_from_base_ats: "{{ base_ats_defaults.stdout_lines | difference(target_ats_defaults.stdout_lines) }}"
+ defaults_missing_from_target_ats: "{{ target_ats_defaults.stdout_lines | difference(base_ats_defaults.stdout_lines) }}"
+ defaults_missing_from_base_ats_valdrop: "{{ (base_ats_defaults.stdout_lines | difference(target_ats_defaults.stdout_lines)) | map('regex_replace',drop_value_regex,'\\1') | list }}"
+ defaults_missing_from_target_ats_valdrop: "{{ (target_ats_defaults.stdout_lines | difference(base_ats_defaults.stdout_lines)) | map('regex_replace',drop_value_regex,'\\1') | list }}"
+
+ - name: Process diff - base -> target
+ set_fact:
+ ats_defaults_missing_from_target: "{{ ((ats_defaults_missing_from_target | default([])) + [item]) if ([item_valdrop_ats])|intersect(defaults_missing_from_target_ats_valdrop) == [] else ((ats_defaults_missing_from_target | default([])) + []) }}"
+ ats_defaults_changed_from_target: "{{ ((ats_defaults_changed_from_target | default([])) + [item]) if ([item_valdrop_ats])|intersect(defaults_missing_from_target_ats_valdrop) != [] else ((ats_defaults_changed_from_target | default([])) + []) }}"
+ with_items: "{{ defaults_missing_from_base_ats }}"
+ vars:
+ item_valdrop_ats: "{{ item | regex_replace(drop_value_regex,'\\1') }}"
+
+ - name: Process diff - target -> base
+ set_fact:
+ ats_defaults_missing_from_base: "{{ ((ats_defaults_missing_from_base | default([])) + [item]) if ([item_valdrop_ats])|intersect(defaults_missing_from_base_ats_valdrop) == [] else ((ats_defaults_missing_from_base | default([])) + []) }}"
+ ats_defaults_changed_from_base: "{{ ((ats_defaults_changed_from_base | default([])) + [item]) if ([item_valdrop_ats])|intersect(defaults_missing_from_base_ats_valdrop) != [] else ((ats_defaults_changed_from_base | default([])) + []) }}"
+ with_items: "{{ defaults_missing_from_target_ats }}"
+ vars:
+ item_valdrop_ats: "{{ item | regex_replace(drop_value_regex,'\\1') }}"
+
+ - name: Render the differences in a more useful way
+ set_fact:
+ ats_default_differences_between_base_and_target: "{{ (ats_default_differences_between_base_and_target | default([])) + [outdiff_ats] }}"
+ with_items: "{{ ats_defaults_changed_from_target | default([]) }}"
+ vars:
+ item_valdrop_ats: "{{ item | regex_replace(drop_value_regex,'\\1') }}"
+ base_regex: "^{{ item_valdrop_ats }}.*$"
+ base_value: "{{ params_changed_from_dsl_set_in_target | to_json | from_json | json_query(base_value_query) }}"
+ outdiff_ats:
+ base_value: "{{ item }}"
+ target_value: "{{ ats_defaults_changed_from_base | select('match', base_regex) | first }}"
+
+ - name: Get Redundant parameters for cleanup
+ block:
+ - name: Compute redundant target parameters against TO
+ set_fact:
+ redundant_target_parameters: "{{ ((redundant_target_parameters | default([])) + [item]) if ([param_to_record] | intersect(target_ats_defaults.stdout_lines) != []) else (redundant_target_parameters | default([])) + [] }}"
+ with_items: "{{ target_params | to_json | from_json | json_query(parameter_filter_query) }}"
+ loop_control:
+ label: "configFile: {{ item.configFile }}, name: {{ item.name }}"
+
+ - name: Compute redundant base parameters against TO
+ set_fact:
+ redundant_base_parameters: "{{ ((redundant_base_parameters | default([])) + [item]) if ([param_to_record] | intersect(base_ats_defaults.stdout_lines) != []) else (redundant_base_parameters | default([])) + [] }}"
+ with_items: "{{ base_params | to_json | from_json | json_query(parameter_filter_query) }}"
+ loop_control:
+ label: "configFile: {{ item.configFile }}, name: {{ item.name }}"
+
+ - name: Compute redundant dataset loader parameters against target
+ set_fact:
+ redundant_target_parameters_dsl: "{{ ((redundant_target_parameters_dsl | default([])) + [item]) if ([param_to_record] | intersect(target_ats_defaults.stdout_lines) != []) else (redundant_target_parameters_dsl | default([])) + [] }}"
+ with_items: "{{ dsl_params_target | to_json | from_json | json_query(parameter_filter_query) }}"
+ loop_control:
+ label: "configFile: {{ item.configFile }}, name: {{ item.name }}"
+
+ - name: Compute redundant dataset loader parameters against base
+ set_fact:
+ redundant_base_parameters_dsl: "{{ ((redundant_base_parameters_dsl | default([])) + [item]) if ([param_to_record] | intersect(base_ats_defaults.stdout_lines) != []) else (redundant_base_parameters_dsl | default([])) + [] }}"
+ with_items: "{{ dsl_params_base| to_json | from_json | json_query(parameter_filter_query) }}"
+ loop_control:
+ label: "configFile: {{ item.configFile }}, name: {{ item.name }}"
+
+ - name: Process redundant and changed default parameters
+ set_fact:
+ redundant_parameters_with_target_params_and_defaults_included_in_traffic_ops: "{{ redundant_target_parameters | default([]) }}"
+ redundant_parameters_with_target_params_and_defaults_included_in_dataset_loader: "{{ (redundant_target_parameters_dsl | default([])) | intersect(target_params) }}"
+ redundant_parameters_with_base_params_and_defaults_included_in_traffic_ops: "{{ redundant_base_parameters | default([]) }}"
+ redundant_parameters_with_base_params_and_defaults_included_in_dataset_loader: "{{ (redundant_base_parameters_dsl | default([])) | intersect(base_params) }}"
+ redundant_parameters_in_both_base_and_target: "{{ (redundant_target_parameters | default([])) | intersect((redundant_base_parameters | default([]))) }}"
+ redundant_parameters_in_both_base_and_target_in_dataset_loader: "{{ ((redundant_base_parameters_dsl | default([])) | intersect(base_params) | default([])) | intersect(((redundant_target_parameters_dsl | default([])) | intersect(target_params) | default([]))) }}"
+
+ - name: Process changed values between base and target without redundancy
+ set_fact:
+ parameter_values_changed_from_base_to_target: "{{ base_params | intersect(target_params) | difference(redundant_parameters_in_both_base_and_target) | difference(redundant_parameters_with_base_params_and_defaults_included_in_traffic_ops) }}"
+ parameter_values_changed_from_target_to_base: "{{ target_params | intersect(base_params) | difference(redundant_parameters_in_both_base_and_target) | difference(redundant_parameters_with_target_params_and_defaults_included_in_traffic_ops) }}"
+
+ - name: Process missing parameter redundancy - target
+ set_fact:
+ params_missing_from_target_in_dataset_loader: "{{ ((params_missing_from_target_in_dataset_loader | default([])) + [item]) if ([param_to_record])|intersect(target_ats_defaults.stdout_lines) == [] else ((params_missing_from_target_in_dataset_loader | default([])) + []) }}"
+ with_items: "{{ params_missing_from_dsl_in_target | default([]) | difference(parameter_values_changed_from_target_to_base) }}"
+
+ - name: Process missing parameter redundancy - dataset_loader/target
+ set_fact:
+ params_missing_from_dataset_loader_in_target: "{{ ((params_missing_from_dataset_loader_in_target | default([])) + [item]) if ([param_to_record])|intersect(target_ats_defaults.stdout_lines) == [] else ((params_missing_from_dataset_loader_in_target | default([])) + []) }}"
+ with_items: "{{ params_missing_from_dsl_in_target | default([]) | difference(parameter_values_changed_from_base_to_target) }}"
+
+ - name: Process missing parameter redundancy - base
+ set_fact:
+ params_missing_from_base_in_dataset_loader: "{{ ((params_missing_from_base_in_dataset_loader | default([])) + [item]) if ([param_to_record])|intersect(base_ats_defaults.stdout_lines) == [] else ((params_missing_from_base_in_dataset_loader | default([])) + []) }}"
+ with_items: "{{ params_missing_from_dsl_in_base | default([]) | difference(parameter_values_changed_from_target_to_base) }}"
+
+ - name: Process missing parameter redundancy - dataset_loader/base
+ set_fact:
+ params_missing_from_dataset_loader_in_base: "{{ ((params_missing_from_dataset_loader_in_base | default([])) + [item]) if ([param_to_record])|intersect(base_ats_defaults.stdout_lines) == [] else ((params_missing_from_dataset_loader_in_base | default([])) + []) }}"
+ with_items: "{{ params_missing_from_base_in_dsl | default([]) | difference(parameter_values_changed_from_base_to_target) }}"
+
+ - name: Render output to file
+ copy:
+ content: "{{ output | to_nice_json(indent=2) }}"
+ dest: "{{ output_path | default(default_output_path) }}"
+ mode: 0600
+ vars:
+ default_output_path: "{{ playbook_dir }}/ats_profile_diff_output.json"
+ output:
+ target_profile: "{{ TARGET_PROFILE }}"
+ base_profile: "{{ BASE_PROFILE }}"
+ target_host: "{{ target_host_fqdn }}"
+ base_host: "{{ base_host_fqdn }}"
+ target_ats_version: "{{ target_ats_version }}"
+ base_ats_version: "{{ base_ats_version }}"
+ traffic_ops:
+ redundant_parameters_with_target_params_and_defaults_included_in_traffic_ops_only: "{{ redundant_parameters_with_target_params_and_defaults_included_in_traffic_ops | difference(redundant_parameters_in_both_base_and_target) }}"
+ redundant_parameters_with_base_params_and_defaults_included_in_traffic_ops_only: "{{ redundant_parameters_with_base_params_and_defaults_included_in_traffic_ops | difference(redundant_parameters_in_both_base_and_target) }}"
+ redundant_parameters_in_both_base_and_target_in_traffic_ops: "{{ redundant_parameters_in_both_base_and_target }}"
+ dataset_loader:
+ param_value_differences_between_dataset_loader_and_target: "{{ param_differences_in_target | default([]) }}"
+ param_value_differences_between_dataset_loader_and_base: "{{ param_differences_in_base | default([]) }}"
+ params_missing_from_target_in_dataset_loader: "{{ params_missing_from_target_in_dataset_loader | default([]) }}"
+ params_missing_from_dataset_loader_in_target: "{{ params_missing_from_dataset_loader_in_target | default([]) }}"
+ params_missing_from_base_in_dataset_loader: "{{ params_missing_from_base_in_dataset_loader | default([]) }}"
+ params_missing_from_dataset_loader_in_base: "{{ params_missing_from_dataset_loader_in_base | default([]) }}"
+ redundant_parameters_with_target_params_and_defaults_included_in_dataset_loader_only: "{{ redundant_parameters_with_target_params_and_defaults_included_in_dataset_loader | difference(redundant_parameters_in_both_base_and_target_in_dataset_loader) | default([]) }}"
+ redundant_parameters_with_base_params_and_defaults_included_in_dataset_loader_only: "{{ redundant_parameters_with_base_params_and_defaults_included_in_dataset_loader | difference(redundant_parameters_in_both_base_and_target_in_dataset_loader) | default([]) }}"
+ redundant_parameters_in_both_base_and_target_in_dataset_loader: "{{ redundant_parameters_in_both_base_and_target_in_dataset_loader }}"
+ ats:
+ ats_default_differences_between_base_and_target_between_base_and_target: "{{ ats_default_differences_between_base_and_target | default([]) }}"
+ ats_defaults_missing_from_target_in_base: "{{ ats_defaults_missing_from_target | default([]) }}"
+ ats_defaults_missing_from_base_in_target: "{{ ats_defaults_missing_from_base | default([]) }}"
+
+ - name: Render current dataset loader values as plain diff
+ copy:
+ content: "{{ output | to_nice_yaml(indent=2) }}"
+ dest: "{{ output_path | default(default_output_path) }}"
+ mode: 0600
+ vars:
+ default_output_path: "{{ playbook_dir }}/ats_profile_diff_output.yml"
+ output: "{{ dsl_params_target | sort(attribute='configFile,name,value') }}"
diff --git a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml
index 7f9f00d..987b634 100644
--- a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml
+++ b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml
@@ -42,31 +42,55 @@ dl_ats_version: "7.1.4-2.el7"
dl_mojo_token:
# Information regarding how large the ATS ram cache ought to be on an edge tier cache
dl_atsec_ram_cache_size_percentage: 18
-dl_atsec_ram_system_total_mb: 20000 # should be replaced by the `ansible_memtotal_mb` fact of a cache, assumed 20G
-dl_atsec_ram_cache_size_mb: "{{ dl_atsec_ram_cache_size_percentage / 100 * ( dl_atsec_ram_system_total_mb | float ) }}"
# Largest object size to be held in the ram cache before going straght to block devices on an edge tier cache
dl_atsec_ram_cache_max_obj_size_mb: 1073.741824 # 1 GiB
# Information regarding how large the ATS ram cache ought to be on an mid tier cache
dl_atsmid_ram_cache_size_percentage: "{{ dl_atsec_ram_cache_size_percentage }}"
-dl_atsmid_ram_system_total_mb: "{{ dl_atsec_ram_system_total_mb }}" # should be replaced by the `ansible_memtotal_mb` fact of a cache
-dl_atsmid_ram_cache_size_mb: "{{ dl_atsmid_ram_cache_size_percentage / 100 * ( dl_atsmid_ram_system_total_mb | float ) }}"
# Largest object size to be held in the ram cache before going straght to block devices on a mid tier cache
dl_atsmid_ram_cache_max_obj_size_mb: "{{ dl_atsec_ram_cache_max_obj_size_mb }}"
-# Information regarding how ramdisks on an edge tier cache are identified
-dl_atsec_ram_drive_prefix: "/dev/ram"
-dl_atsec_ram_drive_letters: "0,1,2"
-# Information regarding how ramdisks on a mid tier cache are identified
-dl_atsmid_ram_drive_prefix: "/dev/ram"
-dl_atsmid_ram_drive_letters: "0,1,2"
# Information regarding how large the Grove ram cache ought to be
dl_grove_ram_cache_size_percentage: 50
-dl_grove_ram_system_total_mb: 20000
-dl_grove_ram_cache_size_mb: "{{ dl_grove_ram_cache_size_percentage / 100 * ( dl_grove_ram_system_total_mb | float ) }}"
+# What block device prefixes should be examined for partitions and maybe used as cache disks as reported by ansible_facts.devices
+dl_ds_merged_cache_block_device_prefix_whitelist: "{{ dl_ds_default_cache_block_device_prefix_whitelist }}"
+dl_ds_default_cache_block_device_prefix_whitelist:
+ - vd
+ - hd
+ - sd
+ - nvme
+# What block device prefixes should be examinded for ram disks to use with caches
+dl_ds_merged_cache_ram_device_prefix_whitelist: "{{ dl_ds_default_cache_ram_device_prefix_whitelist }}"
+dl_ds_default_cache_ram_device_prefix_whitelist:
+ - ram
+# What percentage of available interface speed should be available to caches before becoming unhealthy
+dl_ds_reserved_bandwidth_percentage: 90
+
+# Handle to provide your own custom hardware information
+# Defining this variable disables automatic detection
+#dl_ds_cache_hardware_info:
+# cdn-atsec-01.kabletown.invalid:
+# cache_disks:
+# - vdb
+# ram_cache_size: 5762160000
+# ram_disks:
+# - ram0
+# - ram1
+# - ram2
+
+# Hardcoded names of groups in the tasks are a bad idea, but this allows people to change them as needed to match their inventory
+dl_hosts_fakeorigin: "{{ groups['fakeorigin'] | default([],true) }}"
+dl_hosts_tm: "{{ groups['traffic_monitor'] | default([],true) }}"
+dl_hosts_tr: "{{ groups['traffic_router'] | default([],true) }}"
+dl_hosts_to: "{{ groups['traffic_ops'] | default([],true) }}"
+dl_hosts_mso_alias: "{{ groups['mso_parent_alias'] | default([],true) }}"
+dl_hosts_atsmid: "{{ groups['atsmid'] | default([],true) }}"
+dl_hosts_atsec: "{{ groups['atsec'] | default([],true) }}"
+dl_hosts_grove: "{{ groups['grove'] | default([],true) }}"
+dl_hosts_all: "{{ groups['all'] | default([],true) }}"
# TO CDN
dl_ds_merged_cdns: "{{ dl_ds_default_cdns }}"
dl_ds_default_cdns:
- MKGA:
+ mkga:
name: Kabletown2.0
dnssecEnabled: false
@@ -272,43 +296,22 @@ dl_ds_default_divisions:
- tr-west
- multi-site-org-west
-# Mapping of eligible TO Profile prefixes to inventory hostvar component name
+# Mapping of eligible TO Profile regex to inventory hostvar component name
dl_ds_merged_profile_prefix_ansible_component_map: "{{ dl_ds_default_profile_prefix_ansible_component_map }}"
dl_ds_default_profile_prefix_ansible_component_map:
- grove: EDGE_GROVE_
- atsec: EDGE_ATS_
- atsmid: MID_ATS_
- fakeorigin: MSO_
- mso_parent_alias: MSO_
- influxdb: INFLUXDB
- riak: RIAK
- traffic_monitor: RASCAL_
- traffic_ops: TRAFFIC_OPS
- traffic_opsdb: TRAFFIC_OPS_DB
- traffic_portal: TRAFFIC_PORTAL
- traffic_router: CCR_
- traffic_stats: TRAFFIC_STATS
-
-# Exclusion papping of eligible TO Profile suffixes to inventory hostvar component name
-dl_ds_merged_profile_blacklist_ansible_component_map: "{{ dl_ds_default_profile_blacklist_ansible_component_map }}"
-dl_ds_default_profile_blacklist_ansible_component_map:
- grove:
- atsec:
- atsmid:
- fakeorigin:
- mso_parent_alias:
- influxdb:
- riak:
- traffic_monitor:
- traffic_ops:
- - _DB
- traffic_opsdb:
- - active
- - standby
- - replica
- traffic_portal:
- traffic_router:
- traffic_stats:
+ grove: '(?i)^EDGE_GROVE_.*'
+ atsec: "(?i)^EDGE_ATS_{{ dl_ds_ats_major_version }}_.*"
+ atsmid: "(?i)^MID_ATS_{{ dl_ds_ats_major_version }}_.*"
+ fakeorigin: '(?i)^MSO_.*'
+ mso_parent_alias: '(?i)^MSO_.*'
+ influxdb: '(?i)^INFLUXDB$'
+ riak: '(?i)^RIAK.*'
+ traffic_monitor: '(?i)^RASCAL_.*'
+ traffic_ops: '(?i)^TRAFFIC_OPS$'
+ traffic_opsdb: '(?i)^TRAFFIC_OPS_DB$'
+ traffic_portal: '(?i)^TRAFFIC_PORTAL$'
+ traffic_router: '(?i)^CCR_.*'
+ traffic_stats: '(?i)^TRAFFIC_STATS$'
# TO Servers
dl_ds_merged_servers: "{{ dl_ds_default_servers }}"
@@ -316,21 +319,83 @@ dl_ds_default_servers:
server.kabletown.invalid:
tcpPort: 80
httpsPort: 443
- xmppId:
- xmppPasswd:
- ip6Address:
- ip6Gateway:
- rack: M2
- mgmtIpAddress:
- mgmtIpNetmask:
- mgmtIpGateway:
- iloIpAddress:
- iloIpNetmask:
- iloIpGateway:
- iloUsername:
- iloPassword:
+ rack: M1
routerHostName: 1hop.router.kabletown.invalid
routerPortName: 1/1/1/1
+ riak.kabletown.invalid:
+ tcpPort: 8087 # Note: this is actually wired in via TO cdn.conf if it ever needs to be different, it's adjusted here for human clarity. It's also the Riak protobuf port, not http rest port which is defaulted to 8098 and probably disabled.
+ httpsPort: 8088 # Note: this isn't actually used anywhere, it's just for human clarity. This is the default for the rest https interface for things like SOLR or curl.
+ rack: M2
+ routerHostName: 2hop.router.kabletown.invalid
+ routerPortName: 2/1/1/1
+ influxdb.kabletown.invalid:
+ tcpPort: 8086 # Note: This is used by TO as a fallback on https or http
+ httpsPort: 8086 # Note: This is used by TO for https connections
+ rack: M3
+ routerHostName: 3hop.router.kabletown.invalid
+ routerPortName: 3/1/1/1
+ traffic_monitor.kabletown.invalid:
+ tcpPort: 80 # Note: This may be used by traffic_stats and traffic router
+ httpsPort: 443 # Note: This may be used by traffic_stats and traffic router
+ rack: M4
+ routerHostName: 4hop.router.kabletown.invalid
+ routerPortName: 4/1/1/1
+ atsec.kabletown.invalid:
+ tcpPort: 80 # Note: This may be used by traffic_monitor for astats
+ httpsPort: 443 # Note: This may be used by traffic_monitor for astats
+ rack: M4
+ routerHostName: 4hop.router.kabletown.invalid
+ routerPortName: 4/1/1/1
+ atsmid.kabletown.invalid:
+ tcpPort: 80 # Note: This may be used by traffic_monitor for astats
+ httpsPort: 443 # Note: This may be used by traffic_monitor for astats
+ rack: M5
+ routerHostName: 5hop.router.kabletown.invalid
+ routerPortName: 5/1/1/1
+ grove.kabletown.invalid:
+ tcpPort: 80 # Note: This may be used by traffic_monitor for astats
+ httpsPort: 443 # Note: This may be used by traffic_monitor for astats
+ rack: M6
+ routerHostName: 6hop.router.kabletown.invalid
+ routerPortName: 6/1/1/1
+ fakeorigin.kabletown.invalid:
+ tcpPort: 80 # Note: This may be used by TO ATS Config generation for Multi-site origins
+ rack: M6
+ routerHostName: 6hop.router.kabletown.invalid
+ routerPortName: 6/1/1/1
+ mso_parent_alias.kabletown.invalid:
+ tcpPort: 80 # Note: This may be used by TO ATS Config generation for Multi-site origins
+ rack: M7
+ routerHostName: 7hop.router.kabletown.invalid
+ routerPortName: 7/1/1/1
+ traffic_opsdb.kabletown.invalid:
+ tcpPort: 5432 # Note: This is actually wired in via TO config files, but is here for human clarity
+ rack: M8
+ routerHostName: 8hop.router.kabletown.invalid
+ routerPortName: 8/1/1/1
+ traffic_ops.kabletown.invalid:
+ tcpPort: 80 # Note: This is actually wired in via TO config files, but is here for human clarity
+ httpsPort: 443 # Note: This is actually wired in via TO config files, but is here for human clarity
+ rack: M9
+ routerHostName: 9hop.router.kabletown.invalid
+ routerPortName: 9/1/1/1
+ traffic_portal.kabletown.invalid:
+ httpsPort: 443 # Note: This is actually wired in via TP config files, but is here for human clarity
+ rack: M10
+ routerHostName: 10hop.router.kabletown.invalid
+ routerPortName: 10/1/1/1
+ traffic_router.kabletown.invalid:
+ tcpPort: 80 # Note: This is actually wired in via TR server.xml config file, but is here for human clarity. Note that default port 53 is also used for DNS.
+ httpsPort: 443 # Note: This is actually wired in via TR server.xml config file, but is here for human clarity. Note that default port 53 is also used for DNS.
+ rack: M11
+ routerHostName: 11hop.router.kabletown.invalid
+ routerPortName: 11/1/1/1
+ influxrelay.kabletown.invalid:
+ tcpPort: 9086 # Note: This is actually wired in via influx-relay config files, but is here for human clarity
+ httpsPort: 9087 # Note: This is actually wired in via influx-relay config files, but is here for human clarity
+ rack: M12
+ routerHostName: 12hop.router.kabletown.invalid
+ routerPortName: 12/1/1/1
# TO Profiles (non-template) and associated parameters
dl_ds_merged_profiles: "{{ dl_ds_default_profiles }}"
@@ -606,6 +671,633 @@ dl_ds_default_profiles:
value: tps_total
secure: 0
+dl_ds_ats_major_version: "{{ 8 if dl_ats_version is version('8','>=') else 7 }}"
+
+# ATS Profiles are huge, we should normalize them a big to make them more understandable
+dl_ds_default_profile_layers:
+ ats:
+ edge:
+ common:
+ - name: location
+ configFile: bg_fetch.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: location
+ configFile: drop_qstring.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: algorithm
+ configFile: parent.config
+ value: consistent_hash
+ - name: qstring
+ configFile: parent.config
+ value: ignore
+ - name: CONFIG proxy.config.accept_threads
+ configFile: records.config
+ value: INT 5
+ - name: CONFIG proxy.config.cache.hostdb.sync_frequency
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.cache.http.compatibility.4-2-0-fixup
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.cache.ram_cache_cutoff
+ configFile: records.config
+ value: "INT {{ (dl_atsec_ram_cache_max_obj_size_mb | float * 1000000) | int }}"
+ - name: CONFIG proxy.config.cache.read_while_writer.max_retries
+ configFile: records.config
+ value: INT 3
+ - name: CONFIG proxy.config.env_prep
+ configFile: records.config
+ value: STRING example_prep.sh
+ - name: CONFIG proxy.config.hostdb.serve_stale_for
+ configFile: records.config
+ value: INT 20
+ - name: CONFIG proxy.config.http.origin_max_connections
+ configFile: records.config
+ value: INT 500
+ - name: CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.http.parent_proxy.per_parent_connect_attempts
+ configFile: records.config
+ value: INT 1
+ - name: CONFIG proxy.config.http.parent_proxy.total_connect_attempts
+ configFile: records.config
+ value: INT 3
+ - name: CONFIG proxy.config.http.server_ports
+ configFile: records.config
+ value: STRING 80 80:ipv6 443:proto=http:ssl 443:ipv6:proto=http:ssl
+ - name: location
+ configFile: set_dscp_0.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_10.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_12.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_14.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_16.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_18.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_20.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_22.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_24.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_26.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_28.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_30.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_32.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_34.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_36.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_37.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_38.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_40.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_48.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_56.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: set_dscp_8.config
+ value: "/opt/trafficserver/etc/trafficserver/dscp"
+ - name: location
+ configFile: ssl_multicert.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: location
+ configFile: anymap_hdr_rw.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: data
+ configFile: anymap_hdr_rw.config
+ value: cond %{SEND_REQUEST_HDR_HOOK} __RETURN__ add-header FAKEORIGIN-ATS-ANYMAP-GLOBAL '%<cque>' __RETURN__ add-header FAKEORIGIN-ATS-ANYMAP-ORIGINAL-REQUESTOR '%<chi>' __RETURN__ cond %{SEND_RESPONSE_HDR_HOOK} __RETURN__ add-header ATS_ANYMAP_GLOBAL 'Anymap_Global_Match' [L]
+ v7:
+ - name: LogFormat.Format
+ configFile: logging.config
+ value: '%<cqtq> chi=%<chi> phn=%<phn> php=%<php> shn=%<shn> url=%<cquuc> cqhm=%<cqhm> cqhv=%<cqpv> pssc=%<pssc> ttms=%<ttms> b=%<pscl> sssc=%<sssc> sscl=%<sscl> cfsc=%<cfsc> pfsc=%<pfsc> crc=%<crc> phr=%<phr> pqsn=%<pqsn> uas=\"%<{User-Agent}cqh>\" xmt=\"%<{X-MoneyTrace}cqh>\" svc=%<{X-CDN-SVC}cqh>'
+ - name: remap_stats.so
+ configFile: plugin.config
+ value: ''
+ v8:
+ - name: remap_stats.so -p
+ configFile: plugin.config
+ value: ''
+ # Default changed between ATS 7 & 8
+ - name: CONFIG proxy.config.ssl.server.multicert.exit_on_load_fail
+ configFile: records.config
+ value: INT 0
+ mid:
+ common:
+ - name: location
+ configFile: 40-ats.rules
+ value: "/etc/udev/rules.d/"
+ - name: udev_syncds
+ configFile: 40-ats.rules
+ value: 'KERNEL==\"sd*\", DRIVERS==\"mpt3sas\", PROGRAM=\"/bin/supermicro_udev_mapper.pl %k\", SYMLINK+=\"ats/%c\", OWNER=\"ats\"'
+ - name: weight
+ configFile: parent.config
+ value: '1.0'
+ - name: CONFIG proxy.config.accept_threads
+ configFile: records.config
+ value: INT 3
+ - name: CONFIG proxy.config.cache.ram_cache_cutoff
+ configFile: records.config
+ value: "INT {{ (dl_atsmid_ram_cache_max_obj_size_mb | float * 1000000) | int }}"
+ - name: CONFIG proxy.config.hostdb.serve_stale_for
+ configFile: records.config
+ value: INT 12
+ - name: CONFIG proxy.config.hostdb.ttl_mode
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.http.origin_max_connections
+ configFile: records.config
+ value: INT 1500
+ - name: CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout
+ configFile: records.config
+ value: INT 1
+ - name: CONFIG proxy.config.http.server_ports
+ configFile: records.config
+ value: STRING 80 80:ipv6
+ - name: CONFIG proxy.config.url_remap.remap_required
+ configFile: records.config
+ value: INT 0
+ v7:
+ - name: ramdisk_size
+ configFile: grub.conf
+ value: ramdisk_size=16777216
+ - name: LogFormat.Format
+ configFile: logging.config
+ value: '%<cqtq> chi=%<chi> phn=%<phn> php=%<php> shn=%<shn> url=%<cquuc> cqhm=%<cqhm> cqhv=%<cqpv> pssc=%<pssc> ttms=%<ttms> b=%<pscl> sssc=%<sssc> sscl=%<sscl> cfsc=%<cfsc> pfsc=%<pfsc> crc=%<crc> phr=%<phr> pqsn=%<shn> uas=\"%<{User-Agent}cqh>\" xmt=\"%<{X-MoneyTrace}cqh>\" svc=%<{X-CDN-SVC}cqh>'
+ - name: CONFIG proxy.config.cop.active_health_checks
+ configFile: records.config
+ value: INT 0
+ v8: []
+ common:
+ common:
+ - name: location
+ configFile: 12M_facts
+ value: "/opt/ort"
+ - name: location
+ configFile: 50-ats.rules
+ value: "/etc/udev/rules.d/"
+ - name: domain_name
+ configFile: CRConfig.json
+ value: "{{ Target_cdn_delegation_fqdn | lower }}"
+ - name: weight
+ configFile: CRConfig.json
+ value: '1.0'
+ - name: allow_ip
+ configFile: astats.config
+ value: "{{ dl_allow_ip4 }}"
+ - name: allow_ip6
+ configFile: astats.config
+ value: "{{ dl_allow_ip6 }}"
+ - name: location
+ configFile: astats.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: path
+ configFile: astats.config
+ value: _astats
+ - name: record_types
+ configFile: astats.config
+ value: '122'
+ - name: location
+ configFile: cache.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: location
+ configFile: cacheurl_qstring.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: trafficserver
+ configFile: chkconfig
+ value: '0:off\t1:off\t2:on\t3:on\t4:on\t5:on\t6:off'
+ - name: location
+ configFile: hosting.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: coalesce_masklen_v4
+ configFile: ip_allow.config
+ value: '16'
+ - name: coalesce_masklen_v6
+ configFile: ip_allow.config
+ value: '40'
+ - name: coalesce_number_v4
+ configFile: ip_allow.config
+ value: '5'
+ - name: coalesce_number_v6
+ configFile: ip_allow.config
+ value: '5'
+ - name: location
+ configFile: ip_allow.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: purge_allow_ip
+ configFile: ip_allow.config
+ value: 127.0.0.1
+ - name: trafficserver
+ configFile: package
+ value: "{{ dl_ats_version }}"
+ - name: trafficserver-debuginfo
+ configFile: package
+ value: "{{ dl_ats_version }}"
+ - name: location
+ configFile: parent.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: astats_over_http.so
+ configFile: plugin.config
+ value: ''
+ - name: location
+ configFile: plugin.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: regex_revalidate.so
+ configFile: plugin.config
+ value: "--disable-timed-updates --config regex_revalidate.config"
+ - name: health.connection.timeout
+ configFile: rascal.properties
+ value: '2000'
+ - name: health.polling.url
+ configFile: rascal.properties
+ value: http://${hostname}/_astats?application=&inf.name=${interface_name}
+ - name: health.threshold.kbps
+ configFile: rascal.properties
+ value: "<{{ ((Target_hardware_profile.value.network_bandwidth_limit | default('1000') | float - (Target_hardware_profile.value.network_bandwidth_limit | default('1000') | float * ((100 - dl_ds_reserved_bandwidth_percentage | float) / 100))) | int) * 1000 }}"
+ - name: health.threshold.loadavg
+ configFile: rascal.properties
+ value: "{{ Target_hardware_profile.value.load_avg_limit | default('10') }}.0"
+ - name: health.threshold.queryTime
+ configFile: rascal.properties
+ value: '1500'
+ - name: history.count
+ configFile: rascal.properties
+ value: '30'
+ - name: CONFIG proxy.config.allocator.dontdump_iobuffers
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.allocator.thread_freelist_size
+ configFile: records.config
+ value: INT 1024
+ - name: CONFIG proxy.config.cache.enable_checksum
+ configFile: records.config
+ value: INT 1
+ - name: CONFIG proxy.config.cache.min_average_object_size
+ configFile: records.config
+ value: INT 131072
+ - name: CONFIG proxy.config.cache.ram_cache.size
+ configFile: records.config
+ value: "INT {{ cache_hardware_profile_index[Target_hardware_profile.value.ram_cache_size | default(0)] | default(20000) }}"
+ - name: CONFIG proxy.config.crash_log_helper
+ configFile: records.config
+ value: STRING /usr/local/bin/backtrace-invoker.sh
+ - name: CONFIG proxy.config.diags.logfile.rolling_enabled
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.diags.logfile.rolling_size_mb
+ configFile: records.config
+ value: INT 1024
+ - name: CONFIG proxy.config.diags.output.emergency
+ configFile: records.config
+ value: STRING SL
+ - name: CONFIG proxy.config.diags.show_location
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.dns.lookup_timeout
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.dns.round_robin_nameservers
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.exec_thread.autoconfig
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.exec_thread.autoconfig.scale
+ configFile: records.config
+ value: FLOAT 1.5
+ - name: CONFIG proxy.config.exec_thread.limit
+ configFile: records.config
+ value: INT 32
+ - name: CONFIG proxy.config.hostdb.lookup_timeout
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.hostdb.max_size
+ configFile: records.config
+ value: INT -1
+ - name: CONFIG proxy.config.hostdb.timeout
+ configFile: records.config
+ value: INT 1440
+ - name: CONFIG proxy.config.http.background_fill_completed_threshold
+ configFile: records.config
+ value: FLOAT 0.0
+ - name: CONFIG proxy.config.http.cache.guaranteed_max_lifetime
+ configFile: records.config
+ value: INT 2592000
+ - name: CONFIG proxy.config.http.cache.heuristic_lm_factor
+ configFile: records.config
+ value: FLOAT 0.10
+ - name: CONFIG proxy.config.http.cache.ignore_client_cc_max_age
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.http.cache.max_open_read_retries
+ configFile: records.config
+ value: INT 150
+ - name: CONFIG proxy.config.http.cache.max_open_write_retries
+ configFile: records.config
+ value: INT 150
+ - name: CONFIG proxy.config.http.cache.required_headers
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.http.connect_attempts_max_retries
+ configFile: records.config
+ value: INT 6
+ - name: CONFIG proxy.config.http.connect_attempts_rr_retries
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.http.connect_attempts_timeout
+ configFile: records.config
+ value: INT 3
+ - name: CONFIG proxy.config.http.down_server.cache_time
+ configFile: records.config
+ value: INT 5
+ - name: CONFIG proxy.config.http.insert_response_via_str
+ configFile: records.config
+ value: INT 3
+ - name: CONFIG proxy.config.http.keep_alive_no_activity_timeout_in
+ configFile: records.config
+ value: INT 115
+ - name: CONFIG proxy.config.http.negative_caching_enabled
+ configFile: records.config
+ value: INT 1
+ - name: CONFIG proxy.config.http.negative_caching_lifetime
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.http.negative_caching_list
+ configFile: records.config
+ value: STRING 204 305 403 404 405 414 500 501 502 503 504
+ - name: CONFIG proxy.config.http.origin_max_connections_queue
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.http.parent_proxy.retry_time
+ configFile: records.config
+ value: INT 10
+ - name: CONFIG proxy.config.http.parent_proxy_routing_enable
+ configFile: records.config
+ value: INT 1
+ - name: CONFIG proxy.config.http.referer_default_redirect
+ configFile: records.config
+ value: STRING http://www.kabletown.invalid/
+ - name: CONFIG proxy.config.http.request_header_max_size
+ configFile: records.config
+ value: INT 32000
+ - name: CONFIG proxy.config.http.transaction_no_activity_timeout_in
+ configFile: records.config
+ value: INT 5
+ - name: CONFIG proxy.config.http.transaction_no_activity_timeout_out
+ configFile: records.config
+ value: INT 5
+ - name: CONFIG proxy.config.log.rolling_enabled
+ configFile: records.config
+ value: INT 3
+ - name: CONFIG proxy.config.log.rolling_size_mb
+ configFile: records.config
+ value: INT 1024
+ - name: CONFIG proxy.config.mlock_enabled
+ configFile: records.config
+ value: INT 2
+ - name: CONFIG proxy.config.net.connections_throttle
+ configFile: records.config
+ value: INT 350000
+ - name: CONFIG proxy.config.net.default_inactivity_timeout
+ configFile: records.config
+ value: INT 180
+ - name: CONFIG proxy.config.net.max_connections_active_in
+ configFile: records.config
+ value: INT 100000
+ - name: CONFIG proxy.config.net.max_connections_in
+ configFile: records.config
+ value: INT 100000
+ - name: CONFIG proxy.config.net.sock_option_flag_in
+ configFile: records.config
+ value: INT 13
+ - name: CONFIG proxy.config.net.sock_option_flag_out
+ configFile: records.config
+ value: INT 9
+ - name: CONFIG proxy.config.net.sock_send_buffer_size_in
+ configFile: records.config
+ value: INT 262144
+ - name: CONFIG proxy.config.product_company
+ configFile: records.config
+ value: STRING Apache
+ - name: CONFIG proxy.config.product_name
+ configFile: records.config
+ value: STRING Traffic
+ - name: CONFIG proxy.config.proxy_name
+ configFile: records.config
+ value: STRING __HOSTNAME__
+ - name: CONFIG proxy.config.ssl.CA.cert.path
+ configFile: records.config
+ value: STRING etc/trafficserver/ssl
+ - name: CONFIG proxy.config.ssl.client.CA.cert.path
+ configFile: records.config
+ value: STRING etc/trafficserver/ssl
+ - name: CONFIG proxy.config.ssl.client.cert.path
+ configFile: records.config
+ value: STRING etc/trafficserver/ssl
+ - name: CONFIG proxy.config.ssl.client.private_key.path
+ configFile: records.config
+ value: STRING etc/trafficserver/ssl
+ - name: CONFIG proxy.config.ssl.ocsp.enabled
+ configFile: records.config
+ value: INT 1
+ - name: CONFIG proxy.config.ssl.server.cert.path
+ configFile: records.config
+ value: STRING etc/trafficserver/ssl
+ - name: CONFIG proxy.config.ssl.server.cipher_suite
+ configFile: records.config
+ value: STRING ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!RC4:!SRP:!DSS:!PSK:!aNULL:!eNULL:!SSLv2:@STRENGTH
+ - name: CONFIG proxy.config.ssl.server.private_key.path
+ configFile: records.config
+ value: STRING etc/trafficserver/ssl
+ - name: CONFIG proxy.config.system.file_max_pct
+ configFile: records.config
+ value: FLOAT 0.9
+ - name: location
+ configFile: records.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: location
+ configFile: regex_revalidate.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: location
+ configFile: remap.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: Disk_Volume
+ configFile: storage.config
+ value: '1'
+ - name: Drive_Letters
+ configFile: storage.config
+ value: "{{ Target_hardware_profile_cache_disk_letters | default('') }}"
+ - name: Drive_Prefix
+ configFile: storage.config
+ value: "/dev/{{ Target_hardware_profile_cache_disk_prefix | default('sd') }}"
+ - name: RAM_Drive_Letters
+ configFile: storage.config
+ value: "{{ Target_hardware_profile_ram_disk_letters | default('') }}"
+ - name: RAM_Drive_Prefix
+ configFile: storage.config
+ value: "/dev/{{ Target_hardware_profile_ram_disk_prefix | default('ram') }}"
+ - name: RAM_Volume
+ configFile: storage.config
+ value: '2'
+ - name: location
+ configFile: storage.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ - name: location
+ configFile: volume.config
+ value: "/opt/trafficserver/etc/trafficserver/"
+ v7:
+ - name: LogFormat.Name
+ configFile: logging.config
+ value: custom_ats_2
+ - name: LogObject.Filename
+ configFile: logging.config
+ value: custom_ats_2
+ - name: LogObject.Format
+ configFile: logging.config
+ value: custom_ats_2
+ - name: LogObject.RollingEnabled
+ configFile: logging.config
+ value: '3'
+ - name: LogObject.RollingIntervalSec
+ configFile: logging.config
+ value: '86400'
+ - name: LogObject.RollingOffsetHr
+ configFile: logging.config
+ value: '11'
+ - name: LogObject.RollingSizeMb
+ configFile: logging.config
+ value: '1024'
+ - name: location
+ configFile: logging.config
+ value: "/opt/trafficserver/etc/trafficserver"
+ - name: 'CONFIG proxy.config.cluster.cluster_configuration '
+ configFile: records.config
+ value: STRING cluster.config
+ - name: CONFIG proxy.config.http.connect_attempts_max_retries_dead_server
+ configFile: records.config
+ value: INT 3
+ - name: CONFIG proxy.config.http.cache.fuzz.probability
+ configFile: records.config
+ value: FLOAT 0.005
+ - name: CONFIG proxy.config.http.cache.fuzz.time
+ configFile: records.config
+ value: INT 240
+ - name: CONFIG proxy.config.http.normalize_ae_gzip
+ configFile: records.config
+ value: INT 0
+ v8:
+ - name: LogFormat.Format
+ configFile: logging.yaml
+ value: '%<cqtq> chi=%<chi> phn=%<phn> php=%<php> shn=%<shn> url=%<cquuc> cqhm=%<cqhm> cqhv=%<cqpv> pssc=%<pssc> ttms=%<ttms> b=%<pscl> sssc=%<sssc> sscl=%<sscl> cfsc=%<cfsc> pfsc=%<pfsc> crc=%<crc> phr=%<phr> pqsn=%<shn> uas=\"%<{User-Agent}cqh>\" xmt=\"%<{X-MoneyTrace}cqh>\" svc=%<{X-CDN-SVC}cqh>'
+ - name: LogFormat.Name
+ configFile: logging.yaml
+ value: custom_ats_2
+ - name: LogFormat1.Format
+ configFile: logging.yaml
+ value: '%<cqtq> chi=%<chi> phn=%<phn> php=%<php> shn=%<shn> url=%<cquuc> cqhm=%<cqhm> cqhv=%<cqpv> pssc=%<pssc> ttms=%<ttms> b=%<pscl> sssc=%<sssc> sscl=%<sscl> cfsc=%<cfsc> pfsc=%<pfsc> crc=%<crc> phr=%<phr> pqsn=%<shn> uas=\"%<{User-Agent}cqh>\" xmt=\"%<{X-MoneyTrace}cqh>\" svc=%<{X-CDN-SVC}cqh> rr=\"\"\"%<{Range}cqh>\"\"\" cl=\"\"\"%<{Content-Length}psh>\"\"\" cqhl=%<cqhl> csscl=%<csscl> cqssc=%<cqssc> cqssv=%<cqssv> ccc=\"\"\"%<{Cache-Control}cqh>\"\"\" occ=\"\"\"%<{Cache-C [...]
+ - name: LogFormat1.Name
+ configFile: logging.yaml
+ value: custom_ats_3
+ - name: LogObject.Filename
+ configFile: logging.yaml
+ value: custom_ats_2
+ - name: LogObject.Format
+ configFile: logging.yaml
+ value: custom_ats_2
+ - name: LogObject.RollingEnabled
+ configFile: logging.yaml
+ value: "'both'"
+ - name: LogObject.RollingIntervalSec
+ configFile: logging.yaml
+ value: '86400'
+ - name: LogObject.RollingOffsetHr
+ configFile: logging.yaml
+ value: '11'
+ - name: LogObject.RollingSizeMb
+ configFile: logging.yaml
+ value: '1024'
+ - name: LogObject1.Filename
+ configFile: logging.yaml
+ value: custom_ats_3
+ - name: LogObject1.Format
+ configFile: logging.yaml
+ value: custom_ats_3
+ - name: LogObject1.RollingEnabled
+ configFile: logging.yaml
+ value: '3'
+ - name: LogObject1.RollingIntervalSec
+ configFile: logging.yaml
+ value: '86400'
+ - name: LogObject1.RollingOffsetHr
+ configFile: logging.yaml
+ value: '11'
+ - name: LogObject1.RollingSizeMb
+ configFile: logging.yaml
+ value: '1024'
+ - name: location
+ configFile: logging.yaml
+ value: "/opt/trafficserver/etc/trafficserver"
+ # Default changed between ATS 7 & 8
+ - name: CONFIG proxy.config.diags.debug.tags
+ configFile: records.config
+ value: STRING http.*|dns.*
+ # Default changed between ATS 7 & 8
+ - name: CONFIG proxy.config.http.negative_revalidating_enabled
+ configFile: records.config
+ value: INT 0
+ - name: CONFIG proxy.config.http.normalize_ae
+ configFile: records.config
+ value: INT 0
+ # Default changed between ATS 7 & 8
+ - name: CONFIG proxy.config.http2.max_header_list_size
+ configFile: records.config
+ value: INT 4294967295
+ # Default changed between ATS 7 & 8
+ - name: CONFIG proxy.config.http2.initial_window_size_in
+ configFile: records.config
+ value: INT 1048576
+ - name: CONFIG proxy.config.plugin.lua.max_states
+ configFile: records.config
+ value: INT 64
+ - name: CONFIG proxy.config.restart.stop_listening
+ configFile: records.config
+ value: INT 1
+ # Default changed between ATS 7 & 8
+ - name: LOCAL proxy.local.cluster.type
+ configFile: records.config
+ value: INT 3
+
# TO Profiles (templates) and associated parameters
# These should be the profiles which vary by CDN association
dl_ds_merged_profile_cdntemplates: "{{ dl_ds_default_profile_cdntemplates }}"
@@ -850,7 +1542,7 @@ dl_ds_default_profile_cdntemplates:
configFile: parent.config
value: '1'
secure: 0
- - name: "{{ dl_ds_merged_profile_prefix_ansible_component_map.grove }}{{ Target_cdn_delegation }}"
+ - name: "EDGE_GROVE_{{ Target_cdn_delegation }}"
description: "Edge cache({{ Target_cdn_delegation }}) - Grove"
cdn: "{{ Target_cdn_delegation }}"
type: GROVE_PROFILE
@@ -864,7 +1556,7 @@ dl_ds_default_profile_cdntemplates:
value: "{{ dl_allow_ip6 }}"
- name: cache_size_bytes
configFile: grove.cfg
- value: "{{ (dl_grove_ram_cache_size_mb | float * 1000000) | int }}"
+ value: "{{ cache_hardware_profile_index[Target_hardware_profile.value.ram_cache_size | default(0)] | default(20000) }}"
- name: cert_file
configFile: grove.cfg
value: "/etc/pki/tls/certs/server.crt"
@@ -879,7 +1571,7 @@ dl_ds_default_profile_cdntemplates:
value: '443'
- name: interface_name
configFile: grove.cfg
- value: ens3
+ value: "{{ Target_hardware_profile.value.primary_network_interface | default('eth0') }}"
- name: key_file
configFile: grove.cfg
value: "/etc/pki/tls/private/server.key.pem"
@@ -970,2682 +1662,30 @@ dl_ds_default_profile_cdntemplates:
- name: health.polling.url
configFile: rascal.properties
value: http://${hostname}/_astats?application=&inf.name=${interface_name}
- - name: "{{ dl_ds_merged_profile_prefix_ansible_component_map.atsec }}{{ Target_cdn_delegation }}"
- description: "Edge cache({{ Target_cdn_delegation }}) - ATS"
+ - name: "EDGE_ATS_7_{{ Target_cdn_delegation }}"
+ description: "Edge cache({{ Target_cdn_delegation }}) - ATS 7"
cdn: "{{ Target_cdn_delegation }}"
type: ATS_PROFILE
routingDisabled: false
- parameters:
- - name: location
- configFile: 12M_facts
- value: "/opt/ort"
- - name: location
- configFile: 50-ats.rules
- value: "/etc/udev/rules.d/"
- - name: domain_name
- configFile: CRConfig.json
- value: "{{ Target_cdn_delegation_fqdn | lower }}"
- - name: weight
- configFile: CRConfig.json
- value: '1.0'
- - name: allow_ip
- configFile: astats.config
- value: "{{ dl_allow_ip4 }}"
- - name: allow_ip6
- configFile: astats.config
- value: "{{ dl_allow_ip6 }}"
- - name: location
- configFile: astats.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: path
- configFile: astats.config
- value: _astats
- - name: record_types
- configFile: astats.config
- value: '122'
- - name: location
- configFile: bg_fetch.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: location
- configFile: cache.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: cacheurl_qstring.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: trafficserver
- configFile: chkconfig
- value: '0:off\t1:off\t2:on\t3:on\t4:on\t5:on\t6:off'
- - name: location
- configFile: drop_qstring.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: location
- configFile: hosting.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: coalesce_masklen_v4
- configFile: ip_allow.config
- value: '16'
- - name: coalesce_masklen_v6
- configFile: ip_allow.config
- value: '40'
- - name: coalesce_number_v4
- configFile: ip_allow.config
- value: '5'
- - name: coalesce_number_v6
- configFile: ip_allow.config
- value: '5'
- - name: location
- configFile: ip_allow.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: purge_allow_ip
- configFile: ip_allow.config
- value: 127.0.0.1
- - name: LogFormat.Format
- configFile: logging.config
- value: '%<cqtq> chi=%<chi> phn=%<phn> php=%<php> shn=%<shn> url=%<cquuc> cqhm=%<cqhm> cqhv=%<cqpv> pssc=%<pssc> ttms=%<ttms> b=%<pscl> sssc=%<sssc> sscl=%<sscl> cfsc=%<cfsc> pfsc=%<pfsc> crc=%<crc> phr=%<phr> pqsn=%<pqsn> uas=\"%<{User-Agent}cqh>\"'
- - name: LogFormat.Name
- configFile: logging.config
- value: custom_ats_2
- - name: LogObject.Filename
- configFile: logging.config
- value: custom_ats_2
- - name: LogObject.Format
- configFile: logging.config
- value: custom_ats_2
- - name: LogObject.RollingEnabled
- configFile: logging.config
- value: '3'
- - name: LogObject.RollingIntervalSec
- configFile: logging.config
- value: '86400'
- - name: LogObject.RollingOffsetHr
- configFile: logging.config
- value: '11'
- - name: LogObject.RollingSizeMb
- configFile: logging.config
- value: '1024'
- - name: location
- configFile: logging.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: trafficserver
- configFile: package
- value: "{{ dl_ats_version }}"
- - name: trafficserver-debuginfo
- configFile: package
- value: "{{ dl_ats_version }}"
- - name: algorithm
- configFile: parent.config
- value: consistent_hash
- - name: location
- configFile: parent.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: qstring
- configFile: parent.config
- value: ignore
- - name: astats_over_http.so
- configFile: plugin.config
- value: ''
- - name: location
- configFile: plugin.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: regex_revalidate.so
- configFile: plugin.config
- value: "--disable-timed-updates --config regex_revalidate.config"
- - name: remap_stats.so
- configFile: plugin.config
- value: ''
- - name: health.connection.timeout
- configFile: rascal.properties
- value: '2000'
- - name: health.polling.url
- configFile: rascal.properties
- value: http://${hostname}/_astats?application=&inf.name=${interface_name}
- - name: health.threshold.availableBandwidthInKbps
- configFile: rascal.properties
- value: ">100000"
- - name: health.threshold.loadavg
- configFile: rascal.properties
- value: '30.0'
- - name: health.threshold.queryTime
- configFile: rascal.properties
- value: '1000'
- - name: history.count
- configFile: rascal.properties
- value: '30'
- - name: CONFIG proxy.config.accept_threads
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.admin.admin_user
- configFile: records.config
- value: STRING admin
- - name: CONFIG proxy.config.admin.api.restricted
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.admin.number_config_bak
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.admin.synthetic_port
- configFile: records.config
- value: INT 8083
- - name: CONFIG proxy.config.admin.user_id
- configFile: records.config
- value: STRING ats
- - name: CONFIG proxy.config.alarm.abs_path
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.alarm.bin
- configFile: records.config
- value: STRING example_alarm_bin.sh
- - name: CONFIG proxy.config.alarm.script_runtime
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.alarm_email
- configFile: records.config
- value: STRING ats
- - name: CONFIG proxy.config.allocator.dontdump_iobuffers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.allocator.hugepages
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.allocator.thread_freelist_low_watermark
- configFile: records.config
- value: INT 32
- - name: CONFIG proxy.config.allocator.thread_freelist_size
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.bin_path
- configFile: records.config
- value: STRING bin
- - name: CONFIG proxy.config.body_factory.enable_customizations
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.body_factory.enable_logging
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.body_factory.response_suppression_mode
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.body_factory.template_sets_dir
- configFile: records.config
- value: STRING etc/trafficserver/body_factory
- - name: CONFIG proxy.config.cache.alt_rewrite_max_size
- configFile: records.config
- value: INT 4096
- - name: CONFIG proxy.config.cache.control.filename
- configFile: records.config
- value: STRING cache.config
- - name: CONFIG proxy.config.cache.enable_checksum
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.enable_read_while_writer
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.force_sector_size
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.hit_evacuate_percent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.hit_evacuate_size_limit
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.hostdb.sync_frequency
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.hosting_filename
- configFile: records.config
- value: STRING hosting.config
- - name: CONFIG proxy.config.cache.http.compatibility.4-2-0-fixup
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.limits.http.max_alts
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.cache.max_doc_size
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.min_average_object_size
- configFile: records.config
- value: INT 131072
- - name: CONFIG proxy.config.cache.mutex_retry_delay
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.cache.permit.pinning
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.ram_cache.algorithm
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.ram_cache.compress
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.ram_cache.size
- configFile: records.config
- value: "INT {{ (dl_atsec_ram_cache_size_mb | float * 1000000) | int }}"
- - name: CONFIG proxy.config.cache.ram_cache.use_seen_filter
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.ram_cache_cutoff
- configFile: records.config
- value: "INT {{ (dl_atsec_ram_cache_max_obj_size_mb | float * 1000000) | int }}"
- - name: CONFIG proxy.config.cache.read_while_writer.max_retries
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.cache.read_while_writer_retry.delay
- configFile: records.config
- value: INT 50
- - name: CONFIG proxy.config.cache.target_fragment_size
- configFile: records.config
- value: INT 1048576
- - name: CONFIG proxy.config.cache.threads_per_disk
- configFile: records.config
- value: INT 8
- - name: 'CONFIG proxy.config.cluster.cluster_configuration '
- configFile: records.config
- value: STRING cluster.config
- - name: CONFIG proxy.config.cluster.cluster_port
- configFile: records.config
- value: INT 8086
- - name: CONFIG proxy.config.cluster.ethernet_interface
- configFile: records.config
- value: STRING lo
- - name: CONFIG proxy.config.cluster.log_bogus_mc_msgs
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cluster.mc_group_addr
- configFile: records.config
- value: STRING 224.0.1.37
- - name: CONFIG proxy.config.cluster.mc_ttl
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cluster.mcport
- configFile: records.config
- value: INT 8089
- - name: CONFIG proxy.config.cluster.rsport
- configFile: records.config
- value: INT 8088
- - name: CONFIG proxy.config.cluster.startup_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.cluster.threads
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.config_dir
- configFile: records.config
- value: STRING etc/trafficserver
- - name: CONFIG proxy.config.cop.active_health_checks
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.cop.core_signal
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cop.init_sleep_time
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cop.linux_min_memfree_kb
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cop.linux_min_swapfree_kb
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.core_limit
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.crash_log_helper
- configFile: records.config
- value: STRING /tmp/backtrace/invoker.sh
- - name: CONFIG proxy.config.diags.debug.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.diags.debug.tags
- configFile: records.config
- value: STRING http.*|dns.*
- - name: CONFIG proxy.config.diags.logfile.rolling_enabled
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.diags.logfile.rolling_interval_sec
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.diags.logfile.rolling_size_mb
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.diags.output.alert
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.debug
- configFile: records.config
- value: STRING E
- - name: CONFIG proxy.config.diags.output.diag
- configFile: records.config
- value: STRING E
- - name: CONFIG proxy.config.diags.output.emergency
- configFile: records.config
- value: STRING SL
- - name: CONFIG proxy.config.diags.output.error
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.fatal
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.note
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.status
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.warning
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.show_location
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.disable_configuration_modification
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.dedicated_thread
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.lookup_timeout
- configFile: records.config
- value: INT 20
- - name: CONFIG proxy.config.dns.max_dns_in_flight
- configFile: records.config
- value: INT 2048
- - name: CONFIG proxy.config.dns.nameservers
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.dns.resolv_conf
- configFile: records.config
- value: STRING /etc/resolv.conf
- - name: CONFIG proxy.config.dns.round_robin_nameservers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.search_default_domains
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.splitDNS.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.validate_query_name
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dump_mem_info_frequency
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.env_prep
- configFile: records.config
- value: STRING example_prep.sh
- - name: CONFIG proxy.config.exec_thread.affinity
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.exec_thread.autoconfig
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.exec_thread.autoconfig.scale
- configFile: records.config
- value: FLOAT 1.5
- - name: CONFIG proxy.config.exec_thread.limit
- configFile: records.config
- value: INT 32
- - name: CONFIG proxy.config.header.parse.no_host_url_redirect
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.hostdb.fail.timeout
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.hostdb.filename
- configFile: records.config
- value: STRING host.db
- - name: CONFIG proxy.config.hostdb.host_file.interval
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.hostdb.host_file.path
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.hostdb.ip_resolve
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.hostdb.lookup_timeout
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.hostdb.max_count
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.hostdb.max_size
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.hostdb.partitions
- configFile: records.config
- value: INT 64
- - name: CONFIG proxy.config.hostdb.serve_stale_for
- configFile: records.config
- value: INT 20
- - name: CONFIG proxy.config.hostdb.strict_round_robin
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.hostdb.timed_round_robin
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.hostdb.timeout
- configFile: records.config
- value: INT 1440
- - name: CONFIG proxy.config.hostdb.ttl_mode
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.hostdb.verify_after
- configFile: records.config
- value: INT 720
- - name: CONFIG proxy.config.http.accept_no_activity_timeout
- configFile: records.config
- value: INT 120
- - name: CONFIG proxy.config.http.anonymize_other_header_list
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.anonymize_remove_client_ip
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_cookie
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_from
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_referer
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_user_agent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.attach_server_session_to_client
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.auth_server_session_private
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.background_fill_active_timeout
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.background_fill_completed_threshold
- configFile: records.config
- value: FLOAT 0.0
- - name: CONFIG proxy.config.http.cache.allow_empty_doc
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.cache_responses_to_cookies
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.cache_urls_that_look_dynamic
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.cluster_cache_local
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.enable_default_vary_headers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.fuzz.min_time
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.fuzz.probability
- configFile: records.config
- value: FLOAT 0.005
- - name: CONFIG proxy.config.http.cache.fuzz.time
- configFile: records.config
- value: INT 240
- - name: CONFIG proxy.config.http.cache.generation
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.http.cache.guaranteed_max_lifetime
- configFile: records.config
- value: INT 2592000
- - name: CONFIG proxy.config.http.cache.guaranteed_min_lifetime
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.heuristic_lm_factor
- configFile: records.config
- value: FLOAT 0.10
- - name: CONFIG proxy.config.http.cache.heuristic_max_lifetime
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.http.cache.heuristic_min_lifetime
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.http.cache.http
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.ignore_accept_charset_mismatch
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.cache.ignore_accept_encoding_mismatch
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.ignore_accept_language_mismatch
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.cache.ignore_accept_mismatch
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.cache.ignore_authentication
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.ignore_client_cc_max_age
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.ignore_client_no_cache
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.ignore_server_no_cache
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.ims_on_client_no_cache
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.max_open_read_retries
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.http.cache.max_open_write_retries
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.max_stale_age
- configFile: records.config
- value: INT 604800
- - name: CONFIG proxy.config.http.cache.open_read_retry_time
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.cache.open_write_fail_action
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.range.lookup
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.range.write
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.required_headers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.vary_default_images
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.cache.vary_default_other
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.cache.vary_default_text
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.cache.when_to_revalidate
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.chunking.size
- configFile: records.config
- value: INT 4096
- - name: CONFIG proxy.config.http.chunking_enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.congestion_control.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.connect_attempts_max_retries
- configFile: records.config
- value: INT 6
- - name: CONFIG proxy.config.http.connect_attempts_max_retries_dead_server
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.http.connect_attempts_rr_retries
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.connect_attempts_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.connect_ports
- configFile: records.config
- value: STRING 443 563
- - name: CONFIG proxy.config.http.default_buffer_size
- configFile: records.config
- value: INT 8
- - name: CONFIG proxy.config.http.default_buffer_water_mark
- configFile: records.config
- value: INT 32768
- - name: CONFIG proxy.config.http.disallow_post_100_continue
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.doc_in_cache_skip_dns
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.down_server.abort_threshold
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.down_server.cache_time
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.http.enable_http_info
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.enable_http_stats
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.errors.log_error_pages
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.flow_control.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.flow_control.high_water
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.flow_control.low_water
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.forward.proxy_auth_to_parent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.forward_connect_method
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.insert_age_in_response
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.insert_client_ip
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.insert_request_via_str
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.insert_response_via_str
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.http.insert_squid_x_forwarded_for
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.keep_alive_enabled_in
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.keep_alive_enabled_out
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.keep_alive_no_activity_timeout_in
- configFile: records.config
- value: INT 115
- - name: CONFIG proxy.config.http.keep_alive_no_activity_timeout_out
- configFile: records.config
- value: INT 120
- - name: CONFIG proxy.config.http.keep_alive_post_out
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.negative_caching_enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.negative_caching_lifetime
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.negative_revalidating_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.negative_revalidating_lifetime
- configFile: records.config
- value: INT 1800
- - name: CONFIG proxy.config.http.no_dns_just_forward_to_parent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.normalize_ae_gzip
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.number_of_redirections
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.origin_max_connections
- configFile: records.config
- value: INT 10000
- - name: CONFIG proxy.config.http.origin_max_connections_queue
- configFile: records.config
- value: INT 10000
- - name: CONFIG proxy.config.http.origin_min_keep_alive_connections
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.http.parent_proxy.fail_threshold
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.parent_proxy.file
- configFile: records.config
- value: STRING parent.config
- - name: CONFIG proxy.config.http.parent_proxy.mark_down_hostdb
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.parent_proxy.per_parent_connect_attempts
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.parent_proxy.retry_time
- configFile: records.config
- value: INT 60
- - name: CONFIG proxy.config.http.parent_proxy.total_connect_attempts
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.parent_proxy_routing_enable
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.post.check.content_length.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.post_connect_attempts_timeout
- configFile: records.config
- value: INT 1800
- - name: CONFIG proxy.config.http.push_method_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.record_heartbeat
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.redirect_host_no_port
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.redirect_use_orig_cache_key
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.redirection_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.referer_default_redirect
- configFile: records.config
- value: STRING http://www.kabletown.invalid/
- - name: CONFIG proxy.config.http.referer_filter
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.referer_format_redirect
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.request_header_max_size
- configFile: records.config
- value: INT 131072
- - name: CONFIG proxy.config.http.response_header_max_size
- configFile: records.config
- value: INT 131072
- - name: CONFIG proxy.config.http.response_server_enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.safe_requests_retryable
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.send_100_continue_response
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.send_http11_requests
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.server_max_connections
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.server_ports
- configFile: records.config
- value: STRING 80 80:ipv6 443:proto=http:ssl 443:ipv6:proto=http:ssl
- - name: CONFIG proxy.config.http.server_session_sharing.match
- configFile: records.config
- value: STRING both
- - name: CONFIG proxy.config.http.server_session_sharing.pool
- configFile: records.config
- value: STRING thread
- - name: CONFIG proxy.config.http.server_tcp_init_cwnd
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.slow.log.threshold
- configFile: records.config
- value: INT 450
- - name: CONFIG proxy.config.http.strict_uri_parsing
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.transaction_active_timeout_in
- configFile: records.config
- value: INT 900
- - name: CONFIG proxy.config.http.transaction_active_timeout_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.transaction_no_activity_timeout_in
- configFile: records.config
- value: INT 30
- - name: CONFIG proxy.config.http.transaction_no_activity_timeout_out
- configFile: records.config
- value: INT 30
- - name: CONFIG proxy.config.http.uncacheable_requests_bypass_parent
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.use_client_target_addr
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.wait_for_cache
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.websocket.max_number_of_connections
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.http2.header_table_size
- configFile: records.config
- value: INT 4096
- - name: CONFIG proxy.config.http2.initial_window_size_in
- configFile: records.config
- value: INT 1048576
- - name: CONFIG proxy.config.http2.max_active_streams_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http2.max_concurrent_streams_in
- configFile: records.config
- value: INT 100
- - name: CONFIG proxy.config.http2.max_frame_size
- configFile: records.config
- value: INT 16384
- - name: CONFIG proxy.config.http2.max_header_list_size
- configFile: records.config
- value: INT 4294967295
- - name: CONFIG proxy.config.http2.min_concurrent_streams_in
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http2.push_diary_size
- configFile: records.config
- value: INT 256
- - name: CONFIG proxy.config.http2.stream_priority_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http_ui_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.log.auto_delete_rolled_files
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.log.collation_client_timeout
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.log.collation_host
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.log.collation_host_tagged
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.log.collation_host_timeout
- configFile: records.config
- value: INT 86390
- - name: CONFIG proxy.config.log.collation_port
- configFile: records.config
- value: INT 8085
- - name: CONFIG proxy.config.log.collation_retry_sec
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.log.collation_secret
- configFile: records.config
- value: STRING foobar
- - name: CONFIG proxy.config.log.config.filename
- configFile: records.config
- value: STRING logging.config
- - name: CONFIG proxy.config.log.hostname
- configFile: records.config
- value: STRING localhost
- - name: CONFIG proxy.config.log.logfile_dir
- configFile: records.config
- value: STRING var/log/trafficserver
- - name: CONFIG proxy.config.log.logfile_perm
- configFile: records.config
- value: STRING rw-r--r--
- - name: CONFIG proxy.config.log.logging_enabled
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.log.max_secs_per_buffer
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.log.max_space_mb_for_logs
- configFile: records.config
- value: INT 25000
- - name: CONFIG proxy.config.log.max_space_mb_for_orphan_logs
- configFile: records.config
- value: INT 25
- - name: CONFIG proxy.config.log.max_space_mb_headroom
- configFile: records.config
- value: INT 1000
- - name: CONFIG proxy.config.log.periodic_tasks_interval
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.log.rolling_enabled
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.log.rolling_interval_sec
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.log.rolling_offset_hr
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.log.rolling_size_mb
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.log.sampling_frequency
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.manager_binary
- configFile: records.config
- value: STRING traffic_manager
- - name: CONFIG proxy.config.mlock_enabled
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.net.accept_period
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.connections_throttle
- configFile: records.config
- value: INT 500000
- - name: CONFIG proxy.config.net.default_inactivity_timeout
- configFile: records.config
- value: INT 180
- - name: CONFIG proxy.config.net.defer_accept
- configFile: records.config
- value: INT 45
- - name: CONFIG proxy.config.net.event_period
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.inactivity_check_frequency
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.net.listen_backlog
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.net.max_connections_active_in
- configFile: records.config
- value: INT 500000
- - name: CONFIG proxy.config.net.max_connections_in
- configFile: records.config
- value: INT 500000
- - name: CONFIG proxy.config.net.poll_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.retry_delay
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.sock_mss_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_option_flag_in
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.net.sock_option_flag_out
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.net.sock_packet_mark_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_packet_mark_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_packet_tos_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_packet_tos_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_recv_buffer_size_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_recv_buffer_size_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_send_buffer_size_in
- configFile: records.config
- value: INT 262144
- - name: CONFIG proxy.config.net.sock_send_buffer_size_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.throttle_delay
- configFile: records.config
- value: INT 50
- - name: CONFIG proxy.config.output.logfile
- configFile: records.config
- value: STRING traffic.out
- - name: CONFIG proxy.config.output.logfile.rolling_enabled
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.output.logfile.rolling_interval_sec
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.output.logfile.rolling_size_mb
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.process_manager.mgmt_port
- configFile: records.config
- value: INT 8084
- - name: CONFIG proxy.config.product_company
- configFile: records.config
- value: STRING Apache
- - name: CONFIG proxy.config.product_name
- configFile: records.config
- value: STRING Traffic
- - name: CONFIG proxy.config.product_vendor
- configFile: records.config
- value: STRING Apache
- - name: CONFIG proxy.config.proxy_binary
- configFile: records.config
- value: STRING traffic_server
- - name: CONFIG proxy.config.proxy_binary_opts
- configFile: records.config
- value: STRING -M
- - name: CONFIG proxy.config.proxy_name
- configFile: records.config
- value: STRING __HOSTNAME__
- - name: CONFIG proxy.config.remap.num_remap_threads
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.restart.active_client_threshold
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.reverse_proxy.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.snapshot_dir
- configFile: records.config
- value: STRING snapshots
- - name: CONFIG proxy.config.socks.accept_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.socks.accept_port
- configFile: records.config
- value: INT 1080
- - name: CONFIG proxy.config.socks.connection_attempts
- configFile: records.config
- value: INT 4
- - name: CONFIG proxy.config.socks.http_port
- configFile: records.config
- value: INT 80
- - name: CONFIG proxy.config.socks.per_server_connection_attempts
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.socks.server_connect_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.socks.server_fail_threshold
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.socks.server_retry_time
- configFile: records.config
- value: INT 300
- - name: CONFIG proxy.config.socks.server_retry_timeout
- configFile: records.config
- value: INT 300
- - name: CONFIG proxy.config.socks.socks_config_file
- configFile: records.config
- value: STRING socks.config
- - name: CONFIG proxy.config.socks.socks_needed
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.socks.socks_timeout
- configFile: records.config
- value: INT 100
- - name: CONFIG proxy.config.socks.socks_version
- configFile: records.config
- value: INT 4
- - name: CONFIG proxy.config.srv_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.CA.cert.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.CA.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.TLSv1
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.TLSv1_1
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.TLSv1_2
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.allow_client_renegotiation
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.cert.load_elevated
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.client.CA.cert.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.client.CA.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.client.cert.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.client.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.client.certification_level
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.client.private_key.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.client.private_key.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.client.verify.server
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.handshake_timeout_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.hsts_include_subdomains
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.hsts_max_age
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.ssl.max_record_size
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.ocsp.cache_timeout
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.ssl.ocsp.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.ocsp.request_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.ssl.ocsp.update_period
- configFile: records.config
- value: INT 60
- - name: CONFIG proxy.config.ssl.server.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.server.cert_chain.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.server.cipher_suite
- configFile: records.config
- value: STRING ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!RC4:!SRP:!DSS:!PSK:!aNULL:!eNULL:!SSLv2:@STRENGTH
- - name: CONFIG proxy.config.ssl.server.dhparams_file
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.server.honor_cipher_order
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.server.multicert.filename
- configFile: records.config
- value: STRING ssl_multicert.config
- - name: CONFIG proxy.config.ssl.server.private_key.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.server.session_ticket.enable
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.server.ticket_key.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.session_cache
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.ssl.session_cache.auto_clear
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.session_cache.num_buckets
- configFile: records.config
- value: INT 256
- - name: CONFIG proxy.config.ssl.session_cache.size
- configFile: records.config
- value: INT 102400
- - name: CONFIG proxy.config.ssl.session_cache.skip_cache_on_bucket_contention
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.session_cache.timeout
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.wire_trace_addr
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.wire_trace_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.wire_trace_percentage
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.wire_trace_server_name
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.syslog_facility
- configFile: records.config
- value: STRING LOG_DAEMON
- - name: CONFIG proxy.config.system.file_max_pct
- configFile: records.config
- value: FLOAT 0.9
- - name: CONFIG proxy.config.task_threads
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.thread.default.stacksize
- configFile: records.config
- value: INT 1048576
- - name: CONFIG proxy.config.url_remap.filename
- configFile: records.config
- value: STRING remap.config
- - name: CONFIG proxy.config.url_remap.pristine_host_hdr
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.url_remap.remap_required
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.websocket.active_timeout
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.websocket.no_activity_timeout
- configFile: records.config
- value: INT 600
- - name: LOCAL proxy.config.cache.interim.storage
- configFile: records.config
- value: STRING NULL
- - name: LOCAL proxy.local.cluster.type
- configFile: records.config
- value: INT 3
- - name: LOCAL proxy.local.http.parent_proxy.disable_connect_tunneling
- configFile: records.config
- value: INT 0
- - name: LOCAL proxy.local.log.collation_mode
- configFile: records.config
- value: INT 0
- - name: location
- configFile: records.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: regex_revalidate.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: location
- configFile: remap.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: set_dscp_0.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_10.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_12.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_14.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_16.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_18.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_20.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_22.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_24.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_26.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_28.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_30.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_32.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_34.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_36.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_37.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_38.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_40.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_48.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_56.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: set_dscp_8.config
- value: "/opt/trafficserver/etc/trafficserver/dscp"
- - name: location
- configFile: ssl_multicert.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: Disk_Volume
- configFile: storage.config
- value: '1'
- - name: Drive_Letters
- configFile: storage.config
- value: b
- - name: Drive_Prefix
- configFile: storage.config
- value: "/dev/vd"
- - name: RAM_Drive_Letters
- configFile: storage.config
- value: "{{ dl_atsec_ram_drive_letters }}"
- - name: RAM_Drive_Prefix
- configFile: storage.config
- value: "{{ dl_atsec_ram_drive_prefix }}"
- - name: RAM_Volume
- configFile: storage.config
- value: '2'
- - name: location
- configFile: storage.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: volume.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: anymap_hdr_rw.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: data
- configFile: anymap_hdr_rw.config
- value: cond %{SEND_REQUEST_HDR_HOOK} __RETURN__ add-header FAKEORIGIN-ATS-ANYMAP-GLOBAL '%<cque>' __RETURN__ add-header FAKEORIGIN-ATS-ANYMAP-ORIGINAL-REQUESTOR '%<chi>' __RETURN__ cond %{SEND_RESPONSE_HDR_HOOK} __RETURN__ add-header ATS_ANYMAP_GLOBAL 'Anymap_Global_Match' [L]
- - name: "{{ dl_ds_merged_profile_prefix_ansible_component_map.atsmid }}{{ Target_cdn_delegation }}"
- description: "Mid cache({{ Target_cdn_delegation }}) - ATS"
+ parameters: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.edge.common + dl_ds_default_profile_layers.ats.edge['v'+dl_ds_ats_major_version] }}"
+ - name: "EDGE_ATS_8_{{ Target_cdn_delegation }}"
+ description: "Edge cache({{ Target_cdn_delegation }}) - ATS 8"
cdn: "{{ Target_cdn_delegation }}"
type: ATS_PROFILE
routingDisabled: false
- parameters:
- - name: location
- configFile: 12M_facts
- value: "/opt/ort"
- - name: location
- configFile: 50-ats.rules
- value: "/etc/udev/rules.d/"
- - name: domain_name
- configFile: CRConfig.json
- value: "{{ Target_cdn_delegation_fqdn | lower }}"
- - name: weight
- configFile: CRConfig.json
- value: '1.0'
- - name: allow_ip
- configFile: astats.config
- value: "{{ dl_allow_ip4 }}"
- - name: allow_ip6
- configFile: astats.config
- value: "{{ dl_allow_ip6 }}"
- - name: location
- configFile: astats.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: path
- configFile: astats.config
- value: _astats
- - name: record_types
- configFile: astats.config
- value: '122'
- - name: location
- configFile: cache.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: cacheurl_qstring.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: trafficserver
- configFile: chkconfig
- value: '0:off\t1:off\t2:on\t3:on\t4:on\t5:on\t6:off'
- - name: ramdisk_size
- configFile: grub.conf
- value: ramdisk_size=16777216
- - name: location
- configFile: hosting.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: coalesce_masklen_v4
- configFile: ip_allow.config
- value: '16'
- - name: coalesce_masklen_v6
- configFile: ip_allow.config
- value: '40'
- - name: coalesce_number_v4
- configFile: ip_allow.config
- value: '5'
- - name: coalesce_number_v6
- configFile: ip_allow.config
- value: '5'
- - name: location
- configFile: ip_allow.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: purge_allow_ip
- configFile: ip_allow.config
- value: 127.0.0.1
- - name: LogFormat.Format
- configFile: logging.config
- value: '%<cqtq> chi=%<chi> phn=%<phn> php=%<php> shn=%<shn> url=%<cquuc> cqhm=%<cqhm> cqhv=%<cqpv> pssc=%<pssc> ttms=%<ttms> b=%<pscl> sssc=%<sssc> sscl=%<sscl> cfsc=%<cfsc> pfsc=%<pfsc> crc=%<crc> phr=%<phr> pqsn=%<pqsn> uas=\"%<{User-Agent}cqh>\"'
- - name: LogFormat.Name
- configFile: logging.config
- value: custom_ats_2
- - name: LogObject.Filename
- configFile: logging.config
- value: custom_ats_2
- - name: LogObject.Format
- configFile: logging.config
- value: custom_ats_2
- - name: LogObject.RollingEnabled
- configFile: logging.config
- value: '3'
- - name: LogObject.RollingIntervalSec
- configFile: logging.config
- value: '86400'
- - name: LogObject.RollingOffsetHr
- configFile: logging.config
- value: '11'
- - name: LogObject.RollingSizeMb
- configFile: logging.config
- value: '1024'
- - name: location
- configFile: logging.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: trafficserver
- configFile: package
- value: "{{ dl_ats_version }}"
- - name: trafficserver-debuginfo
- configFile: package
- value: "{{ dl_ats_version }}"
- - name: location
- configFile: parent.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: weight
- configFile: parent.config
- value: '1.2'
- - name: astats_over_http.so
- configFile: plugin.config
- value: ''
- - name: location
- configFile: plugin.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: regex_revalidate.so
- configFile: plugin.config
- value: "--disable-timed-updates --config regex_revalidate.config"
- - name: health.connection.timeout
- configFile: rascal.properties
- value: '2000'
- - name: health.polling.url
- configFile: rascal.properties
- value: http://${hostname}/_astats?application=&inf.name=${interface_name}
- - name: health.threshold.availableBandwidthInKbps
- configFile: rascal.properties
- value: ">100000"
- - name: health.threshold.loadavg
- configFile: rascal.properties
- value: '25.0'
- - name: health.threshold.queryTime
- configFile: rascal.properties
- value: '1000'
- - name: history.count
- configFile: rascal.properties
- value: '30'
- - name: CONFIG proxy.config.accept_threads
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.admin.admin_user
- configFile: records.config
- value: STRING admin
- - name: CONFIG proxy.config.admin.api.restricted
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.admin.number_config_bak
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.admin.synthetic_port
- configFile: records.config
- value: INT 8083
- - name: CONFIG proxy.config.admin.user_id
- configFile: records.config
- value: STRING ats
- - name: CONFIG proxy.config.alarm.abs_path
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.alarm.bin
- configFile: records.config
- value: STRING example_alarm_bin.sh
- - name: CONFIG proxy.config.alarm.script_runtime
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.alarm_email
- configFile: records.config
- value: STRING ats
- - name: CONFIG proxy.config.allocator.dontdump_iobuffers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.allocator.hugepages
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.allocator.thread_freelist_low_watermark
- configFile: records.config
- value: INT 32
- - name: CONFIG proxy.config.allocator.thread_freelist_size
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.bin_path
- configFile: records.config
- value: STRING bin
- - name: CONFIG proxy.config.body_factory.enable_customizations
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.body_factory.enable_logging
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.body_factory.response_suppression_mode
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.body_factory.template_sets_dir
- configFile: records.config
- value: STRING etc/trafficserver/body_factory
- - name: CONFIG proxy.config.cache.alt_rewrite_max_size
- configFile: records.config
- value: INT 4096
- - name: CONFIG proxy.config.cache.control.filename
- configFile: records.config
- value: STRING cache.config
- - name: CONFIG proxy.config.cache.enable_checksum
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.enable_read_while_writer
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.force_sector_size
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.hit_evacuate_percent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.hit_evacuate_size_limit
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.hostdb.sync_frequency
- configFile: records.config
- value: INT 120
- - name: CONFIG proxy.config.cache.hosting_filename
- configFile: records.config
- value: STRING hosting.config
- - name: CONFIG proxy.config.cache.limits.http.max_alts
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.cache.max_doc_size
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.min_average_object_size
- configFile: records.config
- value: INT 131072
- - name: CONFIG proxy.config.cache.mutex_retry_delay
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.cache.permit.pinning
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.ram_cache.algorithm
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.ram_cache.compress
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cache.ram_cache.size
- configFile: records.config
- value: "INT {{ (dl_atsmid_ram_cache_size_mb | float * 1000000) | int }}"
- - name: CONFIG proxy.config.cache.ram_cache.use_seen_filter
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cache.ram_cache_cutoff
- configFile: records.config
- value: "INT {{ (dl_atsmid_ram_cache_max_obj_size_mb | float * 1000000) | int }}"
- - name: CONFIG proxy.config.cache.read_while_writer.max_retries
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.cache.read_while_writer_retry.delay
- configFile: records.config
- value: INT 50
- - name: CONFIG proxy.config.cache.target_fragment_size
- configFile: records.config
- value: INT 1048576
- - name: CONFIG proxy.config.cache.threads_per_disk
- configFile: records.config
- value: INT 8
- - name: 'CONFIG proxy.config.cluster.cluster_configuration '
- configFile: records.config
- value: STRING cluster.config
- - name: CONFIG proxy.config.cluster.cluster_port
- configFile: records.config
- value: INT 8086
- - name: CONFIG proxy.config.cluster.ethernet_interface
- configFile: records.config
- value: STRING lo
- - name: CONFIG proxy.config.cluster.log_bogus_mc_msgs
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cluster.mc_group_addr
- configFile: records.config
- value: STRING 224.0.1.37
- - name: CONFIG proxy.config.cluster.mc_ttl
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.cluster.mcport
- configFile: records.config
- value: INT 8089
- - name: CONFIG proxy.config.cluster.rsport
- configFile: records.config
- value: INT 8088
- - name: CONFIG proxy.config.cluster.startup_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.cluster.threads
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.config_dir
- configFile: records.config
- value: STRING etc/trafficserver
- - name: CONFIG proxy.config.cop.active_health_checks
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cop.core_signal
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cop.init_sleep_time
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cop.linux_min_memfree_kb
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.cop.linux_min_swapfree_kb
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.core_limit
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.crash_log_helper
- configFile: records.config
- value: STRING /tmp/backtrace/invoker.sh
- - name: CONFIG proxy.config.diags.debug.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.diags.debug.tags
- configFile: records.config
- value: STRING http.*|dns.*
- - name: CONFIG proxy.config.diags.logfile.rolling_enabled
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.diags.logfile.rolling_interval_sec
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.diags.logfile.rolling_size_mb
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.diags.output.alert
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.debug
- configFile: records.config
- value: STRING E
- - name: CONFIG proxy.config.diags.output.diag
- configFile: records.config
- value: STRING E
- - name: CONFIG proxy.config.diags.output.emergency
- configFile: records.config
- value: STRING SL
- - name: CONFIG proxy.config.diags.output.error
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.fatal
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.note
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.status
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.output.warning
- configFile: records.config
- value: STRING L
- - name: CONFIG proxy.config.diags.show_location
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.disable_configuration_modification
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.dedicated_thread
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.lookup_timeout
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.dns.max_dns_in_flight
- configFile: records.config
- value: INT 2048
- - name: CONFIG proxy.config.dns.nameservers
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.dns.resolv_conf
- configFile: records.config
- value: STRING /etc/resolv.conf
- - name: CONFIG proxy.config.dns.round_robin_nameservers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.search_default_domains
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.splitDNS.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dns.validate_query_name
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.dump_mem_info_frequency
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.exec_thread.affinity
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.exec_thread.autoconfig
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.exec_thread.autoconfig.scale
- configFile: records.config
- value: FLOAT 1.5
- - name: CONFIG proxy.config.exec_thread.limit
- configFile: records.config
- value: INT 32
- - name: CONFIG proxy.config.header.parse.no_host_url_redirect
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.hostdb.fail.timeout
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.hostdb.filename
- configFile: records.config
- value: STRING host.db
- - name: CONFIG proxy.config.hostdb.host_file.interval
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.hostdb.host_file.path
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.hostdb.ip_resolve
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.hostdb.lookup_timeout
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.hostdb.max_count
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.hostdb.max_size
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.hostdb.partitions
- configFile: records.config
- value: INT 64
- - name: CONFIG proxy.config.hostdb.serve_stale_for
- configFile: records.config
- value: INT 12
- - name: CONFIG proxy.config.hostdb.strict_round_robin
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.hostdb.timed_round_robin
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.hostdb.timeout
- configFile: records.config
- value: INT 1440
- - name: CONFIG proxy.config.hostdb.ttl_mode
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.hostdb.verify_after
- configFile: records.config
- value: INT 720
- - name: CONFIG proxy.config.http.accept_no_activity_timeout
- configFile: records.config
- value: INT 120
- - name: CONFIG proxy.config.http.anonymize_other_header_list
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.anonymize_remove_client_ip
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_cookie
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_from
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_referer
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.anonymize_remove_user_agent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.attach_server_session_to_client
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.auth_server_session_private
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.background_fill_active_timeout
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.background_fill_completed_threshold
- configFile: records.config
- value: FLOAT 0.0
- - name: CONFIG proxy.config.http.cache.allow_empty_doc
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.cache_responses_to_cookies
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.cache_urls_that_look_dynamic
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.cluster_cache_local
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.enable_default_vary_headers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.fuzz.min_time
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.fuzz.probability
- configFile: records.config
- value: FLOAT 0.005
- - name: CONFIG proxy.config.http.cache.fuzz.time
- configFile: records.config
- value: INT 240
- - name: CONFIG proxy.config.http.cache.generation
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.http.cache.guaranteed_max_lifetime
- configFile: records.config
- value: INT 2592000
- - name: CONFIG proxy.config.http.cache.guaranteed_min_lifetime
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.heuristic_lm_factor
- configFile: records.config
- value: FLOAT 0.10
- - name: CONFIG proxy.config.http.cache.heuristic_max_lifetime
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.http.cache.heuristic_min_lifetime
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.http.cache.http
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.ignore_accept_charset_mismatch
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.cache.ignore_accept_encoding_mismatch
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.ignore_accept_language_mismatch
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.cache.ignore_accept_mismatch
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.cache.ignore_authentication
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.ignore_client_cc_max_age
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.ignore_client_no_cache
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.ignore_server_no_cache
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.ims_on_client_no_cache
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.max_open_read_retries
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.http.cache.max_open_write_retries
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.max_stale_age
- configFile: records.config
- value: INT 604800
- - name: CONFIG proxy.config.http.cache.open_read_retry_time
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.cache.open_write_fail_action
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.range.lookup
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.cache.range.write
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.required_headers
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.cache.vary_default_images
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.cache.vary_default_other
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.cache.vary_default_text
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.http.cache.when_to_revalidate
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.chunking.size
- configFile: records.config
- value: INT 4096
- - name: CONFIG proxy.config.http.chunking_enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.congestion_control.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.connect_attempts_max_retries
- configFile: records.config
- value: INT 6
- - name: CONFIG proxy.config.http.connect_attempts_max_retries_dead_server
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.http.connect_attempts_rr_retries
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.connect_attempts_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.connect_ports
- configFile: records.config
- value: STRING 443 563
- - name: CONFIG proxy.config.http.default_buffer_size
- configFile: records.config
- value: INT 8
- - name: CONFIG proxy.config.http.default_buffer_water_mark
- configFile: records.config
- value: INT 32768
- - name: CONFIG proxy.config.http.disallow_post_100_continue
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.doc_in_cache_skip_dns
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.down_server.abort_threshold
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.down_server.cache_time
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.http.enable_http_info
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.enable_http_stats
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.errors.log_error_pages
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.flow_control.enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.flow_control.high_water
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.flow_control.low_water
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.forward.proxy_auth_to_parent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.forward_connect_method
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.insert_age_in_response
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.insert_client_ip
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.insert_request_via_str
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.insert_response_via_str
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.http.insert_squid_x_forwarded_for
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.keep_alive_enabled_in
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.keep_alive_enabled_out
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.keep_alive_no_activity_timeout_in
- configFile: records.config
- value: INT 115
- - name: CONFIG proxy.config.http.keep_alive_no_activity_timeout_out
- configFile: records.config
- value: INT 120
- - name: CONFIG proxy.config.http.keep_alive_post_out
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.negative_caching_enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.negative_caching_lifetime
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.negative_revalidating_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.negative_revalidating_lifetime
- configFile: records.config
- value: INT 1800
- - name: CONFIG proxy.config.http.no_dns_just_forward_to_parent
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.normalize_ae_gzip
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.number_of_redirections
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.origin_max_connections
- configFile: records.config
- value: INT 10000
- - name: CONFIG proxy.config.http.origin_max_connections_queue
- configFile: records.config
- value: INT 10000
- - name: CONFIG proxy.config.http.origin_min_keep_alive_connections
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.http.parent_proxy.fail_threshold
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http.parent_proxy.file
- configFile: records.config
- value: STRING parent.config
- - name: CONFIG proxy.config.http.parent_proxy.mark_down_hostdb
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.parent_proxy.per_parent_connect_attempts
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.parent_proxy.retry_time
- configFile: records.config
- value: INT 60
- - name: CONFIG proxy.config.http.parent_proxy.total_connect_attempts
- configFile: records.config
- value: INT 4
- - name: CONFIG proxy.config.http.parent_proxy_routing_enable
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.post.check.content_length.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.post_connect_attempts_timeout
- configFile: records.config
- value: INT 1800
- - name: CONFIG proxy.config.http.push_method_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.record_heartbeat
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.redirect_host_no_port
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.redirect_use_orig_cache_key
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.redirection_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.referer_default_redirect
- configFile: records.config
- value: STRING http://www.kabletown.invalid/
- - name: CONFIG proxy.config.http.referer_filter
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.referer_format_redirect
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.request_header_max_size
- configFile: records.config
- value: INT 131072
- - name: CONFIG proxy.config.http.response_header_max_size
- configFile: records.config
- value: INT 131072
- - name: CONFIG proxy.config.http.response_server_enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.safe_requests_retryable
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.send_100_continue_response
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.send_http11_requests
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.server_max_connections
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.server_ports
- configFile: records.config
- value: STRING 80 80:ipv6 443:proto=http:ssl 443:ipv6:proto=http:ssl
- - name: CONFIG proxy.config.http.server_session_sharing.match
- configFile: records.config
- value: STRING both
- - name: CONFIG proxy.config.http.server_session_sharing.pool
- configFile: records.config
- value: STRING thread
- - name: CONFIG proxy.config.http.server_tcp_init_cwnd
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.slow.log.threshold
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.strict_uri_parsing
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.transaction_active_timeout_in
- configFile: records.config
- value: INT 900
- - name: CONFIG proxy.config.http.transaction_active_timeout_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.transaction_no_activity_timeout_in
- configFile: records.config
- value: INT 30
- - name: CONFIG proxy.config.http.transaction_no_activity_timeout_out
- configFile: records.config
- value: INT 30
- - name: CONFIG proxy.config.http.uncacheable_requests_bypass_parent
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.http.use_client_target_addr
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http.wait_for_cache
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.http.websocket.max_number_of_connections
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.http2.header_table_size
- configFile: records.config
- value: INT 4096
- - name: CONFIG proxy.config.http2.initial_window_size_in
- configFile: records.config
- value: INT 1048576
- - name: CONFIG proxy.config.http2.max_active_streams_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http2.max_concurrent_streams_in
- configFile: records.config
- value: INT 100
- - name: CONFIG proxy.config.http2.max_frame_size
- configFile: records.config
- value: INT 16384
- - name: CONFIG proxy.config.http2.max_header_list_size
- configFile: records.config
- value: INT 4294967295
- - name: CONFIG proxy.config.http2.min_concurrent_streams_in
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.http2.push_diary_size
- configFile: records.config
- value: INT 256
- - name: CONFIG proxy.config.http2.stream_priority_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.http_ui_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.log.auto_delete_rolled_files
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.log.collation_client_timeout
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.log.collation_host
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.log.collation_host_tagged
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.log.collation_host_timeout
- configFile: records.config
- value: INT 86390
- - name: CONFIG proxy.config.log.collation_port
- configFile: records.config
- value: INT 8085
- - name: CONFIG proxy.config.log.collation_retry_sec
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.log.collation_secret
- configFile: records.config
- value: STRING foobar
- - name: CONFIG proxy.config.log.config.filename
- configFile: records.config
- value: STRING logging.config
- - name: CONFIG proxy.config.log.hostname
- configFile: records.config
- value: STRING localhost
- - name: CONFIG proxy.config.log.logfile_dir
- configFile: records.config
- value: STRING var/log/trafficserver
- - name: CONFIG proxy.config.log.logfile_perm
- configFile: records.config
- value: STRING rw-r--r--
- - name: CONFIG proxy.config.log.logging_enabled
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.log.max_secs_per_buffer
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.log.max_space_mb_for_logs
- configFile: records.config
- value: INT 25000
- - name: CONFIG proxy.config.log.max_space_mb_for_orphan_logs
- configFile: records.config
- value: INT 25
- - name: CONFIG proxy.config.log.max_space_mb_headroom
- configFile: records.config
- value: INT 1000
- - name: CONFIG proxy.config.log.periodic_tasks_interval
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.log.rolling_enabled
- configFile: records.config
- value: INT 3
- - name: CONFIG proxy.config.log.rolling_interval_sec
- configFile: records.config
- value: INT 86400
- - name: CONFIG proxy.config.log.rolling_offset_hr
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.log.rolling_size_mb
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.log.sampling_frequency
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.manager_binary
- configFile: records.config
- value: STRING traffic_manager
- - name: CONFIG proxy.config.mlock_enabled
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.net.accept_period
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.connections_throttle
- configFile: records.config
- value: INT 500000
- - name: CONFIG proxy.config.net.default_inactivity_timeout
- configFile: records.config
- value: INT 180
- - name: CONFIG proxy.config.net.defer_accept
- configFile: records.config
- value: INT 45
- - name: CONFIG proxy.config.net.event_period
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.inactivity_check_frequency
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.net.listen_backlog
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.net.max_connections_active_in
- configFile: records.config
- value: INT 500000
- - name: CONFIG proxy.config.net.max_connections_in
- configFile: records.config
- value: INT 500000
- - name: CONFIG proxy.config.net.poll_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.retry_delay
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.net.sock_mss_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_option_flag_in
- configFile: records.config
- value: INT 5
- - name: CONFIG proxy.config.net.sock_option_flag_out
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.net.sock_packet_mark_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_packet_mark_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_packet_tos_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_packet_tos_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_recv_buffer_size_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_recv_buffer_size_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.sock_send_buffer_size_in
- configFile: records.config
- value: INT 262144
- - name: CONFIG proxy.config.net.sock_send_buffer_size_out
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.net.throttle_delay
- configFile: records.config
- value: INT 50
- - name: CONFIG proxy.config.output.logfile
- configFile: records.config
- value: STRING traffic.out
- - name: CONFIG proxy.config.output.logfile.rolling_enabled
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.output.logfile.rolling_interval_sec
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.output.logfile.rolling_size_mb
- configFile: records.config
- value: INT 1024
- - name: CONFIG proxy.config.process_manager.mgmt_port
- configFile: records.config
- value: INT 8084
- - name: CONFIG proxy.config.product_company
- configFile: records.config
- value: STRING Apache
- - name: CONFIG proxy.config.product_name
- configFile: records.config
- value: STRING Traffic
- - name: CONFIG proxy.config.product_vendor
- configFile: records.config
- value: STRING Apache
- - name: CONFIG proxy.config.proxy_binary
- configFile: records.config
- value: STRING traffic_server
- - name: CONFIG proxy.config.proxy_binary_opts
- configFile: records.config
- value: STRING -M
- - name: CONFIG proxy.config.proxy_name
- configFile: records.config
- value: STRING __HOSTNAME__
- - name: CONFIG proxy.config.remap.num_remap_threads
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.restart.active_client_threshold
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.reverse_proxy.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.snapshot_dir
- configFile: records.config
- value: STRING snapshots
- - name: CONFIG proxy.config.socks.accept_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.socks.accept_port
- configFile: records.config
- value: INT 1080
- - name: CONFIG proxy.config.socks.connection_attempts
- configFile: records.config
- value: INT 4
- - name: CONFIG proxy.config.socks.http_port
- configFile: records.config
- value: INT 80
- - name: CONFIG proxy.config.socks.per_server_connection_attempts
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.socks.server_connect_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.socks.server_fail_threshold
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.socks.server_retry_time
- configFile: records.config
- value: INT 300
- - name: CONFIG proxy.config.socks.server_retry_timeout
- configFile: records.config
- value: INT 300
- - name: CONFIG proxy.config.socks.socks_config_file
- configFile: records.config
- value: STRING socks.config
- - name: CONFIG proxy.config.socks.socks_needed
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.socks.socks_timeout
- configFile: records.config
- value: INT 100
- - name: CONFIG proxy.config.socks.socks_version
- configFile: records.config
- value: INT 4
- - name: CONFIG proxy.config.srv_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.CA.cert.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.CA.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.TLSv1
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.TLSv1_1
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.TLSv1_2
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.allow_client_renegotiation
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.cert.load_elevated
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.client.CA.cert.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.client.CA.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.client.cert.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.client.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.client.certification_level
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.client.private_key.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.client.private_key.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.client.verify.server
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.handshake_timeout_in
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.hsts_include_subdomains
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.hsts_max_age
- configFile: records.config
- value: INT -1
- - name: CONFIG proxy.config.ssl.max_record_size
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.ocsp.cache_timeout
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.ssl.ocsp.enabled
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.ocsp.request_timeout
- configFile: records.config
- value: INT 10
- - name: CONFIG proxy.config.ssl.ocsp.update_period
- configFile: records.config
- value: INT 60
- - name: CONFIG proxy.config.ssl.server.cert.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.server.cert_chain.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.server.cipher_suite
- configFile: records.config
- value: STRING ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!RC4:!SRP:!DSS:!PSK:!aNULL:!eNULL:!SSLv2:@STRENGTH
- - name: CONFIG proxy.config.ssl.server.dhparams_file
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.server.honor_cipher_order
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.server.private_key.path
- configFile: records.config
- value: STRING etc/trafficserver/ssl
- - name: CONFIG proxy.config.ssl.server.session_ticket.enable
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.server.ticket_key.filename
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.session_cache
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.ssl.session_cache.auto_clear
- configFile: records.config
- value: INT 1
- - name: CONFIG proxy.config.ssl.session_cache.num_buckets
- configFile: records.config
- value: INT 256
- - name: CONFIG proxy.config.ssl.session_cache.size
- configFile: records.config
- value: INT 102400
- - name: CONFIG proxy.config.ssl.session_cache.skip_cache_on_bucket_contention
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.session_cache.timeout
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.wire_trace_addr
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.ssl.wire_trace_enabled
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.wire_trace_percentage
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.ssl.wire_trace_server_name
- configFile: records.config
- value: STRING NULL
- - name: CONFIG proxy.config.syslog_facility
- configFile: records.config
- value: STRING LOG_DAEMON
- - name: CONFIG proxy.config.system.file_max_pct
- configFile: records.config
- value: FLOAT 0.9
- - name: CONFIG proxy.config.task_threads
- configFile: records.config
- value: INT 2
- - name: CONFIG proxy.config.thread.default.stacksize
- configFile: records.config
- value: INT 1048576
- - name: CONFIG proxy.config.url_remap.filename
- configFile: records.config
- value: STRING remap.config
- - name: CONFIG proxy.config.url_remap.pristine_host_hdr
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.url_remap.remap_required
- configFile: records.config
- value: INT 0
- - name: CONFIG proxy.config.websocket.active_timeout
- configFile: records.config
- value: INT 3600
- - name: CONFIG proxy.config.websocket.no_activity_timeout
- configFile: records.config
- value: INT 600
- - name: LOCAL proxy.local.cluster.type
- configFile: records.config
- value: INT 3
- - name: LOCAL proxy.local.http.parent_proxy.disable_connect_tunneling
- configFile: records.config
- value: INT 0
- - name: LOCAL proxy.local.log.collation_mode
- configFile: records.config
- value: INT 0
- - name: location
- configFile: records.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: regex_revalidate.config
- value: "/opt/trafficserver/etc/trafficserver"
- - name: location
- configFile: remap.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: Disk_Volume
- configFile: storage.config
- value: '1'
- - name: Drive_Letters
- configFile: storage.config
- value: b
- - name: Drive_Prefix
- configFile: storage.config
- value: "/dev/vd"
- - name: RAM_Drive_Letters
- configFile: storage.config
- value: "{{ dl_atsmid_ram_drive_letters }}"
- - name: RAM_Drive_Prefix
- configFile: storage.config
- value: "{{ dl_atsmid_ram_drive_prefix }}"
- - name: RAM_Volume
- configFile: storage.config
- value: '2'
- - name: location
- configFile: storage.config
- value: "/opt/trafficserver/etc/trafficserver/"
- - name: location
- configFile: volume.config
- value: "/opt/trafficserver/etc/trafficserver/"
+ parameters: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.edge.common + dl_ds_default_profile_layers.ats.edge['v'+dl_ds_ats_major_version] }}"
+ - name: "MID_ATS_7_{{ Target_cdn_delegation }}"
+ description: "Mid cache({{ Target_cdn_delegation }}) - ATS 7"
+ cdn: "{{ Target_cdn_delegation }}"
+ type: ATS_PROFILE
+ routingDisabled: false
+ parameters: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.mid.common + dl_ds_default_profile_layers.ats.mid['v'+dl_ds_ats_major_version] }}"
+ - name: "MID_ATS_8_{{ Target_cdn_delegation }}"
+ description: "Mid cache({{ Target_cdn_delegation }}) - ATS 8"
+ cdn: "{{ Target_cdn_delegation }}"
+ type: ATS_PROFILE
+ routingDisabled: false
+ parameters: "{{ dl_ds_default_profile_layers.ats.common.common + dl_ds_default_profile_layers.ats.common['v'+dl_ds_ats_major_version] + dl_ds_default_profile_layers.ats.mid.common + dl_ds_default_profile_layers.ats.mid['v'+dl_ds_ats_major_version] }}"
- name: "DS_{{ target_xmlId }}_consistenthash"
description: "MSO {{ target_xmlId }} - consistent hash"
cdn: "{{ Target_cdn_delegation }}"
@@ -3853,7 +1893,7 @@ dl_ds_default_ds_template:
uniqueKey: simple-dns-live-nat
- displayName: Global ANY_MAP DS
longDesc: A basic ANY_MAP routed Delivery Service to catch all unmapped ATS requests and add some extra headers
- remapText: "map / http://{{ groups['fakeorigin'] | first }}/ @plugin=header_rewrite.so @pparam=anymap_hdr_rw.config"
+ remapText: "map / http://{{ dl_hosts_fakeorigin | first }}/ @plugin=header_rewrite.so @pparam=anymap_hdr_rw.config"
typeName: ANY_MAP
uniqueKey: global-any-map
- displayName: Steering with ordered targets DS
diff --git a/infrastructure/ansible/roles/dataset_loader/filter_plugins/dsloader.filter.util.py b/infrastructure/ansible/roles/dataset_loader/filter_plugins/dsloader.filter.util.py
new file mode 100644
index 0000000..41aa522
--- /dev/null
+++ b/infrastructure/ansible/roles/dataset_loader/filter_plugins/dsloader.filter.util.py
@@ -0,0 +1,79 @@
+#!/usr/bin/python
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function, unicode_literals)
+__metaclass__ = type
+
+import re
+
+class FilterModule(object):
+ def filters(self):
+ return {
+ 'associate_round_robin': self.associate_round_robin,
+ 'denormalize_association': self.denormalize_association,
+ 'associate_profile_to_servers': self.associate_profile_to_servers
+ }
+ def associate_round_robin(self, set1, set2):
+ step_size = len(set1)
+ out_list_normal = {}
+ for i, val in enumerate(set1):
+ # Offset the beginning of the second set by the index of where we are processing the first set
+ sublist = set2[i:]
+ # Snag every Nth element from the offset sublist and associte that with set1
+ out_list_normal[val] = sublist[::step_size]
+ return out_list_normal
+
+ def denormalize_association(self, association):
+ out = {}
+ for key, vals in list(association.items()):
+ for val in vals:
+ out[val] = key
+ return out
+
+ def associate_profile_to_servers(self, host_list, profile_list, hardware_profile_map, hostvars, profile_whitelist):
+ out = {}
+ hardware_profile_suffix_regex = re.compile(r'^(.*?)(?:_hdwr\d+)?$')
+ compound_key_to_profile_map = {}
+ compound_key_to_host_map = {}
+ for cdnName in set(hostvars[host]['cdn'] for host in hostvars):
+ for componentName in set(hostvars[host]['component'] for host in hostvars):
+ compound_key = ""+(cdnName)+"_"+(componentName)
+ eligible_profiles = []
+ for profileName in profile_list:
+ common_profileName_re = hardware_profile_suffix_regex.search(profileName) # should always match unless something is really wrong
+ if re.match(profile_whitelist[componentName],profileName) and common_profileName_re is not None:
+ # Get the name of the profile without the hardware suffix so that we ignore that factor when assigning initial placements until later
+ eligible_profiles.append(common_profileName_re.group(1).lower())
+ eligible_profiles = list(set(eligible_profiles)) # deduplicate the list
+ # Bail out early if there aren't any profiles that could be assigned
+ if len(eligible_profiles) > 0:
+ compound_key_to_profile_map[compound_key] = eligible_profiles
+ eligible_hosts = []
+ for host in host_list:
+ if hostvars[host]['cdn'] == cdnName and hostvars[host]['component'] == componentName:
+ eligible_hosts.append(host)
+ if len(eligible_hosts) > 0:
+ compound_key_to_host_map[compound_key] = eligible_hosts
+
+ # Ignores combinations that either have no profiles or hosts
+ for key in list(compound_key_to_host_map.keys()):
+ host_to_profile_commonName_map = self.denormalize_association(self.associate_round_robin(compound_key_to_profile_map[key],compound_key_to_host_map[key]))
+ for host, common_profileName in list(host_to_profile_commonName_map.items()):
+ if host in list(hardware_profile_map.keys()):
+ # Re-apply the hardware profile variances
+ out[host] = common_profileName+"_"+hardware_profile_map[host]['hardware_profile']
+ else:
+ out[host] = common_profileName
+
+ return out
diff --git a/infrastructure/ansible/roles/dataset_loader/parameter.diff.exclusions.yml b/infrastructure/ansible/roles/dataset_loader/parameter.diff.exclusions.yml
new file mode 100644
index 0000000..b6e3280
--- /dev/null
+++ b/infrastructure/ansible/roles/dataset_loader/parameter.diff.exclusions.yml
@@ -0,0 +1,77 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# These use a contains comparision, usually best to be as specific as possible
+parameter_diff_exclusions:
+ - configFile: astats.config
+ name: allow_ip
+ - configFile: records.config
+ name: CONFIG proxy.config.cache.ram_cache.size
+ - configFile: CRConfig.json
+ name: domain_name
+ - configFile: storage.config
+ name: Drive_Letters
+ - configFile: storage.config
+ name: Drive_Prefix
+ - configFile: rascal.properties
+ name: health.threshold.kbps
+ - configFile: rascal.properties
+ name: health.threshold.loadavg
+ - configFile: ip_allow.config
+ name: purge_allow_ip
+ - configFile: storage.config
+ name: RAM_Drive_Letters
+ - configFile: storage.config
+ name: RAM_Drive_Prefix
+ - configFile: parent.config
+ name: weight
+ - configFile: chkconfig
+ name: trafficserver
+ - configFile: records.config
+ name: CONFIG proxy.config.http.referer_default_redirect
+ - configFile: rascal.properties
+ name: health.threshold.availableBandwidthInKbps
+ - configFile: package
+ name: jemalloc-
+ - configFile: hdr_rw_
+ name: location
+ - configFile: plugin.config
+ name: remap_stats.so
+ - configFile: .config
+ name: access_key
+ - configFile: url_sig_
+ name: error_url
+ - configFile: regex_remap_
+ name: location
+ - configFile: s3_auth_
+ name: location
+ - configFile: s3_auth_
+ name: secret_key
+ - configFile: s3_auth_
+ name: v4-include-headers
+ - configFile: s3_auth_
+ name: version
+ - configFile: url_sig_
+ name: location
+ - configFile: url_sig_
+ name: excl_regex
+ - configFile: .lua
+ name: data
+ - configFile: .lua
+ name: location
+ - configFile: anymap_hdr_rw.config
+ name: location
+ - configFile: anymap_hdr_rw.config
+ name: data
diff --git a/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md b/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md
index 82d7483..8eaeeb0 100644
--- a/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md
+++ b/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md
@@ -18,9 +18,188 @@
-->
# Conversion of existing profile paramters to yaml dictionary
+## Non-ATS
1. Install `jq`
2. Install `ruby`
3. Curl to get the response of https://{{ TO_BASE_URL }}/api/{{ dl_to_api_version }}/profiles/name/{{ TARGET_PROFILE }}/parameters and save that to a file named `profile.parameters.json`
4. `jq -r '[.[] | sort_by(.configFile,.name,.value)[] | {name: .name,configFile: .configFile,value: .value,secure: (if .secure then 1 else 0 end)}]' profile.parameters.json > profile.parameters.filtered.json`
5. `ruby -ryaml -rjson -e 'puts YAML.dump(JSON.parse(STDIN.read))' < profile.parameters.filtered.json > profile.parameters.yml`
6. Transplant into appropriate ansible var file
+
+## ATS
+ATS profiles are both huge and overlap eachother, even with only one edge+mid profile per ATS version. As a result they were pulled out into a separate normalized structure with redundant parameters removed for a ~87% reduction.
+
+In order to update them, it's important to know the scope of the change you're making such as all instances of ATS vs only edges running ATS7. This hopefully helps with maintaining modern recommendations backward into older ATS versions as applicable.
+
+### analyze.ats.profiles.yml
+This is a helper ansible playbook which takes two existing traffic_ops profiles and provides information on changes and redundancy of parameters.
+
+#### Usage
+```shell
+ansible-playbook -i localhost analyze.ats.profiles.yml -e "dl_to_url=$TO_URL" -e "dl_to_user=$TO_USER" -e "dl_to_user_password=$TO_PASSWORD" -e "TARGET_PROFILE=MID_ATS_8" -e "BASE_PROFILE=MID_ATS_7"
+```
+##### Required Parameters:
+* dl_to_url : TrafficOps URL (http://to.kabletown.invalid)
+* dl_to_user : TrafficOps User (user)
+* dl_to_password : TrafficOps Password (pass)
+* BASE_PROFILE : TrafficOps original base profile name (MID_ATS_7)
+* TARGET_PROFILE : TrafficOps target new profile name (MID_ATS_8)
+
+##### Optional Parameters:
+* override_target_host_fqdn : Bypass the selection of a target host to obtain defaults by profile association
+* override_base_host_fqdn : Bypass the selection of a base host to obtain defaults by profile association
+* output_path : Alternate path to send output files. Defaults to playbook directory.
+* exclution_file_path : A path to a variable file containing exclusions to consider when comparing profiles
+
+##### Additional Requirements:
+* The target and base profiles must exist in TrafficOps
+* Either:
+ * A host override optional parameter is supplied
+ * A host must be attached and reachable to each profile
+* Each specified host must have ATS installed and running
+
+#### Parameter exclusions
+Included is a default set of parameter names/configFiles that are excluded from comparison with the dataset loader and TO diff output. This is because there are some parameters which naturally vary by hardware, CDN, or delivery service assignments. It does use a simple string contains logic to know about exclusions, so generally being more specific is appropriate if adjusting them.
+
+#### Output
+There are two output files from this playbook:
+
+1. ats_profile_diff_output.yml
+
+Simply a denormalized rendering of the normalized target profile parameters. Useful if you'd like to still use the above non-ats method for comparison as a double verification.
+
+2. ats_profile_diff_output.json
+
+The primary output to help process key information. There are several important bits to note in the structure:
+
+##### Sample output for an ATS7 vs ATS8 edge
+```json
+{
+ "ats": {
+ "ats_default_differences_between_base_and_target_between_base_and_target": [
+ {
+ "base_value": "CONFIG proxy.config.http.request_via_str STRING ApacheTrafficServer/7.1.4",
+ "target_value": "CONFIG proxy.config.http.request_via_str STRING ApacheTrafficServer/8.1.2"
+ }
+ ],
+ "ats_defaults_missing_from_base_in_target": [
+ "CONFIG proxy.config.http.negative_caching_list STRING 204 305 403 404 414 500 501 502 503 504"
+ ],
+ "ats_defaults_missing_from_target_in_base": [
+ "CONFIG proxy.config.admin.synthetic_port INT 8083"
+ ]
+ },
+ "base_ats_version": "trafficserver-7.1.4_rc0-26.b5fbc9a.el7.x86_64",
+ "base_host": "cdn-ec-ats7.kabletown.invalid",
+ "base_profile": "EDGE_ATS7",
+ "dataset_loader": {
+ "param_value_differences_between_dataset_loader_and_base": [
+ {
+ "configFile": "records.config",
+ "name": "CONFIG proxy.config.http.connect_attempts_max_retries",
+ "value": {
+ "dataset_loader": "INT 6",
+ "traffic_ops": "INT 3"
+ }
+ }
+ ],
+ "param_value_differences_between_dataset_loader_and_target": [
+ {
+ "configFile": "CRConfig.json",
+ "name": "weight",
+ "value": {
+ "dataset_loader": "1.0",
+ "traffic_ops": "1.2"
+ }
+ }
+ ],
+ "params_missing_from_base_in_dataset_loader": [],
+ "params_missing_from_dataset_loader_in_base": [
+ {
+ "configFile": "records.config",
+ "name": "CONFIG proxy.config.http.wait_for_cache",
+ "value": "INT 2"
+ }
+ ],
+ "params_missing_from_dataset_loader_in_target": [],
+ "params_missing_from_target_in_dataset_loader": [],
+ "redundant_parameters_in_both_base_and_target_in_dataset_loader": [],
+ "redundant_parameters_with_base_params_and_defaults_included_in_dataset_loader_only": [],
+ "redundant_parameters_with_target_params_and_defaults_included_in_dataset_loader_only": []
+ },
+ "target_ats_version": "trafficserver-8.1.1-21.402826e.el7.x86_64",
+ "target_host": "cdn-ec-ats8.kabletown.invalid",
+ "target_profile": "EDGE_ATS8",
+ "traffic_ops": {
+ "redundant_parameters_in_both_base_and_target_in_traffic_ops": [
+ {
+ "configFile": "records.config",
+ "name": "CONFIG proxy.config.admin.admin_user",
+ "value": "STRING admin"
+ }
+ ],
+ "redundant_parameters_with_base_params_and_defaults_included_in_traffic_ops_only": [
+ {
+ "configFile": "records.config",
+ "name": "CONFIG proxy.config.admin.synthetic_port",
+ "value": "INT 8083"
+ }
+ ],
+ "redundant_parameters_with_target_params_and_defaults_included_in_traffic_ops_only": [
+ {
+ "configFile": "records.config",
+ "name": "CONFIG proxy.config.log.config.filename",
+ "value": "STRING logging.yaml"
+ }
+ ]
+ }
+}
+```
+
+###### Basic info
+This is included so looking at the outputs later have enough information to explain where it came from and was comparing.
+
+* base_ats_version : ATS RPM version as determined by probing an associated or overridden directly
+* base_host : The host selected for use either by override or just being the first to respond that is attached to the base profile
+* base_profile : The original (older) ATS version
+* target_ats_version : ATS RPM version as determined by probing an associated or overridden directly
+* target_host : The host selected for use either by override or just being the first to respond that is attached to the target profile
+* target_profile : The target (newer) ATS version
+
+###### ATS info
+This data has no concept of Traffic Ops and is purely based on the defaults as reported by traffic_ctl.
+
+* ats_default_differences_between_base_and_target_between_base_and_target: Defautls present in both with differing values
+* ats_defaults_missing_from_base_in_target : New parameters added to the target
+* ats_defaults_missing_from_target_in_base: Parameters removed from the target
+
+###### TrafficOps info
+This uses the ATS default information in both target and base along with the TrafficOps profiles to identify redundant unnecessary parameters.
+
+* redundant_parameters_in_both_base_and_target_in_traffic_ops
+* redundant_parameters_with_base_params_and_defaults_included_in_traffic_ops_only
+* redundant_parameters_with_target_params_and_defaults_included_in_traffic_ops_only
+
+###### Dataset Loader info
+This compares data from all sources to help provide guidance on how to better maintain the normalized redundancy-free dataset loader defaults.
+
+1. Parameters related to value differences in the dataset loader going both directions
+ * param_value_differences_between_dataset_loader_and_base
+ * param_value_differences_between_dataset_loader_and_target
+2. Parameters dealing with things added or removed from the base version and dataset loader
+ * params_missing_from_base_in_dataset_loader
+ * params_missing_from_dataset_loader_in_base
+3. Parameters dealing with things added or removed from the target version and dataset loader
+ * params_missing_from_dataset_loader_in_target
+ * params_missing_from_target_in_dataset_loader
+4. Parameters Identifying redundant parameters in the dataset loader
+ * redundant_parameters_in_both_base_and_target_in_dataset_loader
+ * redundant_parameters_with_base_params_and_defaults_included_in_dataset_loader_only
+ * redundant_parameters_with_target_params_and_defaults_included_in_dataset_loader_only
+
+##### Interpreting output
+1. dataset_loader.redundant* parameters should generally always be empty. If not, a default has probably changed and made a previous value newly redundant
+2. dataset_loader.* these should be weighed carefully as they indicate changes that might be worth modeling as a default update
+3. trafficOps.* parameters are mostly there informationally so that you can cleanup TrafficOps if you like
+4. ats.* are there so that engineers routinely working with ATS have a concise list of changes between versions without influence from ATC. It's likely these additions/removals may lead to changes in the dataset loader defaults as appropriate.
+5. When updating the dataset loader defaults for ATS it's important to think about the scope of changes. This is so that best practice updates are correctly backported to older versions of ATS as well, but may diverge by ATS version or tier if needed.
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/assign_steering_targets.yml b/infrastructure/ansible/roles/dataset_loader/tasks/assign_steering_targets.yml
index f969437..4a1cec1 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/assign_steering_targets.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/assign_steering_targets.yml
@@ -20,6 +20,9 @@
register: create_steering_assignment_out
failed_when: (create_steering_assignment_out.status == 400 and create_steering_assignment_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_steering_assignment_out.status > 400 and create_steering_assignment_out.status < 600)
with_items: "{{ Target_steering_ds.1.assigned_steering_targets }}"
+ no_log: true
+ retries: 10
+ delay: 10
vars:
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
target_ds_query: "[?cdnId == `{{ Target_cdn_id }}` && starts_with(xmlId, `{{ item.uniqueKey }}`) == `true`].id | [0]"
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/cache_parameter_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/cache_parameter_loader.yml
new file mode 100644
index 0000000..b286e89
--- /dev/null
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/cache_parameter_loader.yml
@@ -0,0 +1,69 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+- name: Create Cache Profiles - Per CDN and Hardware Profile
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
+ method: POST
+ body: "{{ lookup('template', 'profile.j2') }}"
+ #with_items: "{{ dl_ds_merged_profile_cdntemplates }}"
+ with_nested:
+ - "{{ dl_ds_merged_profile_cdntemplates }}"
+ - "{{ eligible_hardware_component_names }}"
+ when: (item.0.type == 'ATS_PROFILE' or item.0.type == 'GROVE_PROFILE') and (item.0.name is regex(dl_ds_merged_profile_prefix_ansible_component_map[item.1]))
+ vars:
+ name: "{{ item.0.name }}_{{ Target_hardware_profile.key }}"
+ description: "{{ item.0.description }} for hardware profile {{ Target_hardware_profile.key }}"
+ cdn: "{{ Target_cdn_id }}"
+ type: "{{ item.0.type }}"
+ routingDisabled: "{{ (item.0.routingDisabled | default(false)) | lower }}"
+ error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ target_xmlId: "Invalid (only for rendering)"
+ eligible_hardware_component_names: "{{ cache_hardware_profile_map | dict2items | json_query(eligible_hardware_component_names_query) | map('lower') | list | unique }}"
+ eligible_hardware_component_names_query: "[?value.hardware_profile==`{{ Target_hardware_profile.key }}`].value.component"
+ register: create_profiles_out
+ failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
+
+- name: Create and Associate Parameters to Cache Profiles - Per CDN and Hardware Profile
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ item.0.name }}_{{ Target_hardware_profile.key }}/parameters"
+ method: POST
+ body: "{{ lookup('template', 'parameter.j2') }}"
+ when: (item.0.type == 'ATS_PROFILE' or item.0.type == 'GROVE_PROFILE') and (item.0.name is regex(dl_ds_merged_profile_prefix_ansible_component_map[item.1]))
+ with_nested:
+ - "{{ dl_ds_merged_profile_cdntemplates }}"
+ - "{{ eligible_hardware_component_names }}"
+ vars:
+ paramset: "{{ item.0.parameters | default([]) }}"
+ cdn_query: "response[?name == '{{ item.0.cdn | default('ALL') }}'].id | [0]"
+ error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ target_xmlId: "Invalid (only for rendering)"
+ eligible_hardware_component_names: "{{ cache_hardware_profile_map | dict2items | json_query(eligible_hardware_component_names_query) | map('lower') | list | unique }}"
+ eligible_hardware_component_names_query: "[?value.hardware_profile==`{{ Target_hardware_profile.key }}`].value.component"
+ cache_drive_letter_regex: "^(?:{{ dl_ds_merged_cache_block_device_prefix_whitelist | join('|') }})(\\w+)$"
+ Target_hardware_profile_cache_disk_letters: "{{ Target_hardware_profile.value.cache_disks | map('regex_replace',cache_drive_letter_regex,'\\1') | list | join(',') }}"
+ cache_drive_letter_prefix_regex: "^({{ dl_ds_merged_cache_block_device_prefix_whitelist | join('|') }})(\\w+)$"
+ Target_hardware_profile_cache_disk_prefix: "{{ Target_hardware_profile.value.cache_disks | map('regex_replace',cache_drive_letter_prefix_regex,'\\1') | list | first | default('INVALID_DRIVE_PREFIX') }}"
+ ram_drive_letter_regex: "^(?:{{ dl_ds_merged_cache_ram_device_prefix_whitelist | join('|') }})(\\w+)$"
+ Target_hardware_profile_ram_disk_letters: "{{ Target_hardware_profile.value.ram_disks | map('regex_replace',ram_drive_letter_regex,'\\1') | list | join(',') }}"
+ ram_drive_letter_prefix_regex: "^({{ dl_ds_merged_cache_ram_device_prefix_whitelist | join('|') }})(\\w+)$"
+ Target_hardware_profile_ram_disk_prefix: "{{ Target_hardware_profile.value.ram_disks | map('regex_replace',ram_drive_letter_prefix_regex,'\\1') | list | first | default('INVALID_RAM_DRIVE_PREFIX') }}"
+ register: create_profiles_out
+ failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/create_ds_profiles_params.yml b/infrastructure/ansible/roles/dataset_loader/tasks/create_ds_profiles_params.yml
index b45e7ff..4927b86 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/create_ds_profiles_params.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/create_ds_profiles_params.yml
@@ -29,6 +29,9 @@
target_xmlId: "{{ Target_ds.xmlId | default(computed_xmlid) }}"
register: create_profiles_out
failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Create and Associate DS Parameters - Per CDN
uri:
@@ -38,9 +41,13 @@
with_items: "{{ dl_ds_merged_profile_cdntemplates | selectattr('type','equalto','DS_PROFILE') }}"
when: ( (fixed_profile_name != '' and fixed_profile_name == item.name) or (ds_suffix != '' and item.name.endswith(ds_suffix)) )
vars:
+ paramset: "{{ item.parameters | default([]) }}"
cdn_query: "response[?name == '{{ item.cdn | default('ALL') }}'].id | [0]"
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
computed_xmlid: "{{ Target_ds.uniqueKey }}-{{ Target_cdn_delegation | lower }}"
target_xmlId: "{{ Target_ds.xmlId | default(computed_xmlid) }}"
register: create_profiles_out
failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml
index c842fd8..0a5f88f 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml
@@ -20,16 +20,18 @@
Content-Type: "application/x-www-form-urlencoded"
register: dl_mojo_token
no_log: true
+ retries: 10
+ delay: 10
- name: Collect All CDN delegations assigned to Traffic Routers
set_fact:
tmp_cdnDelegation: "{{ hostvars[item]['cdn'] }}"
- with_items: "{{groups['traffic_router']}}"
+ with_items: "{{dl_hosts_tr}}"
register: tmp_cdnDelegation_result
- name: Convert CDN Delegation facts to more usable list
set_fact:
- cdnDelegationList: "{{ tmp_cdnDelegation_result.results | map(attribute='ansible_facts.tmp_cdnDelegation') | difference(excluded_cdn) | list | unique }}"
+ cdnDelegationList: "{{ tmp_cdnDelegation_result.results | map(attribute='ansible_facts.tmp_cdnDelegation') | difference(excluded_cdn | lower) | map('lower') | list | unique }}"
vars:
excluded_cdn: ALL
@@ -42,57 +44,78 @@
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cdns"
method: GET
register: get_all_cdns
+ no_log: true
+ retries: 10
+ delay: 10
- name: Update the Primary CDN
uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cdns/{{ get_all_cdns.json | to_json | from_json | json_query(cdn_query) }}"
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cdns/{{ existing_primary_cdn.id }}"
method: PUT
body: "{{ lookup('template', 'cdn.j2') }}"
vars:
name: "{{ dl_ds_merged_cdns[cdnDelegationPrimary].name | default(cdnDelegationPrimary) }}"
- domainName: "{{ cdnDelegationPrimary }}.{{ (groups['traffic_ops'] | first).split('.')[1:] | join('.') | lower }}"
+ domainName: "{{ cdnDelegationPrimary }}.{{ (dl_hosts_to | first).split('.')[1:] | join('.') | lower }}"
dnssecEnabled: "{{ dl_ds_merged_cdns[cdnDelegationPrimary].dnssecEnabled | default(false) | lower }}"
- cdn_query: "response[?starts_with(domainName,`{{ cdnDelegationPrimary | lower }}`) == `true`].id | [0]"
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ existing_primary_cdn: "{{ (get_all_cdns.json.response | to_json | lower | from_json) | selectattr('domainname', 'search', ('^'+cdnDelegationPrimary+'\\.')) | list | first }}"
register: update_cdn_out
failed_when: (update_cdn_out.status == 400 and update_cdn_out.json | to_json | from_json | json_query(error_query) | length != 0) or (update_cdn_out.status > 400 and update_cdn_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Create additional CDNs having delegations
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cdns"
method: POST
body: "{{ lookup('template', 'cdn.j2') }}"
- with_items: "{{ cdnDelegationList | difference(cdnDelegationPrimary) | intersect(dl_ds_merged_cdns | list) + cdnDelegationList | difference(dl_ds_merged_cdns | list)}}"
+ with_items: "{{ cdnDelegationList | difference(cdnDelegationPrimary) | intersect(dl_ds_merged_cdns | map('lower') | list) + cdnDelegationList | difference(dl_ds_merged_cdns | map('lower') | list)}}"
vars:
name: "{{ item.name | default(item) }}"
- domainName: "{{ item }}.{{ (groups['traffic_ops'] | first).split('.')[1:] | join('.') }}"
+ domainName: "{{ item }}.{{ (dl_hosts_to | first).split('.')[1:] | join('.') }}"
dnssecEnabled: "{{ dl_ds_merged_cdns[item].dnssecEnabled | default(false) | lower }}"
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_cdns_out
failed_when: (create_cdns_out.status == 400 and create_cdns_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_cdns_out.status > 400 and create_cdns_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All CDNs
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cdns"
method: GET
register: get_all_cdns
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_cdns['status']|default(0) == 200
- name: Assign fqdn to cdn
set_fact:
cdn_assignments: "{{ (cdn_assignments | default({})) | combine({ item: hostvars[item].cdn }) }}"
- with_items: "{{ groups['all'] }}"
+ with_items: "{{ dl_hosts_all }}"
- name: Get All Tenants
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/tenants"
method: GET
register: get_all_tenants
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_tenants['status']|default(0) == 200
- name: Get All Roles
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/roles"
method: GET
register: get_all_roles
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_roles['status']|default(0) == 200
- name: Create Types
uri:
@@ -107,12 +130,19 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_types_out
failed_when: (create_types_out.status == 400 and create_types_out.json | to_json | from_json | json_query(error_query) | length != 0) or ( create_types_out.status > 400 and create_types_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Types
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/types"
method: GET
register: get_all_types
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_types['status']|default(0) == 200
- name: Create Users
uri:
@@ -142,7 +172,9 @@
tenantId: "{{ get_all_tenants.json | json_query(tenant_query) | default(omit) }}"
username: "{{ item.username }}"
register: create_user_out
- #no_log: true
+ no_log: true
+ retries: 10
+ delay: 10
failed_when: (create_user_out.status == 400 and create_user_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_user_out.status > 400 and create_user_out.status < 600)
- name: Get All Users
@@ -163,6 +195,9 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_cachegroup_out
failed_when: (create_cachegroup_out.status == 400 and create_cachegroup_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_cachegroup_out.status > 400 and create_cachegroup_out.status < 600 and create_cachegroup_out.status != 500)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Create Cachegroups - Infrastructure Tier
uri:
@@ -176,6 +211,9 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_cachegroup_out
failed_when: (create_cachegroup_out.status == 400 and create_cachegroup_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_cachegroup_out.status > 400 and create_cachegroup_out.status < 600 and create_cachegroup_out.status != 500)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Create Cachegroups - Origin Tier
uri:
@@ -189,12 +227,19 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_cachegroup_out
failed_when: (create_cachegroup_out.status == 400 and create_cachegroup_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_cachegroup_out.status > 400 and create_cachegroup_out.status < 600 and create_cachegroup_out.status != 500)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Cachegroups - Origin Tier
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cachegroups"
method: GET
register: get_all_cachegroups
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_cachegroups['status']|default(0) == 200
- name: Create Cachegroups - Mid Tier
uri:
@@ -212,12 +257,19 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_cachegroup_out
failed_when: (create_cachegroup_out.status == 400 and create_cachegroup_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_cachegroup_out.status > 400 and create_cachegroup_out.status < 600 and create_cachegroup_out.status != 500)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Cachegroups - Mid Tier
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cachegroups"
method: GET
register: get_all_cachegroups
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_cachegroups['status']|default(0) == 200
- name: Create Cachegroups - Edge Tier
uri:
@@ -235,123 +287,48 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_cachegroup_out
failed_when: (create_cachegroup_out.status == 400 and create_cachegroup_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_cachegroup_out.status > 400 and create_cachegroup_out.status < 600 and create_cachegroup_out.status != 500)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Cachegroups
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cachegroups"
method: GET
register: get_all_cachegroups
-
-- name: Associate cachegroups to phys_locations
- command: "{{ role_path }}/files/selection.set.py {{ item | quote }} {{ dl_ds_merged_divisions | json_query(physlocation_query) | join(',') | quote }}"
- register: cachegroup_physlocations_out
- changed_when: false
- with_items: "{{ dl_ds_merged_divisions | json_query(cachegroup_query) | unique }}"
- vars:
- cachegroup_query: "[*].regions[*].phys_locations[*].cachegroups[][][]"
- physlocation_query: "[*].regions[*].phys_locations[?contains(cachegroups,'{{ item }}')].name[][]"
-
-- name: Massage cachegroup to phys_location mappings
- set_fact:
- physlocation_tmp_str: "{% for i in cachegroup_physlocations_out.results %}{{ i.stdout | from_json | to_json }}{% if not loop.last %}|{% endif %}{%endfor%}"
-
-- name: Build temporary association of cachegroup to region
- set_fact:
- phys_location_tmp_dict: "{{ (phys_location_tmp_dict| default({})) | combine(item | from_json) }}"
- with_items: "{{ physlocation_tmp_str.split('|') }}"
-
-- name: Associate origins to cachegroups
- command: "{{ role_path }}/files/selection.set.py {{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'ORG_LOC') | map(attribute='name') | join(',') | quote }} {{ groups['fakeorigin'] | union(groups['mso_parent_alias']) | join(',') | quote }}"
- register: cachegroup_origin_out
- changed_when: false
-
-- name: Associate edge caches to cachegroups
- command: "{{ role_path }}/files/selection.set.py {{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'EDGE_LOC') | map(attribute='name') | join(',') | quote }} {{ groups['atsec'] | union(groups['grove']) | join(',') | quote }}"
- register: cachegroup_edge_out
- changed_when: false
-
-- name: Associate mid caches to cachegroups
- command: "{{ role_path }}/files/selection.set.py {{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'MID_LOC') | map(attribute='name') | join(',') | quote }} {{ groups['atsmid'] | join(',') | quote }}"
- register: cachegroup_mid_out
- changed_when: false
-
-- name: Associate traffic routers to cachegroups
- command: "{{ role_path }}/files/selection.set.py {{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'TR_LOC') | map(attribute='name') | join(',') | quote }} {{ groups['traffic_router'] | join(',') | quote }}"
- register: cachegroup_tr_out
- changed_when: false
-
-# List of Map of Cachegroup to Host List
-- name: Combine cachegroup associations
- set_fact:
- cachegroups_merged_tmp: "{{ cachegroups_merged_tmp | default([]) + [ { 'cachegroup': item.key, 'hosts': item.value.split(',') } ] }}"
- with_dict: "{{ (cachegroup_edge_out.stdout | from_json) | combine(cachegroup_mid_out.stdout | from_json) | combine(cachegroup_tr_out.stdout | from_json) | combine(cachegroup_origin_out.stdout | from_json) }}"
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_cachegroups['status']|default(0) == 200
# Map of hosts to cachegroups
-- name: Convert cachegroup associations to a more useful format
- set_fact:
- cachegroups_assignments: "{{ cachegroups_assignments | default({}) | combine({ item.1: item.0.cachegroup }) }}"
- with_subelements:
- - "{{ cachegroups_merged_tmp }}"
- - hosts
-
-- name: Hold onto a copy of infrastructure hosts
- set_fact:
- infra_hosts: "{{ groups['all'] | difference(cachegroups_assignments.keys()) }}"
-
-- name: Add remaining hosts to the infrastructure cachegroup
- set_fact:
- cachegroups_assignments: "{{ cachegroups_assignments | default({}) | combine({ item: 'infrastructure' }) }}"
- with_items: "{{ infra_hosts }}"
-
-- name: Add remaining hosts to the infrastructure physical locations
- set_fact:
- cachegroups_merged_tmp: "{{ cachegroups_merged_tmp | default([]) + [{ 'cachegroup': 'infrastructure', 'hosts': infra_hosts }] }}"
-
-- name: Massage cachegroup associations to a forward lookup dictionary
+- name: Associate origins, caches, and routers to cachegroups
set_fact:
- cachegroup_lookup: "{{ ( cachegroup_lookup | default({}) ) | combine({ item['cachegroup']: (item['hosts'] | join(',')) }) }}"
- with_items: "{{ cachegroups_merged_tmp }}"
-
-- name: Associate Physical Locations to Servers
- command: "{{ role_path }}/files/selection.set.py {{ phys_location_tmp_dict[item.key] | quote }} {{ item.value | quote }}"
- register: physlocation_caches_out
- changed_when: false
- with_dict: "{{ cachegroup_lookup }}"
-
-- name: Massage phys_location to cache mappings
- set_fact:
- physlocation_cache_tmp_str: "{% for i in physlocation_caches_out.results %}{{ i.stdout | from_json | to_json }}{% if not loop.last %}|{% endif %}{%endfor%}"
-
-- name: Process location map (phase 1)
- set_fact:
- physlocation_cache_tmp_list: "{{ physlocation_cache_tmp_list | default([]) | union( [item | from_json] ) }}"
- with_items: "{{ physlocation_cache_tmp_str.split('|') }}"
-
-- name: Process location map (phase 2)
- set_fact:
- used_locations: "{{ physlocation_cache_tmp_list | json_query(location_query) | unique }}"
+ cachegroups_assignments: "{{ {} |combine(origins) | combine(edges) | combine(mids) | combine(trs) | combine(infra) }}"
vars:
- location_query: "[].keys(@)[]"
+ origins: "{{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'ORG_LOC') | map(attribute='name') | list | associate_round_robin(dl_hosts_fakeorigin | union(dl_hosts_mso_alias)) | denormalize_association }}"
+ edges: "{{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'EDGE_LOC') | map(attribute='name') | list | associate_round_robin(dl_hosts_atsec | union(dl_hosts_grove)) | denormalize_association }}"
+ mids: "{{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'MID_LOC') | map(attribute='name') | list | associate_round_robin(dl_hosts_atsmid) | denormalize_association }}"
+ trs: "{{ dl_ds_merged_cachegroups | selectattr('type', 'equalto', 'TR_LOC') | map(attribute='name') | list | associate_round_robin(dl_hosts_tr) | denormalize_association }}"
+ infra: "{{ ['infrastructure'] | associate_round_robin(dl_hosts_all | difference(dl_hosts_fakeorigin + dl_hosts_mso_alias + dl_hosts_atsec + dl_hosts_grove + dl_hosts_atsmid + dl_hosts_tr) ) | denormalize_association }}"
-- name: Process location map (phase 3)
+- name: Build reverse lookup for cachegroups to eligible phys_locations
set_fact:
- tmp_location_map: "{{ (tmp_location_map | default({})) | combine({ item: (physlocation_cache_tmp_list | json_query(location_query) | join(','))}) }}"
- with_items: "{{ used_locations }}"
+ cachegroup_lookup: "{{ cachegroup_lookup | default({}) | combine(vals) }}"
+ with_items: "{{ dl_ds_merged_divisions | json_query(cachegroup_query) | unique }}"
vars:
- location_query: "[].\"{{ item }}\""
+ cachegroup_query: "[*].regions[*].phys_locations[*].cachegroups[][][]"
+ physlocation_query: "[*].regions[*].phys_locations[?contains(cachegroups,'{{ item }}')].name[][]"
+ vals: "{{ [item] | associate_round_robin(dl_ds_merged_divisions | json_query(physlocation_query)) }}"
-- name: Assemble assignments of cache to location
+- name: Associate servers to physLocation
set_fact:
- physlocation_assignments: "{
- {%- for location, host_csv in tmp_location_map.items() -%}
- {%- set outer_loop = loop -%}
- {%- for i in host_csv.split(',') -%}
- '{{ i }}': '{{ location }}'
- {%- if not loop.last %},{% endif -%}
- {%- endfor %}
- {%- if not outer_loop.last %},{% endif -%}
- {%- endfor %}
- }"
+ physlocation_assignments: "{{ physlocation_assignments | default({}) | combine( eligible_physlocations | associate_round_robin(servers_in_cachegroup) | denormalize_association ) }}"
+ with_items: "{{ cachegroups_assignments.values() | list | unique }}"
+ vars:
+ eligible_physlocations: "{{ cachegroup_lookup[item] }}"
+ servers_in_cachegroup: "{{ cachegroups_assignments | dict2items | json_query(fqdn_query) }}"
+ fqdn_query: "[?value==`{{ item }}`].key"
- name: Create Division
uri:
@@ -365,12 +342,19 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_divisions_out
failed_when: (create_divisions_out.status == 400 and create_divisions_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_divisions_out.status > 400 and create_divisions_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Divisions
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/divisions"
method: GET
register: get_all_divisions
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_divisions['status']|default(0) == 200
- name: Assemble assignments of region to division
set_fact:
@@ -394,12 +378,19 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_regions_out
failed_when: (create_regions_out.status == 400 and create_regions_out.json | to_json | from_json | json_query(error_query) | length != 0) or ( create_regions_out.status > 400 and create_regions_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Regions
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/regions"
method: GET
register: get_all_regions
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_regions['status']|default(0) == 200
- name: Constuct physLocation payload
set_fact:
@@ -432,17 +423,24 @@
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
register: create_physlocation_out
failed_when: (create_physlocation_out.status == 400 and create_physlocation_out.json | to_json | from_json | json_query(error_query) | length != 0) or ( create_physlocation_out.status > 400 and create_physlocation_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Physical Locations
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/phys_locations"
method: GET
register: get_all_physlocations
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_physlocations['status']|default(0) == 200
- name: Assign types to servers
set_fact:
type_assignments: "{{ (type_assignments | default({})) | combine({ item: dl_ds_merged_type_ansible_component_map[hostvars[item].component] | default('UNKNOWN') }) }}"
- with_items: "{{ groups['all'] }}"
+ with_items: "{{ dl_hosts_all }}"
- name: Assert a default location
set_fact:
@@ -454,185 +452,217 @@
set_fact:
default_cachegroup: infrastructure
-- name: Get All Profiles
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
- method: GET
- register: get_all_profiles
-
-- name: Get All Parameters from GLOBAL profile
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/GLOBAL/parameters"
- method: GET
- register: get_global_parameters
-
-- name: Unlink all Global Profile parameters to be recreated
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profileparameters/{{ get_all_profiles.json | to_json | from_json | json_query(profile_query) }}/{{ item }}"
- method: DELETE
- with_items: "{{ get_global_parameters.json.response | map(attribute='id') | list }}"
- vars:
- profile_query: "response[?name == 'GLOBAL'].id | [0]"
- error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
- register: unassociate_global_params
- failed_when: (unassociate_global_params.status == 400 and unassociate_global_params.json | to_json | from_json | json_query(error_query) | length != 0) or ( unassociate_global_params.status > 400 and unassociate_global_params.status < 600)
-
-- name: Create Profiles - Global
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
- method: POST
- body: "{{ lookup('template', 'profile.j2') }}"
- with_items: "{{ dl_ds_merged_profiles }}"
- vars:
- name: "{{ item.name }}"
- description: "{{ item.description }}"
- cdn: "{{ get_all_cdns.json | to_json | from_json | json_query(cdn_query) }}"
- type: "{{ item.type }}"
- routingDisabled: "{{ (item.routingDisabled | default(false)) | lower }}"
- cdn_query: "response[?starts_with(domainName,`{{ item.cdn | default(ALL) | lower }}`) == `true` || name == `{{ item.cdn | default(ALL) }}`].id | [0]"
- error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
- register: create_profiles_out
- failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
-
-- name: Create and Associate Parameters - Global
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ item.name }}/parameters"
- method: POST
- body: "{{ lookup('template', 'parameter.j2') }}"
- with_items:
- - "{{ dl_ds_merged_profiles }}"
- vars:
- cdn_query: "response[?starts_with(domainName,`{{ item.cdn | default(ALL) | lower }}`) == `true` || name == `{{ item.cdn | default(ALL) }}`].id | [0]"
- error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
- register: create_profiles_out
- failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
-
-- name: Handle Profile & Parameter CDN Templates
- include_tasks: parameter_loader.yml
- vars:
- Target_cdn_delegation_fqdn: "{{ Target_cdn_delegation | default(MKGA) }}.{{ (groups['traffic_ops'] | first).split('.')[1:] | join('.') | lower }}"
- Target_cdn_name: "{{ get_all_cdns.json | to_json | from_json | json_query(cdnName_query) }}"
- Target_cdn_id: "{{ get_all_cdns.json | to_json | from_json | json_query(cdn_query) }}"
- cdnName_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation | lower }}`) == `true`].name | [0]"
- cdn_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation | lower }}`) == `true`].id | [0]"
- with_items: "{{ cdnDelegationList }}"
- loop_control:
- loop_var: Target_cdn_delegation
-
-- name: Get All Profiles
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
- method: GET
- register: get_all_profiles
-
-- name: Get All Parameters per Profile
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ item }}/parameters"
- method: GET
- vars:
- profile_query: "response.id"
- with_items: "{{ get_all_profiles.json.response | map(attribute='name') | list }}"
- register: get_all_parameters_by_profile
-
-- name: Map CDN Delegation to CDN Name
- set_fact:
- delegation_cdnName_map: "{{ (delegation_cdnName_map | default({})) | combine({ (tmp | lower): (item.name | lower) }) }}"
- with_items: "{{ get_all_cdns.json.response }}"
- vars:
- tmp: "{{ (item.domainName == '-') | ternary('ALL', (item.domainName.split('.')[0])) }}"
-
-- name: Map CDN Name to CDN Delegation
- set_fact:
- cdnName_delegation_map: "{{ (delegation_cdnName_map | default({})) | combine({ (item.name | lower): (tmp | lower) }) }}"
- with_items: "{{ get_all_cdns.json.response }}"
- vars:
- tmp: "{{ (item.domainName == '-') | ternary('ALL', (item.domainName.split('.')[0])) }}"
-
-- name: Generate potential mappings between cdn/components and profiles
- set_fact:
- ccp_list: "{{ (ccp_list| default([])) +[{ 'cdnname': item.1, 'component': item.0 , 'profile_keys': profile_keys, 'compound_key': compound_key }] }}"
- with_nested:
- - "{{ dl_ds_merged_profile_prefix_ansible_component_map.keys() | map('lower') | list }}"
- - "{{ lc_cdns | to_json | from_json | json_query(cdn_query) | lower }}"
- vars:
- lc_profiles: "{{ get_all_profiles.json.response | lower }}"
- lc_cdns: "{{ get_all_cdns.json.response | lower }}"
- profile_keys: "{{ lc_profiles | to_json | from_json | json_query(profile_query) }}"
- profile_query: "[?starts_with(name,`{{ dl_ds_merged_profile_prefix_ansible_component_map[item.0] | lower }}`) {% if dl_ds_merged_profile_blacklist_ansible_component_map[item.0] != None %}{% for b in dl_ds_merged_profile_blacklist_ansible_component_map[item.0] %}&& !contains(name,`{{ b | lower }}`) {% endfor %}{% endif %}&& cdnname == `{{ item.1 }}`].name"
- cdn_query: "[].name"
- compound_key: "{{ item.1 }}_{{ item.0 }}"
-
-- name: Fabricate a compound_key for each host based on the cdn/component
- set_fact:
- host_keys_tmp: "{{ host_keys_tmp | default([]) + [{ 'host': item, 'compound_key': compound_key }] }}"
- with_items: "{{ groups['all'] }}"
- vars:
- compound_key: "{{ delegation_cdnName_map[hostvars[item].cdn | lower ] }}_{{ hostvars[item].component | lower }}"
-
-- name: Produce elegible pairings of keys and hosts
- set_fact:
- paired_elegible_keys_hosts: "{{ paired_elegible_keys_hosts | default({}) | combine( { item: { 'hosts': hosts, 'profiles': profile_keys } } ) }}"
- with_items: "{{ compound_keys }}"
- vars:
- compound_key_query: "[].compound_key"
- host_query: "[?compound_key == '{{ item }}'].host"
- key_query: "[?compound_key == '{{ item }}'].profile_keys[]"
- compound_keys: "{{ host_keys_tmp | to_json | from_json | json_query(compound_key_query) | unique }}"
- hosts: "{{ host_keys_tmp | to_json | from_json | json_query(host_query) }}"
- profile_keys: "{{ ccp_list | to_json | from_json | json_query(key_query) }}"
-
-- name: Associate profiles to hosts
- command: "{{ role_path }}/files/selection.set.py {{ paired_elegible_keys_hosts[item].profiles | join(',') | quote }} {{ paired_elegible_keys_hosts[item].hosts | join(',') | quote }}"
- register: profiles_hosts_out
- changed_when: false
- with_items: "{{ paired_elegible_keys_hosts.keys() | list}}"
-
-- name: Massage profiles to hosts
- set_fact:
- profile_host_tmp_str: "{% for i in profiles_hosts_out.results %}{{ i.stdout | from_json | to_json }}{% if not loop.last %}|{% endif %}{%endfor%}"
-
-- name: Process profile map (phase 1)
- set_fact:
- profile_host_tmp_list: "{{ profile_host_tmp_list | default([]) | union( [item | from_json] ) }}"
- with_items: "{{ profile_host_tmp_str.split('|') }}"
-
-- name: Process profile map (phase 2)
- set_fact:
- used_profiles: "{{ profile_host_tmp_list | json_query(profile_query) | unique }}"
- vars:
- profile_query: "[].keys(@)[]"
-
-- name: Process profile map (phase 3)
- set_fact:
- tmp_profile_map: "{{ (tmp_profile_map | default({})) | combine({ item: (profile_host_tmp_list | json_query(profile_query) | join(','))}) }}"
- with_items: "{{ used_profiles }}"
- vars:
- profile_query: "[].\"{{ item }}\""
-
-- name: Assemble assignments of profiles to hosts
- set_fact:
- profile_assignments: "{
- {%- for profile, host_csv in tmp_profile_map.items() -%}
- {%- set outer_loop = loop -%}
- {%- for i in host_csv.split(',') -%}
- '{{ i }}': '{{ profile }}'
- {%- if not loop.last %},{% endif -%}
- {%- endfor %}
- {%- if not outer_loop.last %},{% endif -%}
- {%- endfor %}
- }"
+- name: Create and Assign Profiles and Parameters
+ block:
+ - name: Collect information about eligible cache block drives
+ block:
+ - name: Force fact collection on ats edges and mids as well as grove, if not already performed
+ setup:
+ with_items: "{{ dl_hosts_atsec+dl_hosts_atsmid+dl_hosts_grove }}"
+ delegate_to: "{{ item }}"
+ delegate_facts: True
+ when: hostvars[item]['ansible_default_ipv4'] is not defined
+ no_log: true
+
+ - name: Fetch information about block without partitions and whitelisted prefixes
+ set_fact:
+ eligible_cache_disks_tmp: "{{ hostvars[item].ansible_facts.devices | dict2items | to_json | from_json | json_query(eligible_device_query) | sort }}"
+ vars:
+ eligible_device_query: "[?({{ dl_ds_merged_cache_block_device_prefix_whitelist | map('regex_replace', '^(.*)$', 'starts_with(key,`\\1`)==`true`') | list | join(' || ') }}) && length(value.partitions)==`0`].key"
+ with_items: "{{ dl_hosts_atsec+dl_hosts_atsmid+dl_hosts_grove }}"
+ register: eligible_cache_disks_tmp2
+
+ - name: Assemble information about eligible cache block drives in a more useful way
+ set_fact:
+ eligible_cache_rotational_disks: "{{ eligible_cache_disks_tmp2.results | json_query(combine_eligible_cache_disks_from_results_query) | items2dict }}"
+ vars:
+ combine_eligible_cache_disks_from_results_query: "[].{key: item, value: ansible_facts.eligible_cache_disks_tmp}"
+
+ - name: Fetch information about ram disks
+ set_fact:
+ eligible_cache_ram_disks_tmp: "{{ hostvars[item].ansible_facts.devices | dict2items | to_json | from_json | json_query(eligible_device_query) | sort }}"
+ vars:
+ eligible_device_query: "[?({{ dl_ds_merged_cache_ram_device_prefix_whitelist | map('regex_replace', '^(.*)$', 'starts_with(key,`\\1`)==`true`') | list | join(' || ') }}) && length(value.partitions)==`0`].key"
+ with_items: "{{ dl_hosts_atsec+dl_hosts_atsmid+dl_hosts_grove }}"
+ register: eligible_cache_ram_disks_tmp2
+
+ - name: Assemble information about eligible cache ram drives in a more useful way
+ set_fact:
+ eligible_cache_ram_disks: "{{ eligible_cache_ram_disks_tmp2.results | json_query(combine_eligible_ram_disks_from_results_query) | items2dict }}"
+ vars:
+ combine_eligible_ram_disks_from_results_query: "[].{key: item, value: ansible_facts.eligible_cache_ram_disks_tmp}"
+
+ - name: Combine hardware data of caches into a single data object
+ set_fact:
+ dl_ds_cache_hardware_info: "{{ (dl_ds_cache_hardware_info | default({})) | combine({ item: {'ram_disks': ram_disks, 'cache_disks': cache_disks, 'ram_cache_size': ram_cache_size, 'primary_network_interface': primary_network_interface, 'network_bandwidth_limit': network_bandwidth_limit, 'load_avg_limit': load_avg_limit } }) }}"
+ with_items: "{{ dl_hosts_atsec+dl_hosts_atsmid+dl_hosts_grove }}"
+ vars:
+ ram_disks: "{{ eligible_cache_ram_disks[item] | default([]) }}"
+ cache_disks: "{{ eligible_cache_rotational_disks[item] | default([]) }}"
+ ram_cache_size: "{{ ((ram_cache_size_percentage | int) / 100 * ( hostvars[item].ansible_memtotal_mb | float ) * 1000000) | int }}"
+ ram_cache_size_percentage: "{{ (hostvars[item].component == 'atsec') | ternary(dl_atsec_ram_cache_size_percentage,(hostvars[item].component == 'atsmid') | ternary(dl_atsmid_ram_cache_size_percentage,dl_grove_ram_cache_size_percentage)) }}"
+ primary_network_interface: "{{ hostvars[item].ansible_default_ipv4.interface }}"
+ network_bandwidth_limit: "{{ hostvars[item]['ansible_'+hostvars[item].ansible_default_ipv4.interface].speed }}"
+ load_avg_limit: "{{ [10, hostvars[item].ansible_processor_vcpus * hostvars[item].ansible_processor_threads_per_core] | max }}"
+ when: dl_ds_ats_hardware_info is not defined
+
+ - name: Assemble mapping of hardware info to profile hardware index
+ set_fact:
+ cache_hardware_profile_index: "{{ cache_hardware_profile_index | default({}) | combine({profilename: item}) }}"
+ loop: "{{ dl_ds_cache_hardware_info.values() | list | unique }}"
+ loop_control:
+ index_var: index
+ vars:
+ profilename: "hdwr{{ index }}"
+
+ - name: Assemble information about hardware profiles in a more useful way
+ set_fact:
+ cache_hardware_profile_map: "{{ cache_hardware_profile_map | default({}) | combine({ item: { 'hardware_profile': cache_hardware_profile_index | dict2items | json_query(hw_lookup_query), 'component': hostvars[item].component } }) }}"
+ with_items: "{{ dl_hosts_atsec+dl_hosts_atsmid+dl_hosts_grove }}"
+ vars:
+ hw_lookup_query: "[?value.ram_disks==`[{{ dl_ds_cache_hardware_info[item].ram_disks | map('to_json') | join(',') }}]` && value.cache_disks==`[{{ dl_ds_cache_hardware_info[item].cache_disks | map('to_json') | join(',') }}]` && value.ram_cache_size=='{{ dl_ds_cache_hardware_info[item].ram_cache_size }}'].key |[0]"
+
+ - name: Get All Profiles
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
+ method: GET
+ register: get_all_profiles
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_profiles['status']|default(0) == 200
+
+ - name: Get All Parameters from GLOBAL profile
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/GLOBAL/parameters"
+ method: GET
+ register: get_global_parameters
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_global_parameters['status']|default(0) == 200
+
+ - name: Unlink all Global Profile parameters to be recreated
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profileparameters/{{ get_all_profiles.json | to_json | from_json | json_query(profile_query) }}/{{ item }}"
+ method: DELETE
+ with_items: "{{ get_global_parameters.json.response | map(attribute='id') | list }}"
+ vars:
+ profile_query: "response[?name == 'GLOBAL'].id | [0]"
+ error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ register: unassociate_global_params
+ failed_when: (unassociate_global_params.status == 400 and unassociate_global_params.json | to_json | from_json | json_query(error_query) | length != 0) or ( unassociate_global_params.status > 400 and unassociate_global_params.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
+
+ - name: Create Profiles - Global
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
+ method: POST
+ body: "{{ lookup('template', 'profile.j2') }}"
+ with_items: "{{ dl_ds_merged_profiles }}"
+ vars:
+ name: "{{ item.name }}"
+ description: "{{ item.description }}"
+ cdn: "{{ get_all_cdns.json | to_json | from_json | json_query(cdn_query) }}"
+ type: "{{ item.type }}"
+ routingDisabled: "{{ (item.routingDisabled | default(false)) | lower }}"
+ cdn_query: "response[?starts_with(domainName,`{{ item.cdn | default(all) }}`) == `true` || name == `{{ item.cdn | default(all) }}`].id | [0]"
+ error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ register: create_profiles_out
+ failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
+
+ - name: Create and Associate Parameters - Global
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ item.name }}/parameters"
+ method: POST
+ body: "{{ lookup('template', 'parameter.j2') }}"
+ with_items:
+ - "{{ dl_ds_merged_profiles }}"
+ vars:
+ paramset: "{{ item.parameters | default([]) }}"
+ cdn_query: "response[?starts_with(domainName,`{{ item.cdn | default(ALL) | lower }}`) == `true` || name == `{{ item.cdn | default(ALL) }}`].id | [0]"
+ error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ register: create_profiles_out
+ failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
+
+ - name: Handle Profile & Parameter CDN Templates
+ include_tasks: parameter_loader.yml
+ vars:
+ Target_cdn_delegation_fqdn: "{{ Target_cdn_delegation | default(mkga) }}.{{ (dl_hosts_to | first).split('.')[1:] | join('.') | lower }}"
+ Target_cdn_name: "{{ get_all_cdns.json | to_json | from_json | json_query(cdnName_query) }}"
+ Target_cdn_id: "{{ get_all_cdns.json | to_json | from_json | json_query(cdn_query) }}"
+ cdnName_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation }}`) == `true`].name | [0]"
+ cdn_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation }}`) == `true`].id | [0]"
+ with_items: "{{ cdnDelegationList }}"
+ loop_control:
+ loop_var: Target_cdn_delegation
+
+ - name: Get All Profiles
+ uri:
+ url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
+ method: GET
+ register: get_all_profiles
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_profiles['status']|default(0) == 200
+
+ - name: Get all Parameters per Profile - with curl workaround
+ command: "curl -X GET -Lsk --fail -b '{{ dl_mojo_token.set_cookie }}' '{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ item }}/parameters'"
+ args:
+ warn: no
+ with_items: "{{ get_all_profiles.json.response | map(attribute='name') | list }}"
+ register: get_all_parameters_by_profile_raw
+ no_log: true
+ retries: 10
+ delay: 10
+
+ - name: Convert the curl workaround output to match normal URI output
+ set_fact:
+ get_all_parameters_by_profile: "{{ (get_all_parameters_by_profile | default({})) | combine(payload, recursive=True) }}"
+ with_items: "{{ get_all_parameters_by_profile_raw.results }}"
+ no_log: true
+ vars:
+ payload: "{'changed': false,'msg': 'All items completed, includes curl workaround', 'results': {{ results }} }"
+ results: "{{ ((get_all_parameters_by_profile | default({})).results | default([])) + [ new_result ] }}"
+ new_result: "{{ item | combine({'json': ( item.stdout | from_json ) }) }}"
+
+ - name: Associate eligible profiles to hosts
+ set_fact:
+ profile_assignments: "{{ dl_hosts_all | associate_profile_to_servers(profile_names,cache_hardware_profile_map,hostvars,dl_ds_merged_profile_prefix_ansible_component_map) }}"
+ vars:
+ profile_names: "{{ get_all_profiles.json.response | map(attribute='name') | list | map('lower') | list | unique | sort }}"
- name: Get All Server Statuses
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/statuses"
method: GET
register: get_all_statuses
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_statuses['status']|default(0) == 200
- name: Get the CDN Assignments into a more queryable form
set_fact:
cdn_assignment_reverse_tmp: "{{ cdn_assignment_reverse_tmp | default([]) + [{'host': item.key, 'cdn': item.value}] }}"
with_dict: "{{ cdn_assignments }}"
+- name: Map CDN Delegation to CDN Name
+ set_fact:
+ delegation_cdnName_map: "{{ (delegation_cdnName_map | default({})) | combine({ (tmp | lower): (item.name | lower) }) }}"
+ with_items: "{{ get_all_cdns.json.response }}"
+ vars:
+ tmp: "{{ (item.domainName == '-') | ternary('ALL', (item.domainName.split('.')[0])) }}"
+
- name: Divide TM hosts in half per CDN (Phase 1)
set_fact:
tm_status_tmp: "{{ tm_status_tmp | default([]) + [ {'onlineTM': evenTM, 'offlineTM': oddTM} ] }}"
@@ -641,9 +671,9 @@
lc_cdn_assignment_reverse_tmp: "{{ cdn_assignment_reverse_tmp | lower }}"
cdn_query: "[?cdn == `{{ item }}`].host"
cdns: "{{ lc_cdn_assignment_reverse_tmp | json_query(cdn_query) }}"
- tm_cdns: "{{ groups['traffic_monitor'] | intersect(cdns) }}"
- evenTM: "{{ (groups['traffic_monitor'] | intersect(cdns))[::2] }}"
- oddTM: "{{ (groups['traffic_monitor'] | intersect(cdns))[1::2] }}"
+ tm_cdns: "{{ dl_hosts_tm | intersect(cdns) }}"
+ evenTM: "{{ (dl_hosts_tm | intersect(cdns))[::2] }}"
+ oddTM: "{{ (dl_hosts_tm | intersect(cdns))[1::2] }}"
- name: Assign server status for offline traffic monitors
set_fact:
@@ -662,16 +692,16 @@
- name: Assign server status for caches
set_fact:
status_assignment: "{{ status_assignment | default({}) | combine({ item: 'REPORTED' }) }}"
- with_items: "{{ groups['atsec'] + groups['atsmid'] + groups['grove'] }}"
+ with_items: "{{ dl_hosts_atsec + dl_hosts_atsmid + dl_hosts_grove }}"
- name: Create Servers (Non-mso)
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/servers"
method: POST
body: "{{ lookup('template', 'server.j2') }}"
- with_items: "{{ groups['all'] | difference(groups['mso_parent_alias']) }}"
+ with_items: "{{ dl_hosts_all | difference(dl_hosts_mso_alias) }}"
vars:
- error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ error_query: "alerts[?level=='error'].text[?!(contains(@,'already exists') || contains(@,'ipAddress is not unique across the server'))]"
status_name: "{{ status_assignment[item] | default('ONLINE') }}"
status_query: "[?name == `{{ status_name }}`].id | [0]"
status_id: "{{ get_all_statuses.json.response | to_json | from_json | json_query(status_query) }}"
@@ -706,27 +736,32 @@
ipIsService: true
ipNetmask: "{{ hostvars[item].ansible_default_ipv4.netmask | default('255.255.255.0') }}"
ipGateway: "{{ hostvars[item].ansible_default_ipv4.gateway | default('127.0.0.0') }}"
- ip6Address: "{{ hostvars[item].ansible_default_ipv6.address | default(omit) }}"
+ ip6Address: "{{ hostvars[item].not_autoconf_default_ipv6_address | default(hostvars[item].ansible_default_ipv6.address) | default(omit) }}"
ip6IsService: true
ip6Gateway: "{{ hostvars[item].ansible_default_ipv6.gateway | default(omit) }}"
interfaceMtu: "{{ hostvars[item].ansible_default_ipv4.mtu | default('9000') }}"
- tcpPort: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).tcpPort | default(omit) }}"
- httpsPort: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).httpsPort | default(omit) }}"
- xmppId: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).xmppId | default(omit) }}"
- xmppPasswd: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).xmppPasswd | default(omit) }}"
- rack: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).rack | default(omit) }}"
- mgmtIpAddress: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).mgmtIpAddress | default(omit) }}"
- mgmtIpNetmask: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).mgmtIpNetmask | default(omit) }}"
- mgmtIpGateway: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).mgmtIpGateway | default(omit) }}"
- iloIpAddress: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloIpAddress | default(omit) }}"
- iloIpNetmask: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloIpNetmask | default(omit) }}"
- iloIpGateway: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloIpGateway | default(omit) }}"
- iloUsername: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloUsername | default(omit) }}"
- iloPassword: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloPassword | default(omit) }}"
- routerHostName: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).routerHostName | default(omit) }}"
- routerPortName: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).routerPortName | default(omit) }}"
+ default_inventory_hostname: "{{ hostvars[item].component | default('server') }}.kabletown.invalid"
+ merged_server_attrs: "{{ dl_ds_merged_servers['server.kabletown.invalid'] | combine(dl_ds_merged_servers[default_inventory_hostname] | default({}) ) | combine(dl_ds_merged_servers[item] | default({}) ) }}"
+ tcpPort: "{{ merged_server_attrs.tcpPort | default(omit) }}"
+ httpsPort: "{{ merged_server_attrs.httpsPort | default(omit) }}"
+ xmppId: "{{ merged_server_attrs.xmppId | default(omit) }}"
+ xmppPasswd: "{{ merged_server_attrs.xmppPasswd | default(omit) }}"
+ rack: "{{ merged_server_attrs.rack | default(omit) }}"
+ mgmtIpAddress: "{{ merged_server_attrs.mgmtIpAddress | default(omit) }}"
+ mgmtIpNetmask: "{{ merged_server_attrs.mgmtIpNetmask | default(omit) }}"
+ mgmtIpGateway: "{{ merged_server_attrs.mgmtIpGateway | default(omit) }}"
+ iloIpAddress: "{{ merged_server_attrs.iloIpAddress | default(omit) }}"
+ iloIpNetmask: "{{ merged_server_attrs.iloIpNetmask | default(omit) }}"
+ iloIpGateway: "{{ merged_server_attrs.iloIpGateway | default(omit) }}"
+ iloUsername: "{{ merged_server_attrs.iloUsername | default(omit) }}"
+ iloPassword: "{{ merged_server_attrs.iloPassword | default(omit) }}"
+ routerHostName: "{{ merged_server_attrs.routerHostName | default(omit) }}"
+ routerPortName: "{{ merged_server_attrs.routerPortName | default(omit) }}"
register: create_server_out
failed_when: (create_server_out.status == 400 and create_server_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_server_out.status > 400 and create_server_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
###
# MSO servers are not guarenteed to be idempotent
@@ -741,9 +776,9 @@
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/servers"
method: POST
body: "{{ lookup('template', 'server.j2') }}"
- with_items: "{{ groups['mso_parent_alias'] }}"
+ with_items: "{{ dl_hosts_mso_alias }}"
vars:
- error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+ error_query: "alerts[?level=='error'].text[?!(contains(@,'already exists') || contains(@,'ipAddress is not unique across the server'))]"
status_name: "{{ status_assignment[item] | default('ONLINE') }}"
status_query: "[?name == `{{ status_name }}`].id | [0]"
status_id: "{{ get_all_statuses.json.response | to_json | from_json | json_query(status_query) }}"
@@ -782,57 +817,66 @@
ip6IsService: true
ip6Gateway: "{{ omit }}"
interfaceMtu: "9000"
- tcpPort: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).tcpPort | default(omit) }}"
- httpsPort: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).httpsPort | default(omit) }}"
- xmppId: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).xmppId | default(omit) }}"
- xmppPasswd: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).xmppPasswd | default(omit) }}"
- rack: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).rack | default(omit) }}"
- mgmtIpAddress: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).mgmtIpAddress | default(omit) }}"
- mgmtIpNetmask: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).mgmtIpNetmask | default(omit) }}"
- mgmtIpGateway: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).mgmtIpGateway | default(omit) }}"
- iloIpAddress: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloIpAddress | default(omit) }}"
- iloIpNetmask: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloIpNetmask | default(omit) }}"
- iloIpGateway: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloIpGateway | default(omit) }}"
- iloUsername: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloUsername | default(omit) }}"
- iloPassword: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).iloPassword | default(omit) }}"
- routerHostName: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).routerHostName | default(omit) }}"
- routerPortName: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).routerPortName | default(omit) }}"
+ default_inventory_hostname: "{{ hostvars[item].component | default('server') }}.kabletown.invalid"
+ merged_server_attrs: "{{ dl_ds_merged_servers['server.kabletown.invalid'] | combine(dl_ds_merged_servers[default_inventory_hostname] | default({}) ) | combine(dl_ds_merged_servers[item] | default({}) ) }}"
+ tcpPort: "{{ merged_server_attrs.tcpPort | default(omit) }}"
+ httpsPort: "{{ merged_server_attrs.httpsPort | default(omit) }}"
+ xmppId: "{{ merged_server_attrs.xmppId | default(omit) }}"
+ xmppPasswd: "{{ merged_server_attrs.xmppPasswd | default(omit) }}"
+ rack: "{{ merged_server_attrs.rack | default(omit) }}"
+ mgmtIpAddress: "{{ merged_server_attrs.mgmtIpAddress | default(omit) }}"
+ mgmtIpNetmask: "{{ merged_server_attrs.mgmtIpNetmask | default(omit) }}"
+ mgmtIpGateway: "{{ merged_server_attrs.mgmtIpGateway | default(omit) }}"
+ iloIpAddress: "{{ merged_server_attrs.iloIpAddress | default(omit) }}"
+ iloIpNetmask: "{{ merged_server_attrs.iloIpNetmask | default(omit) }}"
+ iloIpGateway: "{{ merged_server_attrs.iloIpGateway | default(omit) }}"
+ iloUsername: "{{ merged_server_attrs.iloUsername | default(omit) }}"
+ iloPassword: "{{ merged_server_attrs.iloPassword | default(omit) }}"
+ routerHostName: "{{ merged_server_attrs.routerHostName | default(omit) }}"
+ routerPortName: "{{ merged_server_attrs.routerPortName | default(omit) }}"
register: create_server_out
failed_when: (create_server_out.status == 400 and create_server_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_server_out.status > 400 and create_server_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Get All Servers
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/servers"
method: GET
register: get_all_servers
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_servers['status']|default(0) == 200
- name: Convert the CDN Delegation list into an index
set_fact:
cdnDelegationIndex: "{{ (cdnDelegationIndex | default({}) ) | combine( { item.1: item.0 } ) }}"
- with_indexed_items: "{{ cdnDelegationList | sort | unique }}"
+ with_indexed_items: "{{ cdnDelegationList }}"
- name: Create Index of Fake Origins
set_fact:
foIndex: "{{ (foIndex | default({}) ) | combine( { item.1: item.0 } ) }}"
- with_indexed_items: "{{ groups['fakeorigin'] }}"
+ with_indexed_items: "{{ dl_hosts_fakeorigin }}"
- name: Assert we have enough Delivery Service CName records to go around
assert:
that:
- - (hostvars[groups['fakeorigin'] | first].ds_names.split(',') | length) >= (dl_ds_merged_ds_template | length)
- success_msg: "Enough Delivery CNames Exist ({{ dl_ds_merged_ds_template | length }}/{{ hostvars[groups['fakeorigin'] | first].ds_names.split(',') | length }})"
- fail_msg: "Not enough DS CNames exist to cover all DS. Please go and create {{ (dl_ds_merged_ds_template | length) - (hostvars[groups['fakeorigin'] | first].ds_names.split(',') | length) }} more and rerun."
+ - (hostvars[dl_hosts_fakeorigin | first].ds_names.split(',') | length) >= (dl_ds_merged_ds_template | length)
+ success_msg: "Enough Delivery CNames Exist ({{ dl_ds_merged_ds_template | length }}/{{ hostvars[dl_hosts_fakeorigin | first].ds_names.split(',') | length }})"
+ fail_msg: "Not enough DS CNames exist to cover all DS. Please go and create {{ (dl_ds_merged_ds_template | length) - (hostvars[dl_hosts_fakeorigin | first].ds_names.split(',') | length) }} more and rerun."
vars:
Target_cdn_delegation: Invalid (just for rendering)
- name: Handle Delivery Service CDN Templates
include_tasks: ds_loader.yml
vars:
- Target_cdn_delegation_fqdn: "{{ Target_cdn_delegation | default(MKGA) }}.{{ (groups['traffic_ops'] | first).split('.')[1:] | join('.') | lower }}"
+ Target_cdn_delegation_fqdn: "{{ Target_cdn_delegation | default(mkga) }}.{{ (dl_hosts_to | first).split('.')[1:] | join('.') | lower }}"
Target_cdn_name: "{{ get_all_cdns.json | to_json | from_json | json_query(cdnName_query) }}"
Target_cdn_id: "{{ get_all_cdns.json | to_json | from_json | json_query(cdn_query) }}"
- cdnName_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation | lower }}`) == `true`].name | [0]"
- cdn_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation | lower }}`) == `true`].id | [0]"
+ cdnName_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation }}`) == `true`].name | [0]"
+ cdn_query: "response[?starts_with(domainName,`{{ Target_cdn_delegation }}`) == `true`].id | [0]"
with_items: "{{ cdnDelegationList }}"
loop_control:
loop_var: Target_cdn_delegation
@@ -842,6 +886,10 @@
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/deliveryservices"
method: GET
register: get_all_ds
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_ds['status']|default(0) == 200
- name: Render Federations Lists
with_items: "{{ cdnDelegationList }}"
@@ -863,6 +911,7 @@
file:
state: directory
path: "{{ lookup('env', 'PWD') }}/out/ssl"
+ delegate_to: localhost
- name: Set a default list of HTTPS DS
set_fact:
@@ -884,6 +933,8 @@
path: "{{ lookup('env', 'PWD') }}/out/ssl/{{ item.xmlId }}.key.pem"
force: yes
with_items: "{{ scrubbed_https_ds }}"
+ delegate_to: localhost
+ no_log: true
- name: Generate DS CSRs
openssl_csr:
@@ -906,6 +957,7 @@
- CA:FALSE
path: "{{ lookup('env', 'PWD') }}/out/ssl/{{ item.xmlId }}.csr"
force: yes
+ delegate_to: localhost
with_items: "{{ scrubbed_https_ds }}"
- name: Generate DS Certificates
@@ -924,7 +976,9 @@
provider: ownca
ownca_path: "{{ lookup('env', 'PWD') }}/out/ssl/lab.intermediateca.crt"
ownca_privatekey_path: "{{ lookup('env', 'PWD') }}/out/ssl/lab.intermediateca.key.pem"
+ delegate_to: localhost
with_items: "{{ scrubbed_https_ds }}"
+ no_log: true
- name: Generate TO Self-signed certs
uri:
@@ -942,6 +996,9 @@
deliveryservice: "{{ item.xmlId }}"
version: 1
with_items: "{{ scrubbed_https_ds }}"
+ no_log: true
+ retries: 10
+ delay: 10
- name: Upload DS SSL Data to Traffic Ops
uri:
@@ -958,9 +1015,13 @@
crt: |
{{ lookup('file', crtpath) }}
{{ lookup('file', intcertpath) }}
+ delegate_to: localhost
with_items: "{{ scrubbed_https_ds }}"
register: create_ds_sslkeys_out
failed_when: (create_ds_sslkeys_out.status == 400 and create_ds_sslkeys_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_ds_sslkeys_out.status > 400 and create_ds_sslkeys_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
vars:
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
keypath: "{{ lookup('env', 'PWD') }}/out/ssl/{{ item.xmlId }}.key.pem"
@@ -975,5 +1036,8 @@
with_items: "{{ get_all_cdns.json.response[1:] }}"
register: snapshot_out
failed_when: (snapshot_out.status == 400 and snapshot_out.json | to_json | from_json | json_query(error_query) | length != 0) or (snapshot_out.status > 400 and snapshot_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
vars:
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml
index fcc095b..f023868 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml
@@ -22,20 +22,15 @@
fixed_profile_name: "{{ Target_ds.profileName | default(dl_ds_default_ds.profileName) | default() }}"
ds_suffix: "{{ Target_ds.profileNameSuffix | default(dl_ds_default_ds.profileNameSuffix) | default() }}"
-
- name: Get All Profiles
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
method: GET
register: get_all_profiles
-
-- name: Get All Parameters per Profile
- uri:
- url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ item }}/parameters"
- method: GET
- vars:
- profile_query: "response.id"
- with_items: "{{ get_all_profiles.json.response | map(attribute='name') | list }}"
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_profiles['status']|default(0) == 200
- name: Create Delivery Services
uri:
@@ -45,6 +40,9 @@
with_indexed_items: "{{ dl_ds_merged_ds_template }}"
register: create_ds_out
failed_when: (create_ds_out.status == 400 and create_ds_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_ds_out.status > 400 and create_ds_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
vars:
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
profile_query: "[?type == `DS_PROFILE` && cdn == `{{ Target_cdn_id }}` && {% if (item.1.profileName | default(dl_ds_default_ds.profileName) | default(omit) ) != omit %}{{ profile_name_subquery }}{% else %}{{ profile_suffix_subquery }}{% endif %}].id | [0]"
@@ -55,7 +53,7 @@
tenant_id: "{{ get_all_tenants.json.response | json_query(tenant_query) }}"
type_query: "[?useInTable == `deliveryservice` && name == `{{ item.1.typeName | default(dl_ds_default_ds.typeName) | default(omit) }}`].id | [0]"
type_id: "{{ get_all_types.json.response | json_query(type_query) }}"
- computed_origin_url: "http://ds{{ item.0 }}-{{ groups['fakeorigin'] | first }}"
+ computed_origin_url: "http://ds{{ item.0 }}-{{ dl_hosts_fakeorigin | first }}"
computed_xmlid: "{{ item.1.uniqueKey }}-{{ Target_cdn_delegation | lower }}"
target_xmlId: "{{ item.1.xmlId | default(computed_xmlid) }}"
has_mso_server_profiles: "{{ (item.1.eligible_mso_server_profile_names | default(dl_ds_default_ds.eligible_mso_server_profile_names)) | length > 0 }}"
@@ -119,11 +117,20 @@
body:
cdn: Target_cdn_id
register: get_all_ds_cdn
+ no_log: true
+ retries: 10
+ delay: 10
+ until: get_all_ds_cdn['status']|default(0) == 200
- name: you have to call get once for Riak/TO to work right before you can add certs
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cdns/name/{{ Target_cdn_name }}/sslkeys"
method: GET
+ no_log: true
+ retries: 10
+ delay: 10
+ register: initialize_riak_results
+ until: initialize_riak_results['status']|default(0) == 200
- name: Assign Servers to Delivery Services - Grove
uri:
@@ -132,9 +139,14 @@
body:
serverNames: "{{ get_all_servers.json.response | to_json | from_json | json_query(server_query) }}"
with_indexed_items: "{{ dl_ds_merged_ds_template }}"
- when: serveFromGrove
+ when:
+ - dl_hosts_grove | length > 0
+ - serveFromGrove
register: create_ds_assignment_out
failed_when: (create_ds_assignment_out.status == 400 and create_ds_assignment_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_ds_assignment_out.status > 400 and create_ds_assignment_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
vars:
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
server_query: "[?type == `EDGE` && ({{ profile_filter }})].hostName"
@@ -154,6 +166,9 @@
when: serveFromATS
register: create_ds_assignment_out
failed_when: (create_ds_assignment_out.status == 400 and create_ds_assignment_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_ds_assignment_out.status > 400 and create_ds_assignment_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
vars:
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
server_query: "[?type == `EDGE` && ({{ profile_filter }})].hostName"
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/main.yml b/infrastructure/ansible/roles/dataset_loader/tasks/main.yml
index f881b6c..08bbc26 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/main.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/main.yml
@@ -21,6 +21,6 @@
return_content: yes
body_format: json
status_code: 200,400
- timeout: 120
+ timeout: 600
headers:
Cookie: "{{ dl_mojo_token.set_cookie | default(omit) }}"
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/parameter_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/parameter_loader.yml
index b68c0bc..fcf801c 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/parameter_loader.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/parameter_loader.yml
@@ -11,13 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- name: Create Non-DS Profiles - Per CDN
+- name: Create Non-DS Profiles - Per CDN (Non-Cache)
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles"
method: POST
body: "{{ lookup('template', 'profile.j2') }}"
with_items: "{{ dl_ds_merged_profile_cdntemplates }}"
- when: item.type != 'DS_PROFILE'
+ when: item.type != 'DS_PROFILE' and item.type != 'ATS_PROFILE' and item.type != 'GROVE_PROFILE'
vars:
name: "{{ item.name }}"
description: "{{ item.description }}"
@@ -28,18 +28,31 @@
target_xmlId: "Invalid (only for rendering)"
register: create_profiles_out
failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
-- name: Create and Associate Parameters to Non-DS Profiles - Per CDN
+- name: Create and Associate Parameters to Non-DS Profiles - Per CDN (Non-Cache)
uri:
url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/profiles/name/{{ item.name }}/parameters"
method: POST
body: "{{ lookup('template', 'parameter.j2') }}"
- when: item.type != 'DS_PROFILE'
+ when: item.type != 'DS_PROFILE' and item.type != 'ATS_PROFILE'and item.type != 'GROVE_PROFILE'
with_items:
- "{{ dl_ds_merged_profile_cdntemplates }}"
vars:
+ paramset: "{{ item.parameters | default([]) }}"
cdn_query: "response[?name == '{{ item.cdn | default('ALL') }}'].id | [0]"
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
target_xmlId: "Invalid (only for rendering)"
register: create_profiles_out
failed_when: (create_profiles_out.status == 400 and create_profiles_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_profiles_out.status > 400 and create_profiles_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
+
+- name: Handle Profile & Parameter CDN Cache Templates
+ include_tasks: cache_parameter_loader.yml
+ with_dict: "{{ cache_hardware_profile_index }}"
+ loop_control:
+ loop_var: Target_hardware_profile
diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml b/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml
index 9da7c25..a6919d7 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml
@@ -16,14 +16,9 @@
mso_server_ip: "{{ (mso_server_ip | default([]) ) + [ '127.'+(cdnDelegationIndex[Target_cdn_delegation]|string)+'.'+(item.value|string)+'.'+((Target_mso_ds.0 + 1)|string) ] }}"
with_dict: "{{ foIndex }}"
-- name: Distribute Eligible MSO Profiles Among Servers
- command: "{{ role_path }}/files/selection.set.py {{ Target_mso_ds.1.eligible_mso_server_profile_names | unique | sort | join(',') | quote }} {{ mso_server_ip | unique | sort | join(',') | quote }} denormalize"
- register: mso_server_profiles_out
- changed_when: false
-
-- name: Convert MSO Profile distribution to something more usable
+- name: Associate eligible MSO profiles to hosts
set_fact:
- mso_server_profiles: "{{ mso_server_profiles_out.stdout | from_json }}"
+ mso_server_profiles: "{{ Target_mso_ds.1.eligible_mso_server_profile_names | unique | sort | associate_round_robin(mso_server_ip | unique | sort) | denormalize_association }}"
# NOTE: THIS BREAKS IDEMPOTENCY
- name: Update Applicable MSO Parent Servers
@@ -74,6 +69,9 @@
routerPortName: "{{ item.routerPortName }}"
register: create_server_out
failed_when: (create_server_out.status == 400 and create_server_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_server_out.status > 400 and create_server_out.status < 600)
+ no_log: true
+ retries: 10
+ delay: 10
- name: Assign Servers to Delivery Services - MSO
uri:
@@ -82,6 +80,9 @@
body: "{{ lookup('template', 'deliveryserviceserver.j2') }}"
register: create_ds_assignment_out
failed_when: (create_ds_assignment_out.status == 400 and create_ds_assignment_out.json | to_json | from_json | json_query(error_query) | length != 0) or (create_ds_assignment_out.status > 400 and create_ds_assignment_out.status < 600 and create_ds_assignment_out.status != 500)
+ no_log: true
+ retries: 10
+ delay: 10
vars:
error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
computed_xmlid: "{{ Target_mso_ds.1.uniqueKey }}-{{ Target_cdn_delegation | lower }}"
diff --git a/infrastructure/ansible/roles/dataset_loader/templates/parameter.j2 b/infrastructure/ansible/roles/dataset_loader/templates/parameter.j2
index 80b6c0ff..935d4f4 100644
--- a/infrastructure/ansible/roles/dataset_loader/templates/parameter.j2
+++ b/infrastructure/ansible/roles/dataset_loader/templates/parameter.j2
@@ -12,8 +12,8 @@
# limitations under the License.
#}
[
-{% if item.parameters is defined and item.parameters is not none and item.parameters|length > 0 %}
-{% for param in item.parameters %}
+{% if paramset is defined and paramset is not none and paramset|length > 0 %}
+{% for param in paramset %}
{
"name": "{{ param.name }}",
"configFile": "{{ param.configFile }}",
diff --git a/infrastructure/ansible/roles/fakeOrigin/README.md b/infrastructure/ansible/roles/fakeOrigin/README.md
index 037df41..5b57de9 100644
--- a/infrastructure/ansible/roles/fakeOrigin/README.md
+++ b/infrastructure/ansible/roles/fakeOrigin/README.md
@@ -47,7 +47,7 @@ Example Playbook
import_role:
name: fakeOrigin
vars:
- install_fakeOrigin: true
+ install_fakeorigin: true
fo_http_port: 80
fo_https_port: 443
fo_ssl_key_file: /etc/pki/tls/private/server.key.pem
diff --git a/infrastructure/ansible/roles/fakeOrigin/defaults/main.yml b/infrastructure/ansible/roles/fakeOrigin/defaults/main.yml
index 5d8d0a3..0013149 100644
--- a/infrastructure/ansible/roles/fakeOrigin/defaults/main.yml
+++ b/infrastructure/ansible/roles/fakeOrigin/defaults/main.yml
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-install_fakeOrigin: false
-fo_pkg_name: "{% if fakeOrigin_version is defined and fakeOrigin_version != omit %}{{ 'fakeOrigin-'+fakeOrigin_version }}{% else %}fakeOrigin{% endif %}"
+install_fakeorigin: false
+fo_pkg_name: "{% if fakeorigin_version is defined and fakeorigin_version != omit %}{{ 'fakeOrigin-'+fakeorigin_version }}{% else %}fakeOrigin{% endif %}"
# Installation location information
fo_base_dir: /opt/fakeOrigin
diff --git a/infrastructure/ansible/roles/fakeOrigin/handlers/main.yml b/infrastructure/ansible/roles/fakeOrigin/handlers/main.yml
index 9344909..c5023f4 100644
--- a/infrastructure/ansible/roles/fakeOrigin/handlers/main.yml
+++ b/infrastructure/ansible/roles/fakeOrigin/handlers/main.yml
@@ -16,7 +16,7 @@
service:
name: fakeOrigin
state: restarted
- daemon_reload: yes
+ daemon_reload: true
notify: Wait for fakeOrigin to become available
- name: Wait for HTTP fakeOrigin to become available
diff --git a/infrastructure/ansible/roles/fakeOrigin/meta/main.yml b/infrastructure/ansible/roles/fakeOrigin/meta/main.yml
index 47f2880..a21ae1c 100644
--- a/infrastructure/ansible/roles/fakeOrigin/meta/main.yml
+++ b/infrastructure/ansible/roles/fakeOrigin/meta/main.yml
@@ -12,23 +12,24 @@
# limitations under the License.
#
galaxy_info:
- author: Jonathan Gray
+ role_name: fakeorigin
+ author: trafficcontrol
description: A role to assist with deploying the fakeOrigin test origin component of Apache Traffic Control
company: Apache Traffic Control
issue_tracker_url: https://github.com/apache/trafficcontrol/issues
license: Apache 2.0
min_ansible_version: 2.8
platforms:
- - name: CentOS
- versions:
- - 7
+ - name: CentOS
+ versions:
+ - 7
+ - 8
galaxy_tags:
- - fakeOrigin
- - fakeorigin
- - origin
- - testing
- - cdn
- - trafficcontrol
- - apache
- - atc
+ - fakeorigin
+ - origin
+ - testing
+ - cdn
+ - trafficcontrol
+ - apache
+ - atc
dependencies: []
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml b/infrastructure/ansible/roles/fakeOrigin/molecule/default/converge.yml
similarity index 90%
copy from infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
copy to infrastructure/ansible/roles/fakeOrigin/molecule/default/converge.yml
index 9875dce..ba2151b 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
+++ b/infrastructure/ansible/roles/fakeOrigin/molecule/default/converge.yml
@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- import_tasks: fakeOrigin.yml
- when: install_fakeOrigin
+- import_playbook: ../driver.yml
diff --git a/infrastructure/ansible/roles/fakeOrigin/molecule/default/molecule.yml b/infrastructure/ansible/roles/fakeOrigin/molecule/default/molecule.yml
new file mode 100644
index 0000000..05deefb
--- /dev/null
+++ b/infrastructure/ansible/roles/fakeOrigin/molecule/default/molecule.yml
@@ -0,0 +1,75 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+driver:
+ name: docker
+lint: |
+ set -e
+ yamllint -c ../molecule_shared/.yamllint .
+ ansible-lint -c ../molecule_shared/.ansible-lint .
+dependency:
+ name: shell
+ command: ansible-playbook -vvv -i localhost ${MOLECULE_VERBOSITY} ../molecule_shared/dependency.yml
+platforms:
+ - name: fo.testlab.invalid
+ image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ privileged: true
+ pre_build_image: true
+ tmpfs:
+ - /run
+ - /tmp
+ groups:
+ - docker_hosts
+ - fakeorigin
+ capabilities:
+ - SYS_ADMIN
+ port_bindings:
+ 80: 80
+ 443: 443
+ networks:
+ - name: molecule_fo_default
+ volumes:
+ - ${MOLECULE_EPHEMERAL_DIRECTORY}:/molecule
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ docker_networks:
+ - name: molecule_fo_default
+ enable_ipv6: true
+ force: true
+ driver: bridge
+ ipam_driver: default
+ ipam_config:
+ - subnet: 172.16.241.0/24
+ - subnet: "fc01:9400:1000:9::/64"
+
+provisioner:
+ name: ansible
+ playbooks:
+ prepare: "../../../molecule_shared/prepare.yml"
+ log: True
+ config_options:
+ defaults:
+ verbosity: 3
+ inventory:
+ group_vars:
+ docker-hosts:
+ docker_storage_driver: vfs
+ host_vars:
+ fo.testlab.invalid:
+ cdn: MKGA
+ component: fakeorigin
+ ansible_host: fo.testlab.invalid
+
+verifier:
+ name: ansible
diff --git a/infrastructure/ansible/roles/fakeOrigin/molecule/default/verify.yml b/infrastructure/ansible/roles/fakeOrigin/molecule/default/verify.yml
new file mode 100644
index 0000000..99016bf
--- /dev/null
+++ b/infrastructure/ansible/roles/fakeOrigin/molecule/default/verify.yml
@@ -0,0 +1,53 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- name: Verify TODB setup
+ hosts: all
+ gather_facts: yes
+ become: yes
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ vars:
+ known_uri_paths:
+ - /DUPLICATE_HLS_ABR_LIVE/HLS_ABR_LIVE_1280x720-20000.m3u8
+ - /DUPLICATE_HLS_ABR_LIVE/HLS_ABR_LIVE_1920x1080-40000.m3u8
+ - /DUPLICATE_HLS_ABR_LIVE/HLS_ABR_LIVE.m3u8
+ - /DUPLICATE_HLS_ABR_LIVE/HLS_ABR_LIVE.meta.json
+ - /DUPLICATE_HLS_ABR_VOD/HLS_ABR_VOD_1280x720-20000.m3u8
+ - /DUPLICATE_HLS_ABR_VOD/HLS_ABR_VOD_1920x1080-40000.m3u8
+ - /DUPLICATE_HLS_ABR_VOD/HLS_ABR_VOD.m3u8
+ - /DUPLICATE_HLS_ABR_VOD/HLS_ABR_VOD.meta.json
+ - /HLS_ABR_LIVE/HLS_ABR_LIVE_1280x720-20000.m3u8
+ - /HLS_ABR_LIVE/HLS_ABR_LIVE_1920x1080-40000.m3u8
+ - /HLS_ABR_LIVE/HLS_ABR_LIVE.m3u8
+ - /HLS_ABR_LIVE/HLS_ABR_LIVE.meta.json
+ - /HLS_ABR_VOD/HLS_ABR_VOD_1280x720-20000.m3u8
+ - /HLS_ABR_VOD/HLS_ABR_VOD_1920x1080-40000.m3u8
+ - /HLS_ABR_VOD/HLS_ABR_VOD.m3u8
+ - /HLS_ABR_VOD/HLS_ABR_VOD.meta.json
+ - /HLS_EVENT/HLS_EVENT.m3u8
+ - /HLS_EVENT/HLS_EVENT.meta.json
+ - /HLS_LIVE/HLS_LIVE.m3u8
+ - /HLS_LIVE/HLS_LIVE.meta.json
+ - /HLS_VOD/HLS_VOD.m3u8
+ - /HLS_VOD/HLS_VOD.meta.json
+ - /SampleDir/kelloggs.mp4
+ - /SampleDir/LICENSE
+ - /SampleVideo/kelloggs.mp4
+
+ tasks:
+ - name: Ensure all assets are being served
+ shell: curl --no-keepalive --show-error -Lvs4 --connect-timeout 2 --fail -o /dev/null {{ (['http://localhost','https://fo.testlab.invalid'] | product(known_uri_paths) | map('join')) | join(' ') }} > /dev/null
diff --git a/infrastructure/ansible/roles/fakeOrigin/molecule/driver.yml b/infrastructure/ansible/roles/fakeOrigin/molecule/driver.yml
new file mode 100644
index 0000000..fde4e38
--- /dev/null
+++ b/infrastructure/ansible/roles/fakeOrigin/molecule/driver.yml
@@ -0,0 +1,330 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- name: Base FO setup
+ hosts: all
+ gather_facts: true
+ become: true
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ tasks:
+ - name: Install Optional Dependencies
+ yum:
+ name:
+ - "{{ ffmpeg_url[ansible_distribution_major_version] }}"
+ update_cache: true
+ state: present
+ enablerepo: "{{ additional_yum_repos | default([]) }}"
+ lock_timeout: 300
+ disable_gpg_check: true
+ retries: 5
+ delay: 5
+ vars:
+ ffmpeg_url:
+ "7": https://pkg.opencast.org/rpms/release/el/7/x86_64/ffmpeg/ffmpeg-4.3.git.20200616044012-1.el7.x86_64.rpm
+ "8": https://pkg.opencast.org/rpms/release/el/8/x86_64/ffmpeg/ffmpeg-4.3.git.20200616044012-1.el8.x86_64.rpm
+
+ - name: Deploy fakeOrigin
+ import_role:
+ name: fakeOrigin
+ vars:
+ install_fakeorigin: true
+ fo_http_port: 80
+ fo_https_port: 443
+ fo_ssl_key_file: /etc/pki/tls/private/server.key.pem
+ fo_ssl_cert_file: /etc/pki/tls/certs/server.crt
+ fo_binding_address: "0.0.0.0"
+ fo_endpoint_config:
+ - id: SampleVideo
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}"
+ type: static
+ - id: SampleDir
+ source: "{{ fo_video_dir }}"
+ outputdir: "{{ fo_output_dir }}"
+ type: dir
+ - id: HLS_ABR_VOD
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}/HLS_ABR_VOD"
+ type: vod
+ manual_command:
+ - ffmpeg
+ - "-y"
+ - "-i"
+ - "%SOURCE%"
+ - "-vf"
+ - scale=w=1280:h=720:force_original_aspect_ratio=decrease
+ - "-c:a"
+ - aac
+ - "-ar"
+ - '48000'
+ - "-c:v"
+ - h264
+ - "-profile:v"
+ - main
+ - "-crf"
+ - '20'
+ - "-sc_threshold"
+ - '0'
+ - "-g"
+ - '48'
+ - "-keyint_min"
+ - '48'
+ - "-hls_time"
+ - '4'
+ - "-hls_playlist_type"
+ - vod
+ - "-b:v"
+ - 2800k
+ - "-b:a"
+ - 128k
+ - "-hls_list_size"
+ - '0'
+ - "-hls_segment_filename"
+ - "%OUTPUTDIRECTORY%/%DISKID%_seq_%03d_1280x720.ts"
+ - "%OUTPUTDIRECTORY%/%DISKID%_1280x720-20000.m3u8"
+ - "-vf"
+ - scale=w=1920:h=1080:force_original_aspect_ratio=decrease
+ - "-c:a"
+ - aac
+ - "-ar"
+ - '48000'
+ - "-c:v"
+ - h264
+ - "-profile:v"
+ - main
+ - "-crf"
+ - '20'
+ - "-sc_threshold"
+ - '0'
+ - "-g"
+ - '48'
+ - "-keyint_min"
+ - '48'
+ - "-hls_time"
+ - '4'
+ - "-hls_playlist_type"
+ - vod
+ - "-b:v"
+ - 5000k
+ - "-b:a"
+ - 192k
+ - "-hls_list_size"
+ - '0'
+ - "-hls_segment_filename"
+ - "%OUTPUTDIRECTORY%/%DISKID%_seq_%03d_1920x1080.ts"
+ - "%OUTPUTDIRECTORY%/%DISKID%_1920x1080-40000.m3u8"
+ - id: HLS_ABR_LIVE
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}/HLS_ABR_LIVE"
+ type: live
+ manual_command:
+ - ffmpeg
+ - "-y"
+ - "-i"
+ - "%SOURCE%"
+ - "-vf"
+ - scale=w=1280:h=720:force_original_aspect_ratio=decrease
+ - "-c:a"
+ - aac
+ - "-ar"
+ - '48000'
+ - "-c:v"
+ - h264
+ - "-profile:v"
+ - main
+ - "-crf"
+ - '20'
+ - "-sc_threshold"
+ - '0'
+ - "-g"
+ - '48'
+ - "-keyint_min"
+ - '48'
+ - "-hls_time"
+ - '4'
+ - "-hls_playlist_type"
+ - vod
+ - "-b:v"
+ - 2800k
+ - "-b:a"
+ - 128k
+ - "-hls_list_size"
+ - '0'
+ - "-hls_segment_filename"
+ - "%OUTPUTDIRECTORY%/%DISKID%_seq_%03d_1280x720.ts"
+ - "%OUTPUTDIRECTORY%/%DISKID%_1280x720-20000.m3u8"
+ - "-vf"
+ - scale=w=1920:h=1080:force_original_aspect_ratio=decrease
+ - "-c:a"
+ - aac
+ - "-ar"
+ - '48000'
+ - "-c:v"
+ - h264
+ - "-profile:v"
+ - main
+ - "-crf"
+ - '20'
+ - "-sc_threshold"
+ - '0'
+ - "-g"
+ - '48'
+ - "-keyint_min"
+ - '48'
+ - "-hls_time"
+ - '4'
+ - "-hls_playlist_type"
+ - vod
+ - "-b:v"
+ - 5000k
+ - "-b:a"
+ - 192k
+ - "-hls_list_size"
+ - '0'
+ - "-hls_segment_filename"
+ - "%OUTPUTDIRECTORY%/%DISKID%_seq_%03d_1920x1080.ts"
+ - "%OUTPUTDIRECTORY%/%DISKID%_1920x1080-40000.m3u8"
+ - id: DUPLICATE_HLS_ABR_VOD
+ override_disk_id: HLS_ABR_VOD
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}/HLS_ABR_VOD"
+ type: vod
+ - id: DUPLICATE_HLS_ABR_LIVE
+ override_disk_id: HLS_ABR_LIVE
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}/HLS_ABR_LIVE"
+ type: live
+ - id: HLS_VOD
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}/HLS_VOD"
+ type: vod
+ manual_command:
+ - ffmpeg
+ - "-y"
+ - "-i"
+ - "%SOURCE%"
+ - "-vf"
+ - scale=w=1920:h=1080:force_original_aspect_ratio=decrease
+ - "-c:a"
+ - aac
+ - "-ar"
+ - '48000'
+ - "-c:v"
+ - h264
+ - "-profile:v"
+ - main
+ - "-crf"
+ - '20'
+ - "-sc_threshold"
+ - '0'
+ - "-g"
+ - '48'
+ - "-keyint_min"
+ - '48'
+ - "-hls_time"
+ - '4'
+ - "-hls_playlist_type"
+ - vod
+ - "-b:v"
+ - 5000k
+ - "-b:a"
+ - 192k
+ - "-hls_list_size"
+ - '0'
+ - "-hls_segment_filename"
+ - "%OUTPUTDIRECTORY%/%DISKID%_seq_%03d.ts"
+ - "%OUTPUTDIRECTORY%/%DISKID%.m3u8"
+ - id: HLS_LIVE
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}/HLS_LIVE"
+ type: live
+ manual_command:
+ - ffmpeg
+ - "-y"
+ - "-i"
+ - "%SOURCE%"
+ - "-vf"
+ - scale=w=1920:h=1080:force_original_aspect_ratio=decrease
+ - "-c:a"
+ - aac
+ - "-ar"
+ - '48000'
+ - "-c:v"
+ - h264
+ - "-profile:v"
+ - main
+ - "-crf"
+ - '20'
+ - "-sc_threshold"
+ - '0'
+ - "-g"
+ - '48'
+ - "-keyint_min"
+ - '48'
+ - "-hls_time"
+ - '4'
+ - "-hls_playlist_type"
+ - vod
+ - "-b:v"
+ - 5000k
+ - "-b:a"
+ - 192k
+ - "-hls_list_size"
+ - '0'
+ - "-hls_segment_filename"
+ - "%OUTPUTDIRECTORY%/%DISKID%_seq_%03d.ts"
+ - "%OUTPUTDIRECTORY%/%DISKID%.m3u8"
+ - id: HLS_EVENT
+ source: "{{ fo_sample_video }}"
+ outputdir: "{{ fo_output_dir }}/HLS_EVENT"
+ type: event
+ manual_command:
+ - ffmpeg
+ - "-y"
+ - "-i"
+ - "%SOURCE%"
+ - "-vf"
+ - scale=w=1920:h=1080:force_original_aspect_ratio=decrease
+ - "-c:a"
+ - aac
+ - "-ar"
+ - '48000'
+ - "-c:v"
+ - h264
+ - "-profile:v"
+ - main
+ - "-crf"
+ - '20'
+ - "-sc_threshold"
+ - '0'
+ - "-g"
+ - '48'
+ - "-keyint_min"
+ - '48'
+ - "-hls_time"
+ - '4'
+ - "-hls_playlist_type"
+ - event
+ - "-b:v"
+ - 5000k
+ - "-b:a"
+ - 192k
+ - "-hls_list_size"
+ - '0'
+ - "-hls_segment_filename"
+ - "%OUTPUTDIRECTORY%/%DISKID%_seq_%03d.ts"
+ - "%OUTPUTDIRECTORY%/%DISKID%.m3u8"
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml b/infrastructure/ansible/roles/fakeOrigin/molecule/scenario.requirement.vars.yml
similarity index 75%
copy from infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
copy to infrastructure/ansible/roles/fakeOrigin/molecule/scenario.requirement.vars.yml
index 9875dce..2bbdcde 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
+++ b/infrastructure/ansible/roles/fakeOrigin/molecule/scenario.requirement.vars.yml
@@ -12,5 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- import_tasks: fakeOrigin.yml
- when: install_fakeOrigin
+
+# This should be a list of dictionaries with the following keys: rpm_prefix, pkg_script_name
+required_rpms:
+ - rpm_prefix: fakeOrigin-
+ pkg_script_name: fakeorigin_build
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/fakeOrigin.yml b/infrastructure/ansible/roles/fakeOrigin/tasks/fakeOrigin.yml
index 26b44df..7319cd4 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/fakeOrigin.yml
+++ b/infrastructure/ansible/roles/fakeOrigin/tasks/fakeOrigin.yml
@@ -13,10 +13,10 @@
# limitations under the License.
#
- name: Install fakeOrigin
- yum:
+ package:
name: "{{ fo_pkg_name }}"
state: installed
- update_cache : yes
+ update_cache: true
lock_timeout: 300
enablerepo: "{{ additional_yum_repos | default([]) }}"
notify: Restart fakeOrigin
@@ -35,4 +35,4 @@
- name: Enable fakeOrigin on startup
systemd:
name: fakeOrigin
- enabled: yes
+ enabled: true
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml b/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
index 9875dce..6d5f27e 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
+++ b/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
@@ -13,4 +13,4 @@
# limitations under the License.
#
- import_tasks: fakeOrigin.yml
- when: install_fakeOrigin
+ when: install_fakeorigin
diff --git a/infrastructure/ansible/roles/molecule_shared/.ansible-lint b/infrastructure/ansible/roles/molecule_shared/.ansible-lint
new file mode 100644
index 0000000..f18f7b7
--- /dev/null
+++ b/infrastructure/ansible/roles/molecule_shared/.ansible-lint
@@ -0,0 +1,69 @@
+# .ansible-lint
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+exclude_paths:
+- .github/**
+# parseable: true
+# quiet: true
+verbosity: 5
+
+# Mock modules or roles in order to pass ansible-playbook --syntax-check
+mock_modules:
+ - zuul_return
+ - fake_namespace.fake_collection.fake_module
+ # note the foo.bar is invalid as being neither a module or a collection
+mock_roles:
+ - mocked_role
+ - author.role_name # old standalone galaxy role
+ - fake_namespace.fake_collection.fake_role # role within a collection
+
+# Enable checking of loop variable prefixes in roles
+loop_var_prefix: "{role}_"
+
+use_default_rules: true
+# Load custom rules from this specific folder
+# rulesdir:
+# - ./rule/directory/
+
+# This makes linter to fully ignore rules/tags listed below
+skip_list:
+ - skip_this_tag
+ - git-latest
+ - risky-file-permissions
+
+# Report only a subset of tags and fully ignore any others
+# tags:
+# - var-spacing
+
+# This makes the linter display but not fail for rules/tags listed below:
+warn_list:
+ - skip_this_tag
+ - git-latest
+ - experimental # experimental is included in the implicit list
+
+# Offline mode disables installation of requirements.yml
+offline: false
+
+# Define required Ansible's variables to satisfy syntax check
+extra_vars:
+ foo: bar
+ multiline_string_variable: |
+ line1
+ line2
+ complex_variable: ":{;\t$()"
+
+# Uncomment to enforce action validation with tasks, usually is not
+# needed as Ansible syntax check also covers it.
+# skip_action_validation: false
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml b/infrastructure/ansible/roles/molecule_shared/.gitignore
similarity index 89%
copy from infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
copy to infrastructure/ansible/roles/molecule_shared/.gitignore
index 9875dce..a41c8a6 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
+++ b/infrastructure/ansible/roles/molecule_shared/.gitignore
@@ -1,4 +1,3 @@
----
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,5 +11,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- import_tasks: fakeOrigin.yml
- when: install_fakeOrigin
+files/ssl
+secret_varfile.json
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml b/infrastructure/ansible/roles/molecule_shared/.yamllint
similarity index 73%
copy from infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml
copy to infrastructure/ansible/roles/molecule_shared/.yamllint
index febaa05..d2ba6ff 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml
+++ b/infrastructure/ansible/roles/molecule_shared/.yamllint
@@ -12,8 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- import_tasks: "{{ role_path }}/tasks/traffic_opsdb.yml"
- when: install_traffic_opsdb
+extends: default
-- import_tasks: "{{ role_path }}/tasks/initialize_traffic_opsdb.yml"
- when: initialize_traffic_opsdb
+rules:
+ braces:
+ max-spaces-inside: 1
+ level: error
+ brackets:
+ max-spaces-inside: 1
+ level: error
+ line-length: disable
+ truthy: disable
+ document-start: disable
diff --git a/infrastructure/ansible/roles/molecule_shared/ansible.cfg b/infrastructure/ansible/roles/molecule_shared/ansible.cfg
new file mode 100644
index 0000000..904554a
--- /dev/null
+++ b/infrastructure/ansible/roles/molecule_shared/ansible.cfg
@@ -0,0 +1,16 @@
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+;
+
+[defaults]
+~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:..
diff --git a/infrastructure/ansible/roles/molecule_shared/dependency.yml b/infrastructure/ansible/roles/molecule_shared/dependency.yml
new file mode 100644
index 0000000..c87aa14
--- /dev/null
+++ b/infrastructure/ansible/roles/molecule_shared/dependency.yml
@@ -0,0 +1,237 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+- hosts: localhost
+ connection: local
+ gather_facts: false
+
+ vars:
+ secret_varfile_src: "{{ playbook_dir }}/secret_varfile.json"
+ secret_varfile_dest: "{{ lookup('env','MOLECULE_EPHEMERAL_DIRECTORY') }}/secret_varfile.json"
+ lab_ssl_dir: "{{ playbook_dir }}/files/ssl"
+ lab_rpm_dir: "{{ lookup('env','MOLECULE_EPHEMERAL_DIRECTORY') }}//files/rpm/{{ centos_version }}"
+ lab_srpm_dir: "{{ lookup('env','MOLECULE_EPHEMERAL_DIRECTORY') }}//files/srpm/{{ centos_version }}"
+ lab_ca_root_csr: "{{ lab_ssl_dir }}/lab.rootca.key.csr"
+ lab_ca_root_key: "{{ lab_ssl_dir }}/lab.rootca.key.pem"
+ lab_ca_root_crt: "{{ lab_ssl_dir }}/lab.rootca.crt"
+ lab_ca_int_csr: "{{ lab_ssl_dir }}/lab.intermediateca.csr"
+ lab_ca_int_key: "{{ lab_ssl_dir }}/lab.intermediateca.key.pem"
+ lab_ca_int_crt: "{{ lab_ssl_dir }}/lab.intermediateca.crt"
+ rpm_dist_dir: "{{ playbook_dir }}/../../../../dist"
+ centos_version: "{{ matrix_distro_mapping[lookup('env','MOLECULE_DISTRO') | default('centos7',true)] }}"
+ extended_centos_version: "el{{ centos_version }}"
+ matrix_distro_mapping:
+ centos7: 7
+ centos8: 8
+
+ tasks:
+ - name: Load existing secret varfile
+ include_vars:
+ file: "{{ secret_varfile_src }}"
+ name: existing_secrets
+ ignore_errors: true
+ no_log: true
+
+ - name: Load scenario requirements varfile
+ include_vars:
+ file: "{{ lookup('first_found', possible_files) }}"
+ name: scenario_requirements
+ vars:
+ possible_files:
+ - "{{ lookup('env','MOLECULE_SCENARIO_DIRECTORY') }}/scenario.requirement.vars.yml"
+ - "{{ lookup('env','MOLECULE_SCENARIO_DIRECTORY') }}/../scenario.requirement.vars.yml"
+ no_log: true
+
+ - name: Populate all the secrets to be used with this lab
+ set_fact:
+ secrets:
+ postgresql_admin_user_password: "{{ existing_secrets_nullable.postgresql_admin_user_password | default(lookup('password', password_settings)) }}"
+ postgresql_replica_user_password: "{{ existing_secrets_nullable.postgresql_replica_user_password | default(lookup('password', password_settings)) }}"
+ todb_password: "{{ existing_secrets_nullable.todb_password | default(lookup('password', password_settings)) }}"
+ tvdb_password: "{{ existing_secrets_nullable.tvdb_password | default(lookup('password', password_settings)) }}"
+ no_log: true
+ vars:
+ existing_secrets_nullable: (existing_secrets | default({}))
+ password_settings: /dev/null chars=ascii_letters,digits length=16
+
+ - name: Write out the completed secret file (including backfilling new ones)
+ copy:
+ content: "{{ secrets | to_nice_json(indent=2) }}"
+ dest: "{{ item }}"
+ mode: '0600'
+ with_items:
+ - "{{ secret_varfile_src }}"
+ - "{{ secret_varfile_dest }}"
+
+ - name: Check if SSL data already exists
+ stat:
+ path: "{{ lab_ca_root_csr }}"
+ register: ssl_data
+
+ - name: Generate SSL data
+ block:
+ - name: Ensure SSL info directory exists
+ file:
+ state: directory
+ path: "{{ lab_ssl_dir }}"
+
+ - name: Regenerate Lab Root CA Private key
+ openssl_privatekey:
+ path: "{{ lab_ca_root_key }}"
+ force: yes
+
+ - name: Regenerate Lab Root CA CSR
+ openssl_csr:
+ basic_constraints:
+ - CA:TRUE
+ privatekey_path: "{{ lab_ca_root_key }}"
+ subject:
+ CN: CDNLAB.invalid
+ C: US
+ ST: Colorado
+ L: Denver
+ O: Molecule Testing
+ OU: CDN
+ emailAddress: ops@email.invalid
+ path: "{{ lab_ca_root_csr }}"
+ force: yes
+
+ - name: Regenerate Lab Root CA Certificate
+ openssl_certificate:
+ csr_path: "{{ lab_ca_root_csr }}"
+ force: yes
+ path: "{{ lab_ca_root_crt }}"
+ privatekey_path: "{{ lab_ca_root_key }}"
+ provider: selfsigned
+
+ - name: Generate Intermediate Signing CA Private keys
+ openssl_privatekey:
+ path: "{{ lab_ca_int_key }}"
+ force: yes
+
+ - name: Generate Intermediate Signing CA CSRs
+ openssl_csr:
+ privatekey_path: "{{ lab_ca_int_key }}"
+ subject:
+ CN: "Lab Intermediate CA"
+ C: US
+ ST: Colorado
+ L: Denver
+ O: Molecule Testing
+ OU: CDN
+ emailAddress: ops@email.invalid
+ key_usage:
+ - digitalSignature
+ - keyCertSign
+ basic_constraints:
+ - CA:TRUE
+ - pathlen:0
+ path: "{{ lab_ca_int_csr }}"
+ force: yes
+
+ - name: Generate Intermediate Signing CA Certificates
+ openssl_certificate:
+ csr_path: "{{ lab_ca_int_csr }}"
+ force: yes
+ path: "{{ lab_ca_int_crt }}"
+ privatekey_path: "{{ lab_ca_int_key }}"
+ provider: ownca
+ ownca_path: "{{ lab_ca_root_crt }}"
+ ownca_privatekey_path: "{{ lab_ca_root_key }}"
+ when: not ssl_data.stat.exists
+
+ - name: Make SSL data available to molecule instances
+ copy:
+ src: "{{ lab_ssl_dir }}/"
+ dest: "{{ lookup('env','MOLECULE_EPHEMERAL_DIRECTORY') }}/files/ssl/"
+
+ - name: Prepare the RPMs for the upcoming instances
+ block:
+ - name: Check if needed RPMs exist
+ shell: "ls -l {{ rpm_dist_dir }}/*.rpm | grep -vE 'debuginfo|debugsource|\\.src\\.rpm' | tr -s ' ' ' ' | cut -d' ' -f9 | grep el{{ centos_version }} | grep -E '{{ scenario_requirements.required_rpms | map(attribute='rpm_prefix') | join('|') | default('NONE', true) }}'"
+ register: pkg_rpms
+ ignore_errors: true
+ changed_when: false
+ failed_when: false
+
+ - name: Get pkg targets that require the optional flag
+ command: "./pkg -{{ centos_version }} -o -l"
+ args:
+ chdir: "{{ playbook_dir }}/../../../.."
+ register: optional_pkg_targets
+ changed_when: false
+
+ - name: Find missing non-optional rpms
+ set_fact:
+ missing_non_optional_rpms: "{{ (missing_non_optional_rpms | default([])) + [item.pkg_script_name] }}"
+ with_items: "{{ filtered_req_rpms }}"
+ when: (matched_rpms | length) == 0
+ vars:
+ build_targets: "{{ scenario_requirements.required_rpms | map(attribute='pkg_script_name') | difference(optional_pkg_targets.stdout_lines) }}"
+ filtered_req_rpms_query_dynamic: "{% for p in build_targets %}pkg_script_name == `{{ p }}`{% if not loop.last %} || {% endif %}{% endfor %}"
+ filtered_req_rpms_query: "[?{{ filtered_req_rpms_query_dynamic if filtered_req_rpms_query_dynamic != '' else false }}]"
+ filtered_req_rpms: "{{ scenario_requirements.required_rpms | json_query(filtered_req_rpms_query) }}"
+ matched_rpms_query: "[?starts_with(@,`{{ item.rpm_prefix }}`)]"
+ matched_rpms: "{{ pkg_rpms.stdout_lines | map('basename') | json_query(matched_rpms_query) }}"
+
+ - name: Find missing optional rpms
+ set_fact:
+ missing_optional_rpms: "{{ (missing_optional_rpms | default([])) + [item.pkg_script_name] }}"
+ with_items: "{{ filtered_req_rpms }}"
+ when: (matched_rpms | length) == 0
+ vars:
+ build_targets: "{{ scenario_requirements.required_rpms | map(attribute='pkg_script_name') | intersect(optional_pkg_targets.stdout_lines) }}"
+ filtered_req_rpms_query_dynamic: "{% for p in build_targets %}pkg_script_name == `{{ p }}`{% if not loop.last %} || {% endif %}{% endfor %}"
+ filtered_req_rpms_query: "[?{{ filtered_req_rpms_query_dynamic if filtered_req_rpms_query_dynamic != '' else false }}]"
+ filtered_req_rpms: "{{ scenario_requirements.required_rpms | json_query(filtered_req_rpms_query) }}"
+ matched_rpms_query: "[?starts_with(@,`{{ item.rpm_prefix }}`)]"
+ matched_rpms: "{{ pkg_rpms.stdout_lines | map('basename') | json_query(matched_rpms_query) }}"
+
+ - name: Invoke pkg to build missing rpms
+ command: "{{ item.cmdstr }}"
+ args:
+ chdir: "{{ playbook_dir }}/../../../.."
+ when: (item.target_rpms | length) > 0
+ with_items:
+ - cmdstr: "./pkg -v -{{ centos_version }} {{ missing_non_optional_rpms | default([]) | join(' ') }}"
+ target_rpms: "{{ missing_non_optional_rpms | default([]) }}"
+ - cmdstr: "./pkg -v -{{ centos_version }} -o {{ missing_optional_rpms | default([]) | join(' ') }}"
+ target_rpms: "{{ missing_optional_rpms | default([]) }}"
+
+ - name: Ensure RPM directories exists
+ file:
+ state: directory
+ path: "{{ item }}"
+ with_items:
+ - "{{ lab_rpm_dir }}"
+ - "{{ lab_srpm_dir }}"
+ - "{{ playbook_dir }}/../../../../dist/"
+
+ - name: Copy in the RPMs
+ copy:
+ src: "{{ item.0 }}"
+ dest: "{{ item.1 }}"
+ vars:
+ host_rpm_path: "{{ playbook_dir }}/../../../../dist/"
+ host_rpm_glob: "{{ host_rpm_path }}*{{ extended_centos_version }}*x86_64.rpm"
+ host_srpm_glob: "{{ host_rpm_path }}*{{ extended_centos_version }}*src.rpm"
+ rpm_dest: "{{ lab_rpm_dir }}"
+ srpm_dest: "{{ lab_srpm_dir }}"
+ rpm_name: "{{ item.0 | basename }}"
+ all_rpmname_regex: "{{ scenario_requirements.required_rpms | map(attribute='rpm_prefix') | map('regex_replace','^(.*)$','^\\1.*$') | join('|') }}"
+ when: rpm_name is search(all_rpmname_regex) and all_rpmname_regex != ""
+ with_items:
+ - "{{ (lookup('fileglob',host_rpm_glob) | default('',true)).split(',') | product([rpm_dest]) }}"
+ - "{{ (lookup('fileglob',host_srpm_glob) | default('',true)).split(',') | product([srpm_dest]) }}"
diff --git a/infrastructure/ansible/roles/molecule_shared/prepare.yml b/infrastructure/ansible/roles/molecule_shared/prepare.yml
new file mode 100644
index 0000000..66e8372
--- /dev/null
+++ b/infrastructure/ansible/roles/molecule_shared/prepare.yml
@@ -0,0 +1,149 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+- hosts: all
+ gather_facts: true
+
+ vars:
+ server_private_key_path: /etc/pki/tls/private/server.key.pem
+ server_csr_path: /etc/pki/tls/certs/server.csr
+ server_crt_path: /etc/pki/tls/certs/server.crt
+ ca_data_mapping:
+ - src: /molecule/files/ssl/lab.rootca.crt
+ dest: /etc/pki/ca-trust/source/anchors/lab.rootca.crt
+ - src: /molecule/files/ssl/lab.intermediateca.crt
+ dest: /etc/pki/ca-trust/source/anchors/lab.intermediateca.crt
+ - src: /molecule/files/ssl/lab.intermediateca.key.pem
+ dest: /etc/pki/tls/private/lab.intermediateca.key.pem
+
+ tasks:
+ - name: Dump all the hostvars to inspect later
+ debug:
+ var: hostvars
+ verbosity: 2
+
+ - name: Generate Server Private keys
+ openssl_privatekey:
+ path: "{{ server_private_key_path }}"
+ force: yes
+
+ - name: Generate a CSR
+ openssl_csr:
+ privatekey_path: "{{ server_private_key_path }}"
+ subject:
+ CN: "{{ additional_DNS_names | default(ansible_host) }}"
+ C: US
+ ST: Colorado
+ L: Denver
+ O: Molecule Testing
+ OU: CDN
+ emailAddress: ops@email.invalid
+ subject_alt_name: "{{ san_arr | difference(invalid_DNS) }}"
+ path: "{{ server_csr_path }}"
+ force: yes
+ vars:
+ san_arr:
+ - "IP:{{ default_ipv4.address | default('invalid.invalid') }}"
+ - "DNS:{{ ansible_host }}"
+ - "DNS:{{ additional_dns_names | default('invalid.invalid') }}"
+ - "{% if additional_dns_cnames is defined and len(additional_dns_cnames) > 0 %}{% for name in additional_dns_cnames %}DNS:{{ name }}{% endfor %}{% else %}DNS:invalid.invalid{% endif %}"
+ invalid_DNS:
+ - "DNS:invalid.invalid"
+ - "IP:invalid.invalid"
+
+ - name: Copy the main ssl files into each proper destination
+ copy:
+ src: "{{ item.src }}"
+ dest: "{{ item.dest }}"
+ remote_src: true
+ with_items: "{{ ca_data_mapping }}"
+
+ - name: Generate Server Certificates
+ openssl_certificate:
+ csr_path: "{{ server_csr_path }}"
+ force: yes
+ path: "{{ server_crt_path }}"
+ privatekey_path: "{{ server_private_key_path }}"
+ provider: ownca
+ ownca_path: "{{ int_ca_crt_path }}"
+ ownca_privatekey_path: "{{ int_ca_crt_key }}"
+ vars:
+ int_ca_crt_key: "{{ ca_data_mapping | to_json | from_json | json_query('[?contains(dest,`intermediateca.key`)].dest|[0]') }}"
+ int_ca_crt_path: "{{ ca_data_mapping | to_json | from_json | json_query('[?contains(dest,`intermediateca.crt`)].dest|[0]') }}"
+
+ - name: Ensure Server Certificate and Key have correct permissions
+ file:
+ path: "{{ item.dest }}"
+ mode: "{{ '0644' if item.dest is match('.*.crt') else '0700' }}"
+ state: file
+ with_items: "{{ ca_data_mapping + server_ssl_mapping }}"
+ vars:
+ server_ssl_mapping:
+ - dest: "{{ server_private_key_path }}"
+ - dest: "{{ server_crt_path }}"
+
+ - name: Ensure needed packages are installed
+ package:
+ name:
+ - ca-certificates
+ - createrepo
+ - crontabs
+ state: present
+ lock_timeout: 300
+ enablerepo: "{{ additional_yum_repos | default([]) }}"
+ retries: 5
+ delay: 5
+
+ - name: Update server trusts
+ command: /bin/update-ca-trust
+ retries: 10
+ delay: 10
+
+ - name: Populate yum repo data
+ command: "createrepo --update {{ item }}"
+ run_once: true
+ with_items:
+ - "/molecule/files/rpm/{{ ansible_distribution_major_version }}"
+ - "/molecule/files/srpm/{{ ansible_distribution_major_version }}"
+
+ - name: Create a cronjob to ensure the repo metadata stays in sync
+ cron:
+ name: Refresh molecule yum repo metadata
+ minute: '*/3'
+ job: "createrepo --update -C {{ item }}"
+ run_once: true
+ with_items:
+ - "/molecule/files/rpm/{{ ansible_distribution_major_version }}"
+ - "/molecule/files/srpm/{{ ansible_distribution_major_version }}"
+
+ - name: Add the molecule yum repos
+ yum_repository:
+ name: "{{ item.name }}"
+ description: The local molecule mounted ATC repo
+ baseurl: "file://{{ item.path }}"
+ gpgcheck: no
+ enabled: "{{ item.enabled }}"
+ with_items:
+ - name: molecule
+ path: "/molecule/files/rpm/{{ ansible_distribution_major_version }}"
+ enabled: yes
+ - name: molecule-src
+ path: "/molecule/files/srpm/{{ ansible_distribution_major_version }}"
+ enabled: no
+
+ - name: Ensure the yum metadata contains the new repos
+ shell: yum clean all && yum repolist
+ args:
+ warn: no
diff --git a/infrastructure/ansible/roles/molecule_shared/regenerate.ssl.ca.yml b/infrastructure/ansible/roles/molecule_shared/regenerate.ssl.ca.yml
new file mode 100644
index 0000000..ee1a189
--- /dev/null
+++ b/infrastructure/ansible/roles/molecule_shared/regenerate.ssl.ca.yml
@@ -0,0 +1,118 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+- hosts: localhost
+ connection: local
+ gather_facts: false
+
+ vars:
+ lab_ssl_dir: "{{ lookup('env', 'PWD') }}/files/ssl/"
+ lab_ca_root_csr: "{{ lab_ssl_dir }}/lab.rootca.key.csr"
+ lab_ca_root_key: "{{ lab_ssl_dir }}/lab.rootca.key.pem"
+ lab_ca_root_crt: "{{ lab_ssl_dir }}/lab.rootca.crt"
+ lab_ca_int_csr: "{{ lab_ssl_dir }}/lab.intermediateca.csr"
+ lab_ca_int_key: "{{ lab_ssl_dir }}/lab.intermediateca.key.pem"
+ lab_ca_int_crt: "{{ lab_ssl_dir }}/lab.intermediateca.crt"
+ regenerate_root: true
+
+ tasks:
+ - name: Ensure SSL info directory exists
+ file:
+ state: directory
+ path: "{{ lookup('env', 'PWD') }}/files/ssl"
+
+ - name: Regenerate Lab Root CA Private key
+ openssl_privatekey:
+ path: "{{ lab_ca_root_key }}"
+ force: yes
+ when: regenerate_root is defined and (regenerate_root|bool == true) | default(false)
+
+ - name: Regenerate Lab Root CA CSR
+ openssl_csr:
+ basic_constraints:
+ - CA:TRUE
+ privatekey_path: "{{ lab_ca_root_key }}"
+ subject:
+ CN: CDNLAB.invalid
+ C: US
+ ST: Colorado
+ L: Denver
+ O: Molecule Testing
+ OU: CDN
+ emailAddress: ops@email.invalid
+ path: "{{ lab_ca_root_csr }}"
+ force: yes
+ when: regenerate_root is defined and (regenerate_root|bool == true) | default(false)
+
+ - name: Regenerate Lab Root CA Certificate
+ openssl_certificate:
+ csr_path: "{{ lab_ca_root_csr }}"
+ force: yes
+ issuer:
+ CN: CDNLAB.invalid
+ C: US
+ ST: Colorado
+ L: Denver
+ O: Molecule Testing
+ OU: CDN
+ path: "{{ lab_ca_root_crt }}"
+ privatekey_path: "{{ lab_ca_root_key }}"
+ provider: selfsigned
+ when: regenerate_root is defined and (regenerate_root|bool == true) | default(false)
+
+ - name: Generate Intermediate Signing CA Private keys
+ openssl_privatekey:
+ path: "{{ lab_ca_int_key }}"
+ force: yes
+ when: (regenerate_intermediate is defined and (regenerate_intermediate|bool == true)) or (regenerate_root is defined and (regenerate_root|bool == true)) | default(false)
+
+ - name: Generate Intermediate Signing CA CSRs
+ openssl_csr:
+ privatekey_path: "{{ lab_ca_int_key }}"
+ subject:
+ CN: "Lab Intermediate CA"
+ C: US
+ ST: Colorado
+ L: Denver
+ O: Molecule Testing
+ OU: CDN
+ emailAddress: ops@email.invalid
+ key_usage:
+ - digitalSignature
+ - keyCertSign
+ basic_constraints:
+ - CA:TRUE
+ - pathlen:0
+ path: "{{ lab_ca_int_csr }}"
+ force: yes
+ when: (regenerate_intermediate is defined and (regenerate_intermediate|bool == true)) or (regenerate_root is defined and (regenerate_root|bool == true)) | default(false)
+
+ - name: Generate Intermediate Signing CA Certificates
+ openssl_certificate:
+ csr_path: "{{ lab_ca_int_csr }}"
+ force: yes
+ issuer:
+ CN: CDNLAB.invalid
+ C: US
+ ST: Colorado
+ L: Denver
+ O: Molecule Testing
+ OU: CDN
+ path: "{{ lab_ca_int_crt }}"
+ privatekey_path: "{{ lab_ca_int_key }}"
+ provider: ownca
+ ownca_path: "{{ lab_ca_root_crt }}"
+ ownca_privatekey_path: "{{ lab_ca_root_key }}"
+ when: (regenerate_intermediate is defined and (regenerate_intermediate|bool == true)) or (regenerate_root is defined and (regenerate_root|bool == true)) | default(false)
diff --git a/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml b/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml
index 6a5aa80..0345379 100644
--- a/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml
+++ b/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml
@@ -28,19 +28,19 @@
- name: Current status of {{to_api_target_host}}
debug:
- msg: "{{ server_details.json.response.status }}"
+ msg: "{{ server_details.json.response[0].status }}"
verbosity: 1
delegate_to: localhost
- name: Show id of {{to_api_target_host}}
debug:
- msg: "{{ server_details.json.response.id }}"
+ msg: "{{ server_details.json.response[0].id }}"
verbosity: 2
delegate_to: localhost
- name: "{{ 'Set state of '+to_api_target_host+' to ' + to_api_desired_state }}"
uri:
- url: "{{ to_api_base_url }}/api/{{ to_api_version }}/servers/{{ server_details.json.response.id }}/status"
+ url: "{{ to_api_base_url }}/api/{{ to_api_version }}/servers/{{ server_details.json.response[0].id }}/status"
method: PUT
body_format: json
headers:
diff --git a/infrastructure/ansible/roles/traffic-router/defaults/main.yml b/infrastructure/ansible/roles/traffic-router/defaults/main.yml
index 0fa2313..8f8a9f7 100644
--- a/infrastructure/ansible/roles/traffic-router/defaults/main.yml
+++ b/infrastructure/ansible/roles/traffic-router/defaults/main.yml
@@ -182,3 +182,11 @@ tr_logging_opts:
- 1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
- 1catalina.org.apache.juli.AsyncFileHandler.rotatable = true
- 1catalina.org.apache.juli.AsyncFileHandler.maxDays = 30
+
+# TR cronjobs to deploy
+tr_crontab:
+ # Cleanup log files more than 2 days old.
+ access_cleanup:
+ schedule: '10 */4 * * *'
+ user: root
+ job: "/bin/find {{tr_log_dir}}/access.log.* -mmin +$((60*48)) -exec rm -f {} \\; > /dev/null 2>&1"
diff --git a/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml b/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml
index aba0904..865a562 100644
--- a/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml
+++ b/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml
@@ -18,7 +18,9 @@
- name: Remove Tomcat 6
import_tasks: purge.tomcat.6.yml
- when: tr_old_version.stdout is version('2.3', "<")
+ when:
+ - tr_old_version.stdout | length > 0
+ - tr_old_version.stdout is version('2.3', "<")
- name: Protect against expired yum repo metadata
shell: yum clean expire-cache
@@ -73,6 +75,14 @@
- traffic_ops.properties
- server.xml
+- name: Deploy Access Cleanup Crontab
+ template:
+ src: crontab.j2
+ dest: /etc/cron.d/access_cleanup
+ owner: root
+ group: root
+ mode: u+rw
+
- name: Copy traffic router systemd unit file
template:
src: traffic_router.service.j2
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml b/infrastructure/ansible/roles/traffic-router/templates/crontab.j2
similarity index 71%
copy from infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml
copy to infrastructure/ansible/roles/traffic-router/templates/crontab.j2
index febaa05..ab1ecf0 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml
+++ b/infrastructure/ansible/roles/traffic-router/templates/crontab.j2
@@ -1,5 +1,4 @@
----
-#
+{#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -11,9 +10,14 @@
# 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.
-#
-- import_tasks: "{{ role_path }}/tasks/traffic_opsdb.yml"
- when: install_traffic_opsdb
+#}
+# File deployed via ansible push
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+SHELL=/bin/bash
+MAILTO='root'
+HOME=/
-- import_tasks: "{{ role_path }}/tasks/initialize_traffic_opsdb.yml"
- when: initialize_traffic_opsdb
+{% for key, value in tr_crontab.items() %}
+{{ value.schedule }} {{ value.user }} {{ value.job }}
+{% endfor %}
diff --git a/infrastructure/ansible/roles/traffic-vault/defaults/main.yml b/infrastructure/ansible/roles/traffic-vault/defaults/main.yml
index 8bf1b43..c35f41d 100644
--- a/infrastructure/ansible/roles/traffic-vault/defaults/main.yml
+++ b/infrastructure/ansible/roles/traffic-vault/defaults/main.yml
@@ -111,3 +111,5 @@ riak_search_queue_high_watermark_purge_strategy: purge_one
riak_cluster_job_yokozuna_query: enabled
riak_tls_protocols_tlsv1: 'off'
riak_tls_protocols_tlsv1_1: 'on'
+riak_erlang_distribution_port_range_minimum: 0
+riak_erlang_distribution_port_range_maximum: 0
diff --git a/infrastructure/ansible/roles/traffic-vault/templates/riak.conf.j2 b/infrastructure/ansible/roles/traffic-vault/templates/riak.conf.j2
index 62b4934..b122f98 100644
--- a/infrastructure/ansible/roles/traffic-vault/templates/riak.conf.j2
+++ b/infrastructure/ansible/roles/traffic-vault/templates/riak.conf.j2
@@ -727,3 +727,8 @@ cluster.job.yokozuna.query = {{ riak_cluster_job_yokozuna_query }}
tls_protocols.tlsv1 = {{ riak_tls_protocols_tlsv1 }}
tls_protocols.tlsv1.1 = {{ riak_tls_protocols_tlsv1_1 }}
+
+{% if riak_erlang_distribution_port_range_minimum | int > 0 and riak_erlang_distribution_port_range_maximum | int > 0 %}
+erlang.distribution.port_range.minimum = {{ riak_erlang_distribution_port_range_minimum }}
+erlang.distribution.port_range.maximum = {{ riak_erlang_distribution_port_range_maximum }}
+{% endif %}
diff --git a/infrastructure/ansible/roles/traffic_ops/defaults/main.yml b/infrastructure/ansible/roles/traffic_ops/defaults/main.yml
index 111f1b5..15d467d 100644
--- a/infrastructure/ansible/roles/traffic_ops/defaults/main.yml
+++ b/infrastructure/ansible/roles/traffic_ops/defaults/main.yml
@@ -112,6 +112,12 @@ to_go_supported_ds_metrics:
to_plugin_config: {}
+to_le_user_email: user@example.test
+to_le_send_expiration_email: false
+to_le_convert_self_signed: false
+to_le_renew_days_before_expiration: 30
+to_le_environment: production
+
to_traffic_vault_backend: "postgres"
to_smtp_enabled: false
@@ -177,7 +183,7 @@ to_pi_openssl_common_name: "{{ ansible_hostname }}"
to_pi_openssl_rsa_passphrase:
# --- postinstall profiles.json
-to_pi_cdn_name: MKGA
+to_pi_cdn_name: "{{ hostvars[groups['traffic_router'] | first].cdn | default('mkga') | lower }}"
to_pi_health_polling_interval: "8000"
to_pi_dns_subdomain: "{{ to_pi_cdn_name }}.{{ ansible_domain }}"
to_pi_soa_admin: "traffic_ops"
diff --git a/infrastructure/ansible/roles/traffic_ops/tasks/traffic_ops.yml b/infrastructure/ansible/roles/traffic_ops/tasks/traffic_ops.yml
index bd6d64d..afbeb27 100644
--- a/infrastructure/ansible/roles/traffic_ops/tasks/traffic_ops.yml
+++ b/infrastructure/ansible/roles/traffic_ops/tasks/traffic_ops.yml
@@ -63,7 +63,7 @@
no_log: true
- name: Run Traffic Ops Postinstall
- command: "{{ to_install_bin_installdir }}/postinstall -a -cfile {{ to_install_bin_installdir }}/configuration_file.json"
+ shell: "{{ to_install_bin_installdir }}/postinstall -a -cfile {{ to_install_bin_installdir }}/configuration_file.json 2>&1"
notify: Restart Traffic Ops
environment:
GOPATH: /opt/traffic_ops/go
@@ -71,7 +71,9 @@
failed_when:
(Postinstall_output.stdout.find("Success! Postinstall complete.") == -1) or
(Postinstall_output.rc != 0) or
- (Postinstall_output.stderr.find("Installing modules failed") != -1)
+ (Postinstall_output.stderr.find("Installing modules failed") != -1) or
+ (Postinstall_output.stdout.find("Installing modules failed") != -1) or
+ (Postinstall_output.stdout.find("Database migrate failed") != -1)
- name: Mark Postinstall was successful
file:
@@ -143,7 +145,11 @@
environment:
PATH: "{{ lookup('env', 'PATH') }}:{{ to_base_installdir }}/go/bin"
GOPATH: /opt/traffic_ops/go
+ failed_when:
+ (db_migrations_output.stdout.find("Can't run goose") != -1) or
+ (db_migrations_output.rc != 0)
run_once: true
+ register: db_migrations_output
- name: Load Traffic Vault DB schema
command: ./db/admin --trafficvault -env=production load_schema
@@ -165,41 +171,66 @@
- name: Initialize Riak SOLR
block:
- - name: Add search schema
- uri:
- url: "{{ to_riak_uri }}/search/schema/sslkeys"
- force_basic_auth: yes
- user: "{{ to_riak_admin_username }}"
- password: "{{ to_riak_admin_username_password }}"
- method: PUT
- remote_src: yes
- src: /opt/traffic_ops/app/conf/misc/riak_search/sslkeys.xml
- headers:
- Content-Type: application/xml
- status_code: 200,204
-
- - name: Add search index
- uri:
- url: "{{ to_riak_uri }}/search/index/sslkeys"
- force_basic_auth: yes
- user: "{{ to_riak_admin_username }}"
- password: "{{ to_riak_admin_username_password }}"
- method: PUT
- body_format: json
- body:
+ # Riak has problems communicating with modern web security and doesn't properly negotiate TLS protocols and ciphers
+ # https://github.com/basho/riak/issues/918 maybe addressed part of the issue, but it was after the last published 2.2.3 release artifact for riak kv
+ - name: Add search schema - workaround for disabling tls 1.2 for riak
+ command:
+ argv: "{{ curl_base_args + command_args }}"
+ become: yes
+ no_log: true
+ vars:
+ riak_schema_file: /opt/traffic_ops/app/conf/misc/riak_search/sslkeys.xml
+ command_args:
+ - -H
+ - 'Content-Type: application/xml'
+ - -T
+ - "{{ riak_schema_file }}"
+ - "{{ to_riak_uri }}/search/schema/sslkeys"
+
+
+ - name: Add search index - workaround for disabling tls 1.2 for riak
+ command:
+ argv: "{{ curl_base_args + command_args }}"
+ become: yes
+ no_log: true
+ vars:
+ payload:
schema: sslkeys
- status_code: 200,204
-
- - name: Associate search index to bucket
- uri:
- url: "{{ to_riak_uri }}/buckets/ssl/props"
- force_basic_auth: yes
- user: "{{ to_riak_admin_username }}"
- password: "{{ to_riak_admin_username_password }}"
- method: PUT
- body_format: json
- body:
+ command_args:
+ - -H
+ - 'Content-Type: application/json'
+ - -X
+ - PUT
+ - -d
+ - "{{ payload | to_json }}"
+ - "{{ to_riak_uri }}/search/index/sslkeys"
+
+ - name: Associate search index to bucket - workaround for disabling tls 1.2 for riak
+ command:
+ argv: "{{ curl_base_args + command_args }}"
+ become: yes
+ no_log: true
+ vars:
+ payload:
props:
search_index: sslkeys
- status_code: 200,204
+ command_args:
+ - -H
+ - 'Content-Type: application/json'
+ - -X
+ - PUT
+ - -d
+ - "{{ payload | to_json }}"
+ - "{{ to_riak_uri }}/buckets/ssl/props"
run_once: true
+ vars:
+ curl_base_args:
+ - curl
+ - --fail
+ - --tlsv1.1
+ - --tlsv1.0
+ - --insecure
+ - --basic
+ - --user
+ - "{{ to_riak_admin_username }}:{{ to_riak_admin_username_password }}"
+ - -s
diff --git a/infrastructure/ansible/roles/traffic_ops/templates/cdn.conf.j2 b/infrastructure/ansible/roles/traffic_ops/templates/cdn.conf.j2
index f7d91b6..40f1609 100644
--- a/infrastructure/ansible/roles/traffic_ops/templates/cdn.conf.j2
+++ b/infrastructure/ansible/roles/traffic_ops/templates/cdn.conf.j2
@@ -89,5 +89,12 @@
"MaxTLSVersion": "{{ to_riak_tls_max_version }}"
{% endif %}
}
+ },
+ "lets_encrypt": {
+ "user_email": "{{ to_le_user_email }}",
+ "send_expiration_email": {{ to_le_send_expiration_email | bool | lower }},
+ "convert_self_signed": {{ to_le_convert_self_signed | bool | lower }},
+ "renew_days_before_expiration": {{ to_le_renew_days_before_expiration | int }},
+ "environment": "{{ to_le_environment }}"
}
}
diff --git a/infrastructure/ansible/roles/traffic_opsdb/README.md b/infrastructure/ansible/roles/traffic_opsdb/README.md
index e7f5634..3b3041d 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/README.md
+++ b/infrastructure/ansible/roles/traffic_opsdb/README.md
@@ -49,11 +49,7 @@ Example Playbook
tasks:
- name: Load environment specific vars
include_vars:
- file: "{{ lookup('env', 'PWD') }}/ansible/vars.yml"
-
- - name: Load environment specific vault
- include_vars:
- file: "{{ lookup('env', 'PWD') }}/ansible/vault"
+ file: "{{ lookup('env', 'PWD') }}/ansible/vars.json"
no_log: true
- name: Deploy Traffic_opsdb
@@ -69,11 +65,7 @@ Example Playbook
tasks:
- name: Load environment specific vars
include_vars:
- file: "{{ lookup('env', 'PWD') }}/ansible/vars.yml"
-
- - name: Load environment specific vault
- include_vars:
- file: "{{ lookup('env', 'PWD') }}/ansible/vault"
+ file: "{{ lookup('env', 'PWD') }}/ansible/vars.json"
no_log: true
- name: Initialize Traffic_opsdb
diff --git a/infrastructure/ansible/roles/traffic_opsdb/defaults/main.yml b/infrastructure/ansible/roles/traffic_opsdb/defaults/main.yml
index 57c4955..402b76c 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/defaults/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/defaults/main.yml
@@ -14,10 +14,18 @@
#
install_traffic_opsdb: false
initialize_traffic_opsdb: false
+enable_traffic_opsdb_standby: false
+enable_traffic_opsdb_replica: false
-postgresql_server_pkg_name: "{% if pg_major_version | int < 10 %}postgresql{{pg_major_version}}{{pg_minor_version}}-server-{{pg_major_version}}.{{pg_minor_version}}.{{pg_build_num}}{% elif pg_major_version | int >= 10 %}postgresql{{pg_major_version}}-server-{{pg_major_version}}.{{pg_minor_version}}{% endif %}"
-postgresql_client_pkg_name: "{% if pg_major_version | int < 10 %}postgresql{{pg_major_version}}{{pg_minor_version}}-{{pg_major_version}}.{{pg_minor_version}}.{{pg_build_num}}{% else %}postgresql{{pg_major_version}}-{{pg_major_version}}.{{pg_minor_version}}{% endif %}"
-postgresql_devel_pkg_name: "{% if pg_major_version | int < 10 %}postgresql{{pg_major_version}}{{pg_minor_version}}-devel-{{pg_major_version}}.{{pg_minor_version}}.{{pg_build_num}}{% else %}postgresql{{pg_major_version}}-devel-{{pg_major_version}}.{{pg_minor_version}}{% endif %}"
+postgresql_server_pkg_name: >-
+ {%- if pg_major_version | int < 10 -%}postgresql{{pg_major_version}}{{pg_minor_version}}-server-{{pg_major_version}}.{{pg_minor_version}}.{{pg_build_num}}
+ {%- elif pg_major_version | int >= 10 -%}postgresql{{pg_major_version}}-server-{{pg_major_version}}.{{pg_minor_version}}{%- endif -%}
+postgresql_client_pkg_name: >-
+ {%- if pg_major_version | int < 10 -%}postgresql{{pg_major_version}}{{pg_minor_version}}-{{pg_major_version}}.{{pg_minor_version}}.{{pg_build_num}}
+ {%- else %}postgresql{{pg_major_version}}-{{pg_major_version}}.{{pg_minor_version}}{%- endif -%}
+postgresql_devel_pkg_name: >-
+ {%- if pg_major_version | int < 10 -%}postgresql{{pg_major_version}}{{pg_minor_version}}-devel-{{pg_major_version}}.{{pg_minor_version}}.{{pg_build_num}}
+ {%- else %}postgresql{{pg_major_version}}-devel-{{pg_major_version}}.{{pg_minor_version}}{%- endif -%}
# Local OS User to use for Postgres Processes
postgresql_user: postgres
@@ -27,7 +35,8 @@ postgresql_group: postgres
postgresql_port: 5432
# Postgres PGDATA directory
-postgresql_datadir: "{% if pg_major_version | int < 10 %}/var/lib/pgsql/{{pg_major_version}}.{{pg_minor_version}}/data{%else%}/var/lib/pgsql/{{pg_major_version}}/data{%endif%}"
+postgresql_datadir: >-
+ {%- if pg_major_version | int < 10 %}/var/lib/pgsql/{{pg_major_version}}.{{pg_minor_version}}/data{%else%}/var/lib/pgsql/{{pg_major_version}}/data{%-endif-%}
# SSL CA root cert to use with SSL Connections
postgresql_certs_ca: "{{ postgresql_datadir }}/lab.rootca.crt"
@@ -39,6 +48,10 @@ postgresql_max_connections: 700
postgresql_admin_user:
postgresql_admin_user_password:
+# Postgres database replication credentials
+postgresql_replica_user:
+postgresql_replica_user_password:
+
# TODB database credentials
todb_username:
todb_password:
diff --git a/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml b/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml
index 36d310d..94de3f0 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml
@@ -16,7 +16,7 @@
systemd:
name: "{{ pg_service_name }}"
state: restarted
- daemon_reload: yes
+ daemon_reload: true
notify: Wait for TODB to become available
- name: Wait for TODB to become available
diff --git a/infrastructure/ansible/roles/traffic_opsdb/meta/main.yml b/infrastructure/ansible/roles/traffic_opsdb/meta/main.yml
index dbdedb6..e57ed55 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/meta/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/meta/main.yml
@@ -1,3 +1,4 @@
+---
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,21 +13,23 @@
# limitations under the License.
#
galaxy_info:
- author: Jonathan Gray
+ role_name: traffic_opsdb
+ author: trafficcontrol
description: A role to assist with deploying the traffic ops database component of Apache Traffic Control on Postgres
company: Apache Traffic Control
issue_tracker_url: https://github.com/apache/trafficcontrol/issues
license: Apache 2.0
min_ansible_version: 2.8
platforms:
- - name: CentOS
- versions:
- - 7
+ - name: CentOS
+ versions:
+ - 7
+ - 8
galaxy_tags:
- - trafficopsdb
- - todb
- - cdn
- - trafficcontrol
- - apache
- - atc
+ - trafficopsdb
+ - todb
+ - cdn
+ - trafficcontrol
+ - apache
+ - atc
dependencies: []
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/default/converge.yml
similarity index 90%
copy from infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
copy to infrastructure/ansible/roles/traffic_opsdb/molecule/default/converge.yml
index 9875dce..ba2151b 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/default/converge.yml
@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- import_tasks: fakeOrigin.yml
- when: install_fakeOrigin
+- import_playbook: ../driver.yml
diff --git a/infrastructure/ansible/roles/traffic_opsdb/molecule/default/molecule.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/default/molecule.yml
new file mode 100644
index 0000000..23195cc
--- /dev/null
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/default/molecule.yml
@@ -0,0 +1,75 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+driver:
+ name: docker
+lint: |
+ set -e
+ yamllint -c ../molecule_shared/.yamllint .
+ ansible-lint -c ../molecule_shared/.ansible-lint .
+dependency:
+ name: shell
+ command: ansible-playbook -vvv -i localhost ${MOLECULE_VERBOSITY} ../molecule_shared/dependency.yml
+platforms:
+ - name: todb.testlab.invalid
+ image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ privileged: true
+ pre_build_image: true
+ tmpfs:
+ - /run
+ - /tmp
+ groups:
+ - docker_hosts
+ - traffic_opsdb
+ - traffic_opsdb-primary
+ capabilities:
+ - SYS_ADMIN
+ port_bindings:
+ 5432: 5432
+ networks:
+ - name: molecule_todb_default
+ volumes:
+ - ${MOLECULE_EPHEMERAL_DIRECTORY}:/molecule
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ docker_networks:
+ - name: molecule_todb_default
+ enable_ipv6: true
+ force: true
+ driver: bridge
+ ipam_driver: default
+ ipam_config:
+ - subnet: 172.16.240.0/24
+ - subnet: "fc01:9400:1000:9::/64"
+
+provisioner:
+ name: ansible
+ playbooks:
+ prepare: "../../../molecule_shared/prepare.yml"
+ log: True
+ config_options:
+ defaults:
+ verbosity: 3
+ inventory:
+ group_vars:
+ docker-hosts:
+ docker_storage_driver: vfs
+ host_vars:
+ todb.testlab.invalid:
+ cdn: ALL
+ component: traffic_opsdb
+ ansible_host: todb.testlab.invalid
+
+verifier:
+ name: ansible
diff --git a/infrastructure/ansible/roles/traffic_opsdb/molecule/default/verify.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/default/verify.yml
new file mode 100644
index 0000000..51e2951
--- /dev/null
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/default/verify.yml
@@ -0,0 +1,49 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- name: Verify TODB setup
+ hosts: all
+ gather_facts: yes
+ become: yes
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ vars:
+ postgresql_replica_user: to_replication
+ postgresql_admin_user: postgres
+ # postgresql_admin_user_password: from secret file
+ todb_username: trafficops
+ # todb_password: from secret file
+ tvdb_username: trafficvault
+ # tvdb_password: from secret file
+ todb_db_name: traffic_ops
+ tvdb_db_name: traffic_vault
+
+ tasks:
+ - name: Ensure you can connect to the databases
+ postgresql_query:
+ login_host: "127.0.0.1"
+ db: "{{ item }}"
+ login_user: "{{ postgresql_admin_user }}"
+ login_password: "{{ postgresql_admin_user_password }}"
+ query: select 1
+ no_log: true
+ with_items:
+ - "{{ todb_db_name }}"
+ - "{{ tvdb_db_name }}"
+
+ - name: Check if the postgres binaries are on the system path
+ command: bash -c 'source /etc/profile && which pg_ctl'
+ changed_when: false
diff --git a/infrastructure/ansible/roles/traffic_opsdb/molecule/driver.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/driver.yml
new file mode 100644
index 0000000..77f39e6
--- /dev/null
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/driver.yml
@@ -0,0 +1,154 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- name: Base TODB setup
+ hosts: all
+ gather_facts: yes
+ become: yes
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ vars:
+ postgresql_replica_user: to_replication
+ postgresql_admin_user: postgres
+ # postgresql_admin_user_password: from secret file
+ todb_username: trafficops
+ # todb_password: from secret file
+ tvdb_username: trafficvault
+ # tvdb_password: from secret file
+
+ tasks:
+ - name: Install Postgres Yum Repo - Stable
+ yum_repository:
+ name: "pgdg{{ item | replace('.','') }}"
+ description: "Manually added repository for Stable Postgresql - {{ item }}"
+ baseurl: "https://download.postgresql.org/pub/repos/yum/{{ item }}/redhat/rhel-$releasever-$basearch"
+ gpgcheck: yes
+ gpgkey: https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG
+ file: pgdg
+ reposdir: /etc/yum.repos.d
+ with_items:
+ - "13"
+ - "12"
+ - "11"
+ - "10"
+ - "9.6"
+ - "9.5"
+
+ - name: Install Postgres Yum Repo - Testing
+ yum_repository:
+ name: "pgdg{{ item | replace('.','') }}-updates-testing"
+ description: "Manually added repository for Testing Postgresql - {{ item }}"
+ baseurl: "https://download.postgresql.org/pub/repos/yum/testing/{{ item }}/redhat/rhel-$releasever-$basearch"
+ enabled: "{{ (enable_postgres_testing_repos | default(false)) | ternary('yes','no') }}"
+ gpgcheck: yes
+ gpgkey: https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG
+ file: pgdg
+ reposdir: /etc/yum.repos.d
+ with_items:
+ - "13"
+ - "12"
+ - "11"
+ - "10"
+ - "9.6"
+ - "9.5"
+
+ - name: Disable the builtin Centos8 Appstream rpms
+ command: dnf -qy module disable postgresql
+ when: ansible_distribution_file_variety == "RedHat" and ansible_distribution_major_version == "8"
+
+ - name: Create Postgres group
+ group:
+ name: "postgres"
+ gid: "1234"
+
+ - name: Create Postgres user
+ user:
+ name: "postgres"
+ shell: /bin/bash
+ group: "1234"
+ uid: "1234"
+
+ - name: Deploy Traffic_opsdb
+ import_role:
+ name: traffic_opsdb
+ vars:
+ install_traffic_opsdb: true
+
+- name: Deploy primary TODB
+ hosts: traffic_opsdb-primary
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ vars:
+ postgresql_replica_user: to_replication
+ postgresql_admin_user: postgres
+ # postgresql_admin_user_password: from secret file
+ todb_username: trafficops
+ # todb_password: from secret file
+ tvdb_username: trafficvault
+ # tvdb_password: from secret file
+
+ tasks:
+ - name: Initialize Traffic_opsdb
+ import_role:
+ name: traffic_opsdb
+ vars:
+ initialize_traffic_opsdb: true
+
+- name: Deploy standby TODB
+ hosts: traffic_opsdb-standby
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ vars:
+ postgresql_replica_user: to_replication
+ postgresql_admin_user: postgres
+ # postgresql_admin_user_password: from secret file
+ todb_username: trafficops
+ # todb_password: from secret file
+ tvdb_username: trafficvault
+ # tvdb_password: from secret file
+
+ tasks:
+ - name: Deploy Traffic_opsdb
+ import_role:
+ name: traffic_opsdb
+ vars:
+ enable_traffic_opsdb_standby: true
+
+- name: Deploy replica TODBs
+ hosts: traffic_opsdb-replicas
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ vars:
+ postgresql_replica_user: to_replication
+ postgresql_admin_user: postgres
+ # postgresql_admin_user_password: from secret file
+ todb_username: trafficops
+ # todb_password: from secret file
+ tvdb_username: trafficvault
+ # tvdb_password: from secret file
+
+ tasks:
+ - name: Deploy Traffic_opsdb
+ import_role:
+ name: traffic_opsdb
+ vars:
+ enable_traffic_opsdb_replica: true
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/scenario.requirement.vars.yml
similarity index 83%
copy from infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
copy to infrastructure/ansible/roles/traffic_opsdb/molecule/scenario.requirement.vars.yml
index 9875dce..2ac25b9 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/scenario.requirement.vars.yml
@@ -12,5 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- import_tasks: fakeOrigin.yml
- when: install_fakeOrigin
+
+# This should be a list of dictionaries with the following keys: rpm_prefix, pkg_script_name
+required_rpms: []
diff --git a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/converge.yml
similarity index 90%
copy from infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
copy to infrastructure/ansible/roles/traffic_opsdb/molecule/triad/converge.yml
index 9875dce..ba2151b 100644
--- a/infrastructure/ansible/roles/fakeOrigin/tasks/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/converge.yml
@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-- import_tasks: fakeOrigin.yml
- when: install_fakeOrigin
+- import_playbook: ../driver.yml
diff --git a/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/molecule.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/molecule.yml
new file mode 100644
index 0000000..707b928
--- /dev/null
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/molecule.yml
@@ -0,0 +1,127 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+driver:
+ name: docker
+lint: |
+ set -e
+ yamllint -c ../molecule_shared/.yamllint .
+ ansible-lint -c ../molecule_shared/.ansible-lint .
+
+dependency:
+ name: shell
+ command: ansible-playbook -i localhost ${MOLECULE_VERBOSITY} ../molecule_shared/dependency.yml
+
+platforms:
+ - name: todb-1.testlab.invalid
+ image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ privileged: true
+ pre_build_image: true
+ tmpfs:
+ - /run
+ - /tmp
+ groups:
+ - docker_hosts
+ - traffic_opsdb
+ - traffic_opsdb-primary
+ capabilities:
+ - SYS_ADMIN
+ exposed_ports:
+ - 5432
+ networks:
+ - name: molecule_todb_triad
+ volumes:
+ - ${MOLECULE_EPHEMERAL_DIRECTORY}:/molecule
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ docker_networks:
+ - name: molecule_todb_triad
+ enable_ipv6: true
+ force: true
+ driver: bridge
+ ipam_driver: default
+ ipam_config:
+ - subnet: 172.16.240.0/24
+ - subnet: "fc01:9400:1000:9::/64"
+ - name: todb-2.testlab.invalid
+ image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ privileged: true
+ pre_build_image: true
+ tmpfs:
+ - /run
+ - /tmp
+ groups:
+ - docker_hosts
+ - traffic_opsdb
+ - traffic_opsdb-standby
+ capabilities:
+ - SYS_ADMIN
+ exposed_ports:
+ - 5432
+ networks:
+ - name: molecule_todb_triad
+ volumes:
+ - ${MOLECULE_EPHEMERAL_DIRECTORY}:/molecule
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ - name: todb-3.testlab.invalid
+ image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ privileged: true
+ pre_build_image: true
+ tmpfs:
+ - /run
+ - /tmp
+ groups:
+ - docker_hosts
+ - traffic_opsdb
+ - traffic_opsdb-replicas
+ capabilities:
+ - SYS_ADMIN
+ exposed_ports:
+ - 5432
+ networks:
+ - name: molecule_todb_triad
+ volumes:
+ - ${MOLECULE_EPHEMERAL_DIRECTORY}:/molecule
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+
+provisioner:
+ name: ansible
+ playbooks:
+ prepare: "../../../molecule_shared/prepare.yml"
+ log: true
+ config_options:
+ defaults:
+ verbosity: 3
+ inventory:
+ group_vars:
+ docker-hosts:
+ docker_storage_driver: vfs
+ host_vars:
+ todb-1.testlab.invalid:
+ cdn: ALL
+ component: traffic_opsdb
+ ansible_host: todb-1.testlab.invalid
+ todb-2.testlab.invalid:
+ cdn: ALL
+ component: traffic_opsdb
+ ansible_host: todb-2.testlab.invalid
+ todb-3.testlab.invalid:
+ cdn: ALL
+ component: traffic_opsdb
+ ansible_host: todb-3.testlab.invalid
+
+verifier:
+ name: ansible
diff --git a/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/verify.yml b/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/verify.yml
new file mode 100644
index 0000000..33b96b4
--- /dev/null
+++ b/infrastructure/ansible/roles/traffic_opsdb/molecule/triad/verify.yml
@@ -0,0 +1,102 @@
+---
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- name: Verify TODB setup
+ hosts: all
+ gather_facts: yes
+
+ vars_files:
+ - "{{ molecule_ephemeral_directory }}/secret_varfile.json"
+
+ vars:
+ postgresql_replica_user: to_replication
+ postgresql_admin_user: postgres
+ # postgresql_admin_user_password: from secret file
+ todb_username: trafficops
+ # todb_password: from secret file
+ tvdb_username: trafficvault
+ # tvdb_password: from secret file
+ todb_db_name: traffic_ops
+ tvdb_db_name: traffic_vault
+
+ tasks:
+ - name: Ensure you can connect to the databases
+ postgresql_query:
+ login_host: "127.0.0.1"
+ db: "{{ item }}"
+ login_user: "{{ postgresql_admin_user }}"
+ login_password: "{{ postgresql_admin_user_password }}"
+ query: select 1
+ no_log: true
+ with_items:
+ - "{{ todb_db_name }}"
+ - "{{ tvdb_db_name }}"
+
+ - name: Grab a copy of replication receivers
+ postgresql_query:
+ login_host: "127.0.0.1"
+ db: "postgres"
+ login_user: "{{ postgresql_admin_user }}"
+ login_password: "{{ postgresql_admin_user_password }}"
+ query: select conninfo, status from pg_stat_wal_receiver;
+ register: replication_raw
+ no_log: true
+
+ - name: Check if the postgres binaries are on the system path
+ command: bash -c 'source /etc/profile && which pg_ctl'
+ changed_when: false
+
+- name: Check replication
+ hosts: localhost
+ connection: local
+ gather_facts: false
+
+ vars:
+ postgresql_replica_user: to_replication
+
+ tasks:
+ - name: Parse query results
+ set_fact:
+ repl_parents: "{{ (repl_parents| default({})) | combine({item: payload}) }}"
+ with_items: "{{ groups['traffic_opsdb-standby'] + groups['traffic_opsdb-replicas'] }}"
+ vars:
+ payload:
+ status: "{{ hostvars[item].replication_raw.query_result[0].status }}"
+ conninfo: "{{ dict(_keys|zip(_vals)) }}"
+ _arr: "{{ hostvars[item].replication_raw.query_result[0].conninfo.split(' ') | map('trim') | select() | list }}"
+ _keys: "{{ _arr|map('regex_replace', '^(.*?)=(.*)$','\\1')|map('trim')|list }}"
+ _vals: "{{ _arr|map('regex_replace', '^(.*?)=(.*)$','\\2')|map('trim')|list }}"
+
+ - name: Assert standby replication info
+ assert:
+ that:
+ - groups['traffic_opsdb-primary'] | length == 1
+ - groups['traffic_opsdb-standby'] | length == 1
+ - repl_parents[stdby_host].status == 'streaming'
+ - repl_parents[stdby_host].conninfo.host == primary_host
+ - repl_parents[stdby_host].conninfo.user == postgresql_replica_user
+ vars:
+ stdby_host: "{{ groups['traffic_opsdb-standby'] | first }}"
+ primary_host: "{{ groups['traffic_opsdb-primary'] | first }}"
+
+ - name: Assert replica replication info
+ assert:
+ that:
+ - groups['traffic_opsdb-standby'] | length == 1
+ - repl_parents[item].status == 'streaming'
+ - repl_parents[item].conninfo.host == stdby_host
+ - repl_parents[item].conninfo.user == postgresql_replica_user
+ with_items: "{{ groups['traffic_opsdb-replicas'] }}"
+ vars:
+ stdby_host: "{{ groups['traffic_opsdb-standby'] | first }}"
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml b/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml
index a9003fe..c17a03f 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml
@@ -1,3 +1,4 @@
+---
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,7 +14,7 @@
#
- name: Create Postgres Admin Database User
postgresql_user:
- encrypted: yes
+ encrypted: true
name: "{{ postgresql_admin_user }}"
password: "{{ postgresql_admin_user_password }}"
port: "{{ postgresql_port }}"
@@ -25,7 +26,7 @@
- name: Create Traffic Ops Database User
postgresql_user:
- encrypted: yes
+ encrypted: true
name: "{{ todb_username }}"
password: "{{ todb_password }}"
port: "{{ postgresql_port }}"
@@ -33,10 +34,11 @@
role_attr_flags: SUPERUSER,LOGIN,CREATEDB
ssl_rootcert: "{{ postgresql_certs_ca }}"
no_log: true
+ notify: Restart Traffic OpsDB
- name: Create Traffic Vault Database User
postgresql_user:
- encrypted: yes
+ encrypted: true
name: "{{ tvdb_username }}"
password: "{{ tvdb_password }}"
port: "{{ postgresql_port }}"
@@ -44,6 +46,7 @@
role_attr_flags: LOGIN
ssl_rootcert: "{{ postgresql_certs_ca }}"
no_log: true
+ notify: Restart Traffic OpsDB
- name: Create Traffic Ops Database
postgresql_db:
@@ -51,6 +54,7 @@
name: "{{ todb_db_name }}"
owner: "{{ todb_username }}"
port: "{{ postgresql_port }}"
+ notify: Restart Traffic OpsDB
- name: Create Traffic Vault Database
postgresql_db:
@@ -58,3 +62,4 @@
name: "{{ tvdb_db_name }}"
owner: "{{ tvdb_username }}"
port: "{{ postgresql_port }}"
+ notify: Restart Traffic OpsDB
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml b/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml
index febaa05..2f99398 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/main.yml
@@ -17,3 +17,9 @@
- import_tasks: "{{ role_path }}/tasks/initialize_traffic_opsdb.yml"
when: initialize_traffic_opsdb
+
+- import_tasks: "{{ role_path }}/tasks/standby_traffic_opsdb.yml"
+ when: enable_traffic_opsdb_standby
+
+- import_tasks: "{{ role_path }}/tasks/replicas_traffic_opsdb.yml"
+ when: enable_traffic_opsdb_replica
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/replicas_traffic_opsdb.yml b/infrastructure/ansible/roles/traffic_opsdb/tasks/replicas_traffic_opsdb.yml
new file mode 100644
index 0000000..63ebafc
--- /dev/null
+++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/replicas_traffic_opsdb.yml
@@ -0,0 +1,69 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- name: Clone base config to match primary database
+ block:
+ - name: Stop existing instance
+ systemd:
+ name: "{{ pg_service_name }}"
+ state: stopped
+
+ - name: Remove host-unique config
+ file:
+ path: "{{ postgresql_datadir }}"
+ state: absent
+
+ - name: Recreate the postgres data directory
+ file:
+ state: directory
+ path: "{{ postgresql_datadir }}"
+ owner: "{{ postgresql_user }}"
+ group: "{{ postgresql_group }}"
+ mode: 0700
+
+ - name: Clone configuration from primary
+ command:
+ argv:
+ - pg_basebackup
+ - -d
+ - "host={{ (groups['traffic_opsdb-primary'] | map('extract', hostvars, ['ansible_host']) | first) }} port={{ postgresql_port }} user={{ postgresql_replica_user }} password={{ postgresql_replica_user_password }}" # noqa line-length
+ - -D
+ - "{{ postgresql_datadir }}"
+ become: true
+ become_user: "{{ postgresql_user }}"
+ no_log: true
+
+- name: Setup Ternary PostgreSQL Replication
+ template:
+ src: "templates/{{ _loop_ittr }}.j2"
+ owner: "{{ postgresql_user }}"
+ group: "{{ postgresql_group }}"
+ mode: 0700
+ dest: "{{ postgresql_datadir }}/{{ _loop_ittr }}"
+ loop:
+ - recovery.conf
+ loop_control:
+ loop_var: _loop_ittr
+ vars:
+ postgresql_target_replication_parent: "{{ (groups['traffic_opsdb-standby'] | map('extract', hostvars, ['ansible_host']) | first) }}"
+
+- name: Startup Ternary instance
+ systemd:
+ name: "{{ pg_service_name }}"
+ state: started
+
+- name: Wait for TODB to become available
+ wait_for:
+ port: "{{ postgresql_port }}"
+ delay: 3
+ changed_when: false
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/standby_traffic_opsdb.yml b/infrastructure/ansible/roles/traffic_opsdb/tasks/standby_traffic_opsdb.yml
new file mode 100644
index 0000000..2b8e5a1
--- /dev/null
+++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/standby_traffic_opsdb.yml
@@ -0,0 +1,69 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- name: Clone base config to match primary database
+ block:
+ - name: Stop existing instance
+ systemd:
+ name: "{{ pg_service_name }}"
+ state: stopped
+
+ - name: Remove host-unique config
+ file:
+ path: "{{ postgresql_datadir }}"
+ state: absent
+
+ - name: Recreate the postgres data directory
+ file:
+ state: directory
+ path: "{{ postgresql_datadir }}"
+ owner: "{{ postgresql_user }}"
+ group: "{{ postgresql_group }}"
+ mode: 0700
+
+ - name: Clone configuration from primary
+ command:
+ argv:
+ - pg_basebackup
+ - -d
+ - "host={{ (groups['traffic_opsdb-primary'] | map('extract', hostvars, ['ansible_host']) | first) }} port={{ postgresql_port }} user={{ postgresql_replica_user }} password={{ postgresql_replica_user_password }}" # noqa line-length
+ - -D
+ - "{{ postgresql_datadir }}"
+ become: true
+ become_user: "{{ postgresql_user }}"
+ no_log: true
+
+- name: Setup Secondary PostgreSQL Replication
+ template:
+ src: "templates/{{ _loop_ittr }}.j2"
+ owner: "{{ postgresql_user }}"
+ group: "{{ postgresql_group }}"
+ mode: 0700
+ dest: "{{ postgresql_datadir }}/{{ _loop_ittr }}"
+ loop:
+ - recovery.conf
+ loop_control:
+ loop_var: _loop_ittr
+ vars:
+ postgresql_target_replication_parent: "{{ (groups['traffic_opsdb-primary'] | map('extract', hostvars, ['ansible_host']) | first) }}"
+
+- name: Startup Secondary instance
+ systemd:
+ name: "{{ pg_service_name }}"
+ state: started
+
+- name: Wait for TODB to become available
+ wait_for:
+ port: "{{ postgresql_port }}"
+ delay: 3
+ changed_when: false
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml b/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml
index 1cf2730..f27ba2e 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml
@@ -1,3 +1,4 @@
+---
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,24 +14,25 @@
#
- name: Check that valid postgresql version was passed
assert:
- that:
+ that:
- " valid_major_version == 'true' "
- " valid_minor_version == 'true' "
- " valid_build_version == 'true' "
- name: Install Postgres
- yum:
+ package:
name:
- "{{ postgresql_server_pkg_name }}"
- "{{ postgresql_client_pkg_name }}"
- "{{ postgresql_devel_pkg_name }}"
- gcc
- - python-devel
+ - "python{{ ansible_python.version.major }}-devel"
state: present
lock_timeout: 300
enablerepo: "{{ additional_yum_repos | default([]) }}"
retries: 5
delay: 5
+ notify: Restart Traffic OpsDB
- name: Ensure postgres data directory exists
file:
@@ -38,26 +40,29 @@
path: "{{ postgresql_datadir }}"
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
- mode: 0755
+ mode: 0700
+ notify: Restart Traffic OpsDB
- name: Initialize database
- shell: "{{ pgdb_init_command }}"
- become: yes
+ command: "{{ pgdb_init_command }}"
+ become: true
become_user: "{{ postgresql_user }}"
args:
creates: "{{ postgresql_datadir }}/pg_hba.conf"
+ notify: Restart Traffic OpsDB
- name: Update the systemd definition of PGDATA
ini_file:
- create: no
+ create: false
path: "{{ pg_service_path }}"
section: Service
option: Environment
value: "PGDATA={{ postgresql_datadir }}"
+ notify: Restart Traffic OpsDB
- name: Refresh Systemd
systemd:
- daemon_reload: yes
+ daemon_reload: true
- name: Add Postgres bin dir to system-wide $PATH.
copy:
@@ -66,7 +71,9 @@
- name: Install psycopg2 python module
pip:
- name: psycopg2
+ name:
+ - psycopg2
+ extra_args: "--ignore-installed"
environment:
PATH: "{{ pg_bin_path }}:{{ lookup('env', 'PATH') }}"
@@ -80,14 +87,17 @@
- name: Apply Postgresql Configs
template:
- src: "templates/{{ item }}.j2"
+ src: "templates/{{ _loop_ittr }}.j2"
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
- mode: 0775
- dest: "{{ postgresql_datadir }}/{{ item }}"
- with_items:
+ mode: 0700
+ dest: "{{ postgresql_datadir }}/{{ _loop_ittr }}"
+ loop:
- pg_hba.conf
- postgresql.conf
+ loop_control:
+ loop_var: _loop_ittr
+ notify: Restart Traffic OpsDB
- name: Copy in SSL certificate
copy:
@@ -96,7 +106,8 @@
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
mode: 0600
- remote_src: yes
+ remote_src: true
+ notify: Restart Traffic OpsDB
- name: Copy in SSL private key
copy:
@@ -105,7 +116,8 @@
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
mode: 0600
- remote_src: yes
+ remote_src: true
+ notify: Restart Traffic OpsDB
- name: Copy in SSL CA certificate
copy:
@@ -114,7 +126,8 @@
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
mode: 0600
- remote_src: yes
+ remote_src: true
+ notify: Restart Traffic OpsDB
- name: Update Log Directory Permissions
file:
@@ -123,17 +136,34 @@
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
mode: 0775
+ notify: Restart Traffic OpsDB
- name: Enable and start TODB
systemd:
- name: "{{ item }}"
- enabled: yes
+ name: "{{ _loop_ittr }}"
+ enabled: true
state: started
- with_items:
+ loop:
- "{{ pg_service_name }}"
+ loop_control:
+ loop_var: _loop_ittr
- name: Wait for TODB to Init Postgres and become available
wait_for:
port: "{{ postgresql_port }}"
delay: 3
-
\ No newline at end of file
+
+- name: Create Postgres Replication Database User
+ postgresql_user:
+ encrypted: true
+ name: "{{ postgresql_replica_user }}"
+ password: "{{ postgresql_replica_user_password }}"
+ port: "{{ postgresql_port }}"
+ login_host: 127.0.0.1
+ role_attr_flags: REPLICATION
+ ssl_rootcert: "{{ postgresql_certs_ca }}"
+ no_log: true
+ notify: Restart Traffic OpsDB
+ when:
+ - (postgresql_replica_user is defined) and postgresql_replica_user
+ - (postgresql_replica_user_password is defined) and postgresql_replica_user_password
diff --git a/infrastructure/ansible/roles/traffic_opsdb/templates/pg_hba.conf.j2 b/infrastructure/ansible/roles/traffic_opsdb/templates/pg_hba.conf.j2
index 5345f85..dacc788 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/templates/pg_hba.conf.j2
+++ b/infrastructure/ansible/roles/traffic_opsdb/templates/pg_hba.conf.j2
@@ -95,86 +95,209 @@
# Postgres user
# ------------------------------------------------------
host all {{ postgresql_user }} 127.0.0.1/32 trust
+ host all {{ postgresql_user }} ::1/128 trust
+{% if groups['traffic_ops'] is defined %}
# -- TO Instances for Postinstall
{% for host_obj in (groups['traffic_ops']) %}
- hostssl all {{ postgresql_user }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
- #host all {{ postgresql_user }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
-
+{% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl all {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+{%endif%}
+{% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl all {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+{%endif%}
+{% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ #host all {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+{%endif%}
+{% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ #host all {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+{%endif%}
{% endfor %}
+{% endif %}
# ------------------------------------------------------
# Postgres SUPERUSER
# ------------------------------------------------------
# -- Primary
- hostssl {{ todb_db_name }} {{ postgresql_user }} {{ (groups['traffic_opsdb-primary'] | map('extract', hostvars, ['ansible_host']) | first) }}/32 md5
- hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ (groups['traffic_opsdb-primary'] | map('extract', hostvars, ['ansible_host']) | first) }}/32 md5
+ {% if hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
+
+ {% if hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% if groups['traffic_opsdb-standby'] is defined %}
# -- Secondary
- hostssl {{ todb_db_name }} {{ postgresql_user }} {{ (groups['traffic_opsdb-standby'] | map('extract', hostvars, ['ansible_host']) | first) }}/32 md5
- hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ (groups['traffic_opsdb-standby'] | map('extract', hostvars, ['ansible_host']) | first) }}/32 md5
+ {% if hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
+
+ {% if hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endif %}
{% if groups['traffic_opsdb-replicas'] is defined %}
# -- Replicas
{% for host_obj in (groups['traffic_opsdb-replicas']) %}
- hostssl {{ todb_db_name }} {{ postgresql_user }} {{ (groups['traffic_opsdb-replicas'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
- hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ (groups['traffic_opsdb-replicas'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
+
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ postgresql_user }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endfor %}
{% endif %}
#-------------------------------------
# TRAFFIC OPS
# ------------------------------------------------------
+{% if groups['traffic_ops'] is defined %}
{% for host_obj in (groups['traffic_ops']) %}
- hostssl {{ todb_db_name }} {{ todb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
- host {{ todb_db_name }} {{ todb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ todb_db_name }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ host {{ todb_db_name }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ host {{ todb_db_name }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
- hostssl {{ postgresql_user }} {{ todb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
- host {{ postgresql_user }} {{ todb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ postgresql_user }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ postgresql_user }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ host {{ postgresql_user }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ host {{ postgresql_user }} {{ todb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endfor %}
+{% endif %}
#-------------------------------------
# TRAFFIC VAULT
# ------------------------------------------------------
+{% if groups['traffic_ops'] is defined %}
{% for host_obj in (groups['traffic_ops']) %}
- hostssl {{ tvdb_db_name }} {{ tvdb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
- host {{ tvdb_db_name }} {{ tvdb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ tvdb_db_name }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ host {{ tvdb_db_name }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ host {{ tvdb_db_name }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
- hostssl {{ postgresql_user }} {{ tvdb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
- host {{ postgresql_user }} {{ tvdb_username }} {{ (groups['traffic_ops'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl {{ postgresql_user }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl {{ postgresql_user }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ host {{ postgresql_user }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ host {{ postgresql_user }} {{ tvdb_username }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endfor %}
+{% endif %}
+{% if postgresql_replica_user is defined and postgresql_replica_user is not none %}
# ------------------------------------------------------
# REPLICATION
# ------------------------------------------------------
# -- Primary
- hostssl replication to_replication {{ (groups['traffic_opsdb-primary'] | map('extract', hostvars, ['ansible_host']) | first) }}/32 md5
+ {% if hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl replication {{ postgresql_replica_user }} {{ hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl replication {{ postgresql_replica_user }} {{ hostvars[groups['traffic_opsdb-primary'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-primary'] | first].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% if groups['traffic_opsdb-standby'] is defined %}
# -- Secondary
- hostssl replication to_replication {{ (groups['traffic_opsdb-standby'] | map('extract', hostvars, ['ansible_host']) | first) }}/32 md5
+ {% if hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl replication {{ postgresql_replica_user }} {{ hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv4.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl replication {{ postgresql_replica_user }} {{ hostvars[groups['traffic_opsdb-standby'] | first].ansible_default_ipv6.address|default(hostvars[groups['traffic_opsdb-standby'] | first].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endif %}
{% if groups['traffic_opsdb-replicas'] is defined %}
# -- Replicas
{% for host_obj in (groups['traffic_opsdb-replicas']) %}
- hostssl replication to_replication {{ (groups['traffic_opsdb-replicas'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ hostssl replication {{ postgresql_replica_user }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ hostssl replication {{ postgresql_replica_user }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endfor %}
{% endif %}
+{% endif %}
+{% if telegraf_db_user is defined and telegraf_db_user is not none %}
# ------------------------------------------------------
# TELEGRAF
# ------------------------------------------------------
- host {{ todb_db_name }} {{ telegraf_db_user }} 172.18.0.1/32 md5
+ host {{ todb_db_name }} {{ telegraf_db_user }} 127.0.0.1/32 md5
+ host {{ todb_db_name }} {{ telegraf_db_user }} ::1/128 md5
+{% if groups['traffic_stats'] is defined %}
{% for host_obj in (groups['traffic_stats']) %}
- host {{ todb_db_name }} {{ telegraf_db_user }} {{ (groups['traffic_stats'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ host {{ todb_db_name }} {{ telegraf_db_user }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ host {{ todb_db_name }} {{ telegraf_db_user }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endfor %}
+{% endif %}
+{% endif %}
+{% if grafana_db_user is defined and grafana_db_user is not none and groups['traffic_stats'] is defined %}
# ------------------------------------------------------
# GRAFANA
# ------------------------------------------------------
{% for host_obj in (groups['traffic_stats']) %}
- host {{ grafana_db_name }} {{ grafana_db_user }} {{ (groups['traffic_stats'] | map('extract', hostvars, ['ansible_host']) | list)[loop.index0] }}/32 md5
+ {% if hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) is defined %}
+ host {{ grafana_db_name }} {{ grafana_db_user }} {{ hostvars[host_obj].ansible_default_ipv4.address|default(hostvars[host_obj].ansible_all_ipv4_addresses[0]) }}/32 md5
+ {%endif%}
+ {% if hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) is defined %}
+ host {{ grafana_db_name }} {{ grafana_db_user }} {{ hostvars[host_obj].ansible_default_ipv6.address|default(hostvars[host_obj].ansible_all_ipv6_addresses[0]) }}/128 md5
+ {%endif%}
{% endfor %}
+{% endif %}
diff --git a/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2 b/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2
index 04ea289..8e16784 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2
+++ b/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2
@@ -596,11 +596,11 @@ timezone = 'UTC'
# encoding
# These settings are initialized by initdb, but they can be changed.
-lc_messages = 'en_US.utf8' # locale for system error message
+#lc_messages = 'en_US.utf8' # locale for system error message
# strings
-lc_monetary = 'en_US.utf8' # locale for monetary formatting
-lc_numeric = 'en_US.utf8' # locale for number formatting
-lc_time = 'en_US.utf8' # locale for time formatting
+#lc_monetary = 'en_US.utf8' # locale for monetary formatting
+#lc_numeric = 'en_US.utf8' # locale for number formatting
+#lc_time = 'en_US.utf8' # locale for time formatting
# default configuration for text search
default_text_search_config = 'pg_catalog.english'
diff --git a/infrastructure/ansible/roles/dataset_loader/templates/parameter.j2 b/infrastructure/ansible/roles/traffic_opsdb/templates/recovery.conf.j2
similarity index 56%
copy from infrastructure/ansible/roles/dataset_loader/templates/parameter.j2
copy to infrastructure/ansible/roles/traffic_opsdb/templates/recovery.conf.j2
index 80b6c0ff..9260a19 100644
--- a/infrastructure/ansible/roles/dataset_loader/templates/parameter.j2
+++ b/infrastructure/ansible/roles/traffic_opsdb/templates/recovery.conf.j2
@@ -11,15 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#}
-[
-{% if item.parameters is defined and item.parameters is not none and item.parameters|length > 0 %}
-{% for param in item.parameters %}
- {
- "name": "{{ param.name }}",
- "configFile": "{{ param.configFile }}",
- "value": "{{ param.value }}",
- "secure": {{ param.secure | default(false) | int }}
- }{% if not loop.last %},{% endif %}
-{% endfor %}
-{% endif %}
-]
+standby_mode = 'on'
+primary_conninfo = 'host={{ postgresql_target_replication_parent }} port={{ postgresql_port }} user={{ postgresql_replica_user }} password={{ postgresql_replica_user_password }}'
+trigger_file = '{{ postgresql_datadir }}/replication.trigger'
+
+
+# In the even of the secondary becoming the master the failover time will be able to seamlessly connect to the new primary
+recovery_target_timeline = 'latest'
diff --git a/infrastructure/ansible/roles/traffic_opsdb/vars/main.yml b/infrastructure/ansible/roles/traffic_opsdb/vars/main.yml
index 3864329..4f974b8 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/vars/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/vars/main.yml
@@ -13,27 +13,39 @@
# limitations under the License.
#
-#determine postgres major and minor versions
+# determine postgres major and minor versions
pg_major_version: "{% if postgresql_version is defined and postgresql_version != omit %}{{ (postgresql_version | string).split('.')[0]}}{% else %}9{% endif %}"
valid_major_version: "{% if pg_major_version | int == 0 %}false{% else %}true{% endif %}"
pg_minor_version: "{% if postgresql_version is defined and postgresql_version != omit %}{{ (postgresql_version | string).split('.')[1]}}{% else %}6{% endif %}"
valid_minor_version: "{% if pg_minor_version | int == 0 %}false{% else %}true{% endif %}"
-pg_build_num: "{% if postgresql_version is defined and pg_major_version | int < 10 and postgresql_version != omit %}{{ (postgresql_version | string).split('.')[2]}}{% else %}11{% endif %}"
+pg_build_num: >-
+ {%- if postgresql_version is defined and pg_major_version | int < 10 and postgresql_version != omit -%}{{ (postgresql_version | string).split('.')[2]}}
+ {%- else -%}13{%- endif -%}
valid_build_version: "{% if pg_major_version | int < 10 and pg_build_num | int == 0 %}false{% else %}true{% endif %}"
-#postgres bin PATH
-pg_bin_path: "{% if pg_major_version | int < 10 %}/usr/pgsql-{{pg_major_version}}.{{pg_minor_version}}/bin{%else%}/usr/pgsql-{{pg_major_version}}/bin{%endif%}"
-
-#postgres initdb shell command based on version
-pgdb_init_command: "{% if pg_major_version | int < 10 %}/usr/pgsql-{{pg_major_version}}.{{pg_minor_version}}/bin/initdb -D '{{ postgresql_datadir }}'{%else%}/usr/pgsql-{{pg_major_version}}/bin/initdb -D '{{ postgresql_datadir }}'{%endif%}"
-
-#postgres systemd service path
-pg_service_path: "{% if pg_major_version | int < 10 %}/usr/lib/systemd/system/postgresql-{{pg_major_version}}.{{pg_minor_version}}.service{%else%}/usr/lib/systemd/system/postgresql-{{pg_major_version}}.service{%endif%}"
-
-#postgres profile.d path
-pg_profile_path: "{% if pg_major_version | int < 10 %}/etc/profile.d/postgres{{pg_major_version}}{{pg_minor_version}}-bin.sh{%else%}/etc/profile.d/postgres{{pg_major_version}}-bin.sh{%endif%}"
-
-#postgres service name based
-pg_service_name: "{% if pg_major_version | int < 10 %}postgresql-{{pg_major_version}}.{{pg_minor_version}}{%else%}postgresql-{{pg_major_version}}{%endif%}"
+# postgres bin PATH
+pg_bin_path: >-
+ {%- if pg_major_version | int < 10 -%}/usr/pgsql-{{pg_major_version}}.{{pg_minor_version}}/bin
+ {%- else -%}/usr/pgsql-{{pg_major_version}}/bin{%- endif -%}
+
+# postgres initdb shell command based on version
+pgdb_init_command: >-
+ {%- if pg_major_version | int < 10 -%}/usr/pgsql-{{pg_major_version}}.{{pg_minor_version}}/bin/initdb -D '{{ postgresql_datadir }}'
+ {%- else -%}/usr/pgsql-{{pg_major_version}}/bin/initdb -D '{{ postgresql_datadir }}'{%- endif -%}
+
+# postgres systemd service path
+pg_service_path: >-
+ {%- if pg_major_version | int < 10 -%}/usr/lib/systemd/system/postgresql-{{pg_major_version}}.{{pg_minor_version}}.service
+ {%- else -%}/usr/lib/systemd/system/postgresql-{{pg_major_version}}.service{%- endif -%}
+
+# postgres profile.d path
+pg_profile_path: >-
+ {%- if pg_major_version | int < 10 -%}/etc/profile.d/postgres{{pg_major_version}}{{pg_minor_version}}-bin.sh
+ {%- else -%}/etc/profile.d/postgres{{pg_major_version}}-bin.sh{%- endif -%}
+
+# postgres service name based
+pg_service_name: >-
+ {%- if pg_major_version | int < 10 -%}postgresql-{{pg_major_version}}.{{pg_minor_version}}
+ {%- else -%}postgresql-{{pg_major_version}}{%- endif -%}
diff --git a/infrastructure/ansible/roles/traffic_portal/defaults/main.yml b/infrastructure/ansible/roles/traffic_portal/defaults/main.yml
index 3e55036..9ab7fc6 100644
--- a/infrastructure/ansible/roles/traffic_portal/defaults/main.yml
+++ b/infrastructure/ansible/roles/traffic_portal/defaults/main.yml
@@ -136,6 +136,7 @@ tp_default_properties_template:
geoProvider: 0
geoLimit: 0
ccrDnsTtl: 30
+ serviceCategory: other
anonymousBlockingEnabled: false
DNS:
routingName: cdn
@@ -151,9 +152,11 @@ tp_default_properties_template:
geoLimit: 0
missLat: 41.881944
missLong: -87.627778
+ serviceCategory: other
signingAlgorithm:
ccrDnsTtl: 30
regionalGeoBlocking: false
+ maxDnsAnswers: 6
anonymousBlockingEnabled: false
ecsEnabled: false
HTTP:
@@ -167,12 +170,14 @@ tp_default_properties_template:
maxRequestHeaderBytes: 0
multiSiteOrigin: false
logsEnabled: false
- initialDispersion: 1
+ initialDispersion: 2
regionalGeoBlocking: false
+ maxDnsAnswers: 6
geoProvider: 0
geoLimit: 0
missLat: 41.881944
missLong: -87.627778
+ serviceCategory: other
signingAlgorithm:
ccrDnsTtl: 3600
anonymousBlockingEnabled: false
@@ -186,7 +191,9 @@ tp_default_properties_template:
geoProvider: 0
geoLimit: 0
regionalGeoBlocking: false
+ maxDnsAnswers: 6
ccrDnsTtl: 30
+ serviceCategory: other
anonymousBlockingEnabled: false
ecsEnabled: false
charts: