From 37c9053baf5d7ef7f4d1784153086e2dff2d7254 Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Mon, 26 Jul 2021 12:41:42 -0600 Subject: [PATCH 01/14] updating all APi 1.x endpoints to 2.0 for compatibility --- infrastructure/ansible/influxdb_relay.yml | 4 ++-- infrastructure/ansible/roles/dataset_loader/defaults/main.yml | 4 ++-- .../roles/dataset_loader/profile.parameter.conversion.md | 2 +- infrastructure/ansible/roles/to_api/tasks/login.yml | 2 +- infrastructure/ansible/roles/to_api/tasks/queue_updates.yml | 4 ++-- .../ansible/roles/to_api/tasks/set_server_status.yml | 4 ++-- infrastructure/ansible/roles/traffic_portal/defaults/main.yml | 2 +- infrastructure/ansible/sample.lab/ansible/vars.yml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/infrastructure/ansible/influxdb_relay.yml b/infrastructure/ansible/influxdb_relay.yml index f2165906fc..aa4b04f1c8 100644 --- a/infrastructure/ansible/influxdb_relay.yml +++ b/infrastructure/ansible/influxdb_relay.yml @@ -31,7 +31,7 @@ - name: Get TO Cookie uri: - url: "{{ to_url }}/api/1.3/user/login" + url: "{{ to_url }}/api/{{ to_api_version }}/user/login" method: POST body: '{ "u":"{{ tm_traffic_ops_username }}", "p":"{{ tmonitor_passwd }}" }' headers: @@ -46,7 +46,7 @@ - name: Get All Servers uri: - url: "{{ to_url }}/api/1.3/servers" + url: "{{ to_url }}/api/{{ to_api_version }}/servers" method: GET validate_certs: no follow_redirects: all diff --git a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml index 7ab36b39ce..957719c376 100644 --- a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml +++ b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml @@ -24,7 +24,7 @@ dl_sf_url: https://czf.kabletown.invalid dl_to_user: dl_to_user_password: # TrafficOps API version to use -dl_to_api_version: 1.3 +dl_to_api_version: 2.0 dl_target_api_url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}" # URL for the CZF file dl_shallow_czf_url: "{{ dl_sf_url }}/czf.json" @@ -738,7 +738,7 @@ dl_ds_default_profile_cdntemplates: secure: 0 - name: federationmapping.polling.url configFile: CRConfig.json - value: https://${toHostname}/api/1.4/federations/all.json + value: https://${toHostname}/api/{{ dl_to_api_version }}/federations/all.json secure: 0 - name: geolocation.polling.interval configFile: CRConfig.json diff --git a/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md b/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md index 5a3e4fa435..82d748336d 100644 --- a/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md +++ b/infrastructure/ansible/roles/dataset_loader/profile.parameter.conversion.md @@ -20,7 +20,7 @@ 1. Install `jq` 2. Install `ruby` -3. Curl to get the response of https://{{ TO_BASE_URL }}/api/1.3/profiles/name/{{ TARGET_PROFILE }}/parameters and save that to a file named `profile.parameters.json` +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 diff --git a/infrastructure/ansible/roles/to_api/tasks/login.yml b/infrastructure/ansible/roles/to_api/tasks/login.yml index e5a98636d2..25ab3574b4 100644 --- a/infrastructure/ansible/roles/to_api/tasks/login.yml +++ b/infrastructure/ansible/roles/to_api/tasks/login.yml @@ -14,7 +14,7 @@ # - name: Get TO Cookie uri: - url: "{{ to_api_base_url }}/api/1.2/user/login" + url: "{{ to_api_base_url }}/api/{{ to_api_version }}/user/login" method: POST body_format: json body: '{ "u":"{{ to_api_login_name }}", "p":"{{ to_api_login_password }}" }' diff --git a/infrastructure/ansible/roles/to_api/tasks/queue_updates.yml b/infrastructure/ansible/roles/to_api/tasks/queue_updates.yml index 86a2cb6e48..75e1be22ad 100644 --- a/infrastructure/ansible/roles/to_api/tasks/queue_updates.yml +++ b/infrastructure/ansible/roles/to_api/tasks/queue_updates.yml @@ -17,7 +17,7 @@ - name: Get cdn details uri: - url: "{{ to_api_base_url }}/api/1.2/cdns" + url: "{{ to_api_base_url }}/api/{{ to_api_version }}/cdns" method: GET headers: Cookie: "{{ hostvars.localhost.login.set_cookie }}" @@ -29,7 +29,7 @@ - name: "{{ 'Queue updates for ' + to_api_target_cdn }}" uri: - url: "{{ to_api_base_url }}/api/1.2/cdns/{{ cdns_details.json.response | selectattr('name','equalto',to_api_target_cdn) | map(attribute='id') | list | first }}/queue_update" + url: "{{ to_api_base_url }}/api/{{ to_api_version }}/cdns/{{ cdns_details.json.response | selectattr('name','equalto',to_api_target_cdn) | map(attribute='id') | list | first }}/queue_update" method: POST body_format: json headers: 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 040570479f..6c34017cc8 100644 --- a/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml +++ b/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml @@ -17,7 +17,7 @@ - name: Get server details for {{to_api_target_host}} uri: - url: "{{ to_api_base_url }}/api/1.2/servers/hostname/{{ to_api_target_host.split('.')[0] }}/details" + url: "{{ to_api_base_url }}/api/{{ to_api_version }}/servers/hostname/{{ to_api_target_host.split('.')[0] }}/details" method: GET headers: Cookie: "{{ hostvars.localhost.login.set_cookie }}" @@ -40,7 +40,7 @@ - name: "{{ 'Set state of '+to_api_target_host+' to ' + to_api_desired_state }}" uri: - url: "{{ to_api_base_url }}/api/1.2/servers/{{ server_details.json.response.id }}/status" + url: "{{ to_api_base_url }}/api/{{ to_api_version }}/servers/{{ server_details.json.response.id }}/status" method: PUT body_format: json headers: diff --git a/infrastructure/ansible/roles/traffic_portal/defaults/main.yml b/infrastructure/ansible/roles/traffic_portal/defaults/main.yml index 838419099e..3e55036a88 100644 --- a/infrastructure/ansible/roles/traffic_portal/defaults/main.yml +++ b/infrastructure/ansible/roles/traffic_portal/defaults/main.yml @@ -82,7 +82,7 @@ tp_default_properties_template: cacheChecks: _comments: These are configurable properties for the cache checks view. The data for the cache checks view is derived from TO extensions. The extensions array - should include an entry for each of your extensions or you can check GET api/1.3/servers/checks + should include an entry for each of your extensions or you can check GET api/{{ to_api_version }}/servers/checks to see which checks you have configured. show: true updatePending: diff --git a/infrastructure/ansible/sample.lab/ansible/vars.yml b/infrastructure/ansible/sample.lab/ansible/vars.yml index 764ed6df73..30036ada32 100644 --- a/infrastructure/ansible/sample.lab/ansible/vars.yml +++ b/infrastructure/ansible/sample.lab/ansible/vars.yml @@ -25,7 +25,7 @@ grovetccfg_version: "{{ grove_version }}" influxdb_relay_version: adaa2ea-1 feigner_version: 1.0.0_dev_11248-1 ats_version: 7.1.4-2.el7 -to_api_version: "1.3" +to_api_version: "2.0" todb_username: traffic_ops todb_db_name: traffic_ops From f3354e28e25a78c1c57cef5f1eaceaebd10395df Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Mon, 26 Jul 2021 13:07:07 -0600 Subject: [PATCH 02/14] updating changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 136564d756..7ea2306199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Enhanced ort integration test for reload states - Added a new field to Delivery Services - `tlsVersions` - that explicitly lists the TLS versions that may be used to retrieve their content from Cache Servers. - Updated T3C changes in Ansible playbooks +- Updated all endpoints in infrastructure code to use API version 2.0 ### Fixed - [#5690](https://github.com/apache/trafficcontrol/issues/5690) - Fixed github action for added/modified db migration file. From dbc6c13b87592c4e3f644780ac6444ee94f572df Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Mon, 26 Jul 2021 13:22:27 -0600 Subject: [PATCH 03/14] update to API v1 endpoint in snapshot --- infrastructure/ansible/roles/to_api/tasks/snapshot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/ansible/roles/to_api/tasks/snapshot.yml b/infrastructure/ansible/roles/to_api/tasks/snapshot.yml index 56df17cdf7..66148ee894 100644 --- a/infrastructure/ansible/roles/to_api/tasks/snapshot.yml +++ b/infrastructure/ansible/roles/to_api/tasks/snapshot.yml @@ -64,7 +64,7 @@ - name: "Retrieves PENDING snapshot ({{ to_api_target_cdn }})" delegate_to: localhost uri: - url: "{{ to_api_base_url }}/api/1.2/cdns/{{ to_api_target_cdn }}/snapshot/new" + url: "{{ to_api_base_url }}/api/{{ to_api_version }}/cdns/{{ to_api_target_cdn }}/snapshot/new" method: GET follow_redirects: all return_content: yes From 3dcc7ffe9d22b4fd6a2b66ebd515042e9afa2cac Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Mon, 26 Jul 2021 15:17:59 -0600 Subject: [PATCH 04/14] fixing compatibility issues --- infrastructure/ansible/roles/dataset_loader/defaults/main.yml | 2 +- infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml | 2 +- infrastructure/ansible/roles/to_api/tasks/set_server_status.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml index 957719c376..8254851e3d 100644 --- a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml +++ b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml @@ -738,7 +738,7 @@ dl_ds_default_profile_cdntemplates: secure: 0 - name: federationmapping.polling.url configFile: CRConfig.json - value: https://${toHostname}/api/{{ dl_to_api_version }}/federations/all.json + value: https://${toHostname}/api/{{ dl_to_api_version }}/federations/all secure: 0 - name: geolocation.polling.interval configFile: CRConfig.json diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml index 6539a47bc7..fcc095bbbb 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/ds_loader.yml @@ -122,7 +122,7 @@ - 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.json" + url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/cdns/name/{{ Target_cdn_name }}/sslkeys" method: GET - name: Assign Servers to Delivery Services - Grove 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 6c34017cc8..6a5aa80735 100644 --- a/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml +++ b/infrastructure/ansible/roles/to_api/tasks/set_server_status.yml @@ -17,7 +17,7 @@ - name: Get server details for {{to_api_target_host}} uri: - url: "{{ to_api_base_url }}/api/{{ to_api_version }}/servers/hostname/{{ to_api_target_host.split('.')[0] }}/details" + url: "{{ to_api_base_url }}/api/{{ to_api_version }}/servers/details?hostName={{ to_api_target_host.split('.')[0] }}" method: GET headers: Cookie: "{{ hostvars.localhost.login.set_cookie }}" From b25a2107b55149d6ffc44747460e491529a5871f Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Wed, 28 Jul 2021 09:42:05 -0600 Subject: [PATCH 05/14] forcing domainName delegation to be lowercase --- .../ansible/roles/dataset_loader/tasks/dataset_loader.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml index 918539bc11..1dfae4bf26 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml @@ -52,7 +52,7 @@ name: "{{ dl_ds_merged_cdns[cdnDelegationPrimary].name | default(cdnDelegationPrimary) }}" domainName: "{{ cdnDelegationPrimary }}.{{ (groups['traffic_ops'] | first).split('.')[1:] | join('.') | lower }}" dnssecEnabled: "{{ dl_ds_merged_cdns[cdnDelegationPrimary].dnssecEnabled | default(false) | lower }}" - cdn_query: "response[?starts_with(domainName,`{{ cdnDelegationPrimary }}`) == `true`].id | [0]" + cdn_query: "response[?starts_with(domainName,`{{ cdnDelegationPrimary | lower }}`) == `true`].id | [0]" error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]" 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) From 5a09284c9493b7324a150a5d7fa8117a8f6f39ad Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Wed, 28 Jul 2021 14:32:15 -0600 Subject: [PATCH 06/14] Types are pre-loaded in API 2.0 and up, update playbooks accordingly --- .../roles/dataset_loader/defaults/main.yml | 16 ++++++++-------- .../dataset_loader/tasks/dataset_loader.yml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml index 8254851e3d..670648c221 100644 --- a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml +++ b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml @@ -71,14 +71,14 @@ dl_ds_default_cdns: dnssecEnabled: false # TO Types -dl_ds_merged_types: "{{ dl_ds_default_types }}" -dl_ds_default_types: - - name: TR_LOC - description: Traffic Router Logical Location - useInTable: cachegroup - - name: INFRA_LOC - description: Generic Infrastructure Logical Location - useInTable: cachegroup +#dl_ds_merged_types: "{{ dl_ds_default_types }}" +#dl_ds_default_types: +# - name: TR_LOC +# description: Traffic Router Logical Location +# useInTable: cachegroup +# - name: INFRA_LOC +# description: Generic Infrastructure Logical Location +# useInTable: cachegroup # The mapping of components from inventory hostvars to TO types dl_ds_merged_type_ansible_component_map: "{{ dl_ds_default_type_ansible_component_map }}" diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml index 1dfae4bf26..61516ee262 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml @@ -102,7 +102,7 @@ name: "{{ item.name }}" description: "{{ item.description }}" useInTable: "{{ item.useInTable }}" - with_items: "{{ dl_ds_merged_types }}" + with_items: "{{ dl_ds_private_types }}" vars: error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]" register: create_types_out From 161e7beaac583d92ec071383280616e928c083a1 Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Wed, 28 Jul 2021 15:53:42 -0600 Subject: [PATCH 07/14] update to TC_LOCfrom INFRA_LOC --- .../ansible/roles/dataset_loader/tasks/dataset_loader.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml index 61516ee262..0c3cc2c6cc 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml @@ -172,7 +172,7 @@ with_items: "{{ dl_ds_merged_cachegroups | json_query(type_filter) }}" vars: type_query: "response[?name == '{{ item.type | default('EDGE_LOC') }}'].id | [0]" - type_filter: "[?type == 'INFRA_LOC']" + type_filter: "[?type == 'TC_LOC']" 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) From 5137ca99025e6cd0750a63220787cf0621a163de Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Wed, 28 Jul 2021 19:42:47 -0600 Subject: [PATCH 08/14] more updates for TC_LOC --- infrastructure/ansible/roles/dataset_loader/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml index 670648c221..e24acad381 100644 --- a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml +++ b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml @@ -125,7 +125,7 @@ dl_ds_default_cachegroups: parentCachegroup: secondaryParentCachegroup: localizationMethods: - type: INFRA_LOC + type: TC_LOC fallbackToClosest: - name: multi-site-org-east shortName: msoe From 6d27d1234b209d7da884e8778d8326c8dbcd6921 Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Thu, 29 Jul 2021 11:23:12 -0600 Subject: [PATCH 09/14] adding service address --- .../ansible/roles/dataset_loader/tasks/dataset_loader.yml | 4 ++++ .../ansible/roles/dataset_loader/templates/server.j2 | 2 ++ 2 files changed, 6 insertions(+) diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml index 0c3cc2c6cc..4c2355d8a5 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml @@ -703,9 +703,11 @@ updPending: True interfaceName: "{{ hostvars[item].ansible_default_ipv4.interface | default('eth0') }}" ipAddress: "{{ hostvars[item].ansible_default_ipv4.address | default(hostvars[item].ansible_host) }}" + 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) }}" + 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) }}" @@ -772,10 +774,12 @@ cdnId: "{{ cdn_id }}" updPending: True interfaceName: "eth0" + ipIsService: true ipAddress: "{{ hostvars[item].ansible_host }}" ipNetmask: "255.255.255.0" ipGateway: "127.0.0.0" ip6Address: "{{ omit }}" + ip6IsService: true ip6Gateway: "{{ omit }}" interfaceMtu: "9000" tcpPort: "{{ (dl_ds_merged_servers[item] | default(dl_ds_merged_servers['server.kabletown.invalid'])).tcpPort | default(omit) }}" diff --git a/infrastructure/ansible/roles/dataset_loader/templates/server.j2 b/infrastructure/ansible/roles/dataset_loader/templates/server.j2 index b4bb3f50e9..2dea7cd761 100644 --- a/infrastructure/ansible/roles/dataset_loader/templates/server.j2 +++ b/infrastructure/ansible/roles/dataset_loader/templates/server.j2 @@ -26,6 +26,7 @@ {% endif %} {% if ip6Address is defined and ip6Address is not none and ip6Address != omit and ip6Address %} "ip6Address": "{{ ip6Address }}", + "ip6IsService": "{{ ip6IsService }}", {% endif %} {% if ip6Gateway is defined and ip6Gateway is not none and ip6Gateway != omit and ip6Gateway %} "ip6Gateway": "{{ ip6Gateway }}", @@ -68,6 +69,7 @@ "cachegroupId": {{ cachegroupId }}, "interfaceName": "{{ interfaceName }}", "ipAddress": "{{ ipAddress }}", + "ipIsService": "{{ ipIsService }}", "ipNetmask": "{{ ipNetmask }}", "ipGateway": "{{ ipGateway }}", "interfaceMtu": {{ interfaceMtu }}, From 03dda0d189534eff7f940742d3c4f6f029075895 Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Thu, 29 Jul 2021 13:03:09 -0600 Subject: [PATCH 10/14] Syntax issue on boolean --- .../ansible/roles/dataset_loader/templates/server.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure/ansible/roles/dataset_loader/templates/server.j2 b/infrastructure/ansible/roles/dataset_loader/templates/server.j2 index 2dea7cd761..00abbcb14f 100644 --- a/infrastructure/ansible/roles/dataset_loader/templates/server.j2 +++ b/infrastructure/ansible/roles/dataset_loader/templates/server.j2 @@ -26,7 +26,7 @@ {% endif %} {% if ip6Address is defined and ip6Address is not none and ip6Address != omit and ip6Address %} "ip6Address": "{{ ip6Address }}", - "ip6IsService": "{{ ip6IsService }}", + "ip6IsService": {{ ip6IsService }}, {% endif %} {% if ip6Gateway is defined and ip6Gateway is not none and ip6Gateway != omit and ip6Gateway %} "ip6Gateway": "{{ ip6Gateway }}", @@ -69,7 +69,7 @@ "cachegroupId": {{ cachegroupId }}, "interfaceName": "{{ interfaceName }}", "ipAddress": "{{ ipAddress }}", - "ipIsService": "{{ ipIsService }}", + "ipIsService": {{ ipIsService }}, "ipNetmask": "{{ ipNetmask }}", "ipGateway": "{{ ipGateway }}", "interfaceMtu": {{ interfaceMtu }}, From cd5e293e019f613876d2e9e81de27303f329a772 Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Thu, 29 Jul 2021 14:41:37 -0600 Subject: [PATCH 11/14] Server create object update with ipIsService --- .../ansible/roles/dataset_loader/tasks/update_mso_servers.yml | 2 ++ 1 file changed, 2 insertions(+) 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 67aad06c82..b8bf87c224 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml @@ -49,10 +49,12 @@ cdnId: "{{ item.cdnId }}" updPending: "{{ item.updPending }}" interfaceName: "{{ item.interfaceName }}" + ipIsService: true ipAddress: "{{ item.ipAddress }}" ipNetmask: "{{ item.ipNetmask }}" ipGateway: "{{ item.ipGateway }}" ip6Address: "{{ item.ip6Address }}" + ip6IsService: true ip6Gateway: "{{ item.ip6Gateway }}" interfaceMtu: "{{ item.interfaceMtu }}" tcpPort: "{{ item.tcpPort }}" From 02a61df1d3c2cd1e93f600157dcee6ef4098b722 Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Thu, 29 Jul 2021 14:56:00 -0600 Subject: [PATCH 12/14] ipIsService changes in update server playbook --- .../ansible/roles/dataset_loader/tasks/update_mso_servers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b8bf87c224..9da7c25b83 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/update_mso_servers.yml @@ -49,12 +49,12 @@ cdnId: "{{ item.cdnId }}" updPending: "{{ item.updPending }}" interfaceName: "{{ item.interfaceName }}" - ipIsService: true + ipIsService: "{{ item.ipIsService}}" ipAddress: "{{ item.ipAddress }}" ipNetmask: "{{ item.ipNetmask }}" ipGateway: "{{ item.ipGateway }}" ip6Address: "{{ item.ip6Address }}" - ip6IsService: true + ip6IsService: "{{ item.ip6IsService }}" ip6Gateway: "{{ item.ip6Gateway }}" interfaceMtu: "{{ item.interfaceMtu }}" tcpPort: "{{ item.tcpPort }}" From 85b4a59c021e361af4ff0317c245593be98dc41b Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Thu, 29 Jul 2021 16:49:15 -0600 Subject: [PATCH 13/14] update to snapshot endpoint --- .../ansible/roles/dataset_loader/tasks/dataset_loader.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml index 4c2355d8a5..b0ffde63d3 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml @@ -970,7 +970,7 @@ - name: Snapshot all CDNs uri: - url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/snapshot/{{ item.name }}" + url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/snapshot?cdn={{ item.name }}" method: PUT with_items: "{{ get_all_cdns.json.response[1:] }}" register: snapshot_out From eee53abe0c84fd037373ef479a20d6caa846a046 Mon Sep 17 00:00:00 2001 From: apaudy028 Date: Fri, 30 Jul 2021 12:25:25 -0600 Subject: [PATCH 14/14] Using default types var as empty array --- .../ansible/roles/dataset_loader/defaults/main.yml | 10 ++-------- .../roles/dataset_loader/tasks/dataset_loader.yml | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml index e24acad381..12c2ee0aeb 100644 --- a/infrastructure/ansible/roles/dataset_loader/defaults/main.yml +++ b/infrastructure/ansible/roles/dataset_loader/defaults/main.yml @@ -71,14 +71,8 @@ dl_ds_default_cdns: dnssecEnabled: false # TO Types -#dl_ds_merged_types: "{{ dl_ds_default_types }}" -#dl_ds_default_types: -# - name: TR_LOC -# description: Traffic Router Logical Location -# useInTable: cachegroup -# - name: INFRA_LOC -# description: Generic Infrastructure Logical Location -# useInTable: cachegroup +dl_ds_merged_types: "{{ dl_ds_default_types }}" +dl_ds_default_types: [] # The mapping of components from inventory hostvars to TO types dl_ds_merged_type_ansible_component_map: "{{ dl_ds_default_type_ansible_component_map }}" diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml index b0ffde63d3..c842fd818c 100644 --- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml +++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml @@ -102,7 +102,7 @@ name: "{{ item.name }}" description: "{{ item.description }}" useInTable: "{{ item.useInTable }}" - with_items: "{{ dl_ds_private_types }}" + with_items: "{{ dl_ds_merged_types }}" vars: error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]" register: create_types_out