From 8d3713c2bd479bc3e7b903834ad5bc3be94b6059 Mon Sep 17 00:00:00 2001 From: msuthar-splunk <77360432+msuthar-splunk@users.noreply.github.com> Date: Sat, 16 Jan 2021 05:40:55 +1100 Subject: [PATCH 1/6] Revert "Revert "fix: change type of ansible_pre_tasks and ansible_post_tasks to a list. (#588)" (#589)" (#592) This reverts commit b193a149e04fa69604a0e6ee66668593c40d3455. --- docs/advanced/default.yml.spec.md | 12 ++--- inventory/environ.py | 24 ++++++++- site.yml | 22 +++++--- tests/small/test_environ.py | 83 ++++++++++++++++++++++++------- 4 files changed, 106 insertions(+), 35 deletions(-) diff --git a/docs/advanced/default.yml.spec.md b/docs/advanced/default.yml.spec.md index a6f88a0b..730f8d7d 100644 --- a/docs/advanced/default.yml.spec.md +++ b/docs/advanced/default.yml.spec.md @@ -10,13 +10,13 @@ The following is the full spec file for a `default.yml` that controls how Splunk gets provisioned. ``` -ansible_post_tasks: -* Comma-separated list of paths or URLs to custom Ansible playbooks to run AFTER Splunk has been setup using the provided site.yml -* Default: null +ansible_post_tasks: +* list of paths or URLs to custom Ansible playbooks to run AFTER Splunk has been setup using the provided site.yml +* Default: [] -ansible_pre_tasks: -* Comma-separated list of paths or URLs to custom Ansible playbooks to run BEFORE Splunk sets up using the provided site.yml -* Default: null +ansible_pre_tasks: +* list of paths or URLs to custom Ansible playbooks to run BEFORE Splunk sets up using the provided site.yml +* Default: [] ansible_environment: * Map of environment variables used only during the execution context of all the Ansible tasks. For more information, see https://docs.ansible.com/ansible/latest/user_guide/playbooks_environment.html diff --git a/inventory/environ.py b/inventory/environ.py index 03266afe..ad3a3bd4 100755 --- a/inventory/environ.py +++ b/inventory/environ.py @@ -411,12 +411,32 @@ def getLaunchConf(vars_scope): launch.update({k:v for k,v in [x.split("=", 1) for x in settings.split(",")]}) vars_scope["splunk"]["launch"] = launch +def ensureListValue(value, separator): + if isinstance(value, list): + return value + elif (not value) or (not value.strip()): + return [] + else: + return splitAndStrip(value, separator) + +def splitAndStrip(value, separator): + if not value: + return [] + return [x.strip() for x in value.split(separator)] + +def transformEnvironmentVariable(environmentVariableName, transform, default): + if environmentVariableName in os.environ: + return transform(os.environ.get(environmentVariableName)) + else: + return default + def getAnsibleContext(vars_scope): """ Parse parameters that influence Ansible execution """ - vars_scope["ansible_pre_tasks"] = os.environ.get("SPLUNK_ANSIBLE_PRE_TASKS", vars_scope.get("ansible_pre_tasks")) - vars_scope["ansible_post_tasks"] = os.environ.get("SPLUNK_ANSIBLE_POST_TASKS", vars_scope.get("ansible_post_tasks")) + stringSeparator = "," + vars_scope["ansible_pre_tasks"] = transformEnvironmentVariable("SPLUNK_ANSIBLE_PRE_TASKS", lambda v: splitAndStrip(v, stringSeparator), ensureListValue(vars_scope.get("ansible_pre_tasks"), stringSeparator)) + vars_scope["ansible_post_tasks"] = transformEnvironmentVariable("SPLUNK_ANSIBLE_POST_TASKS", lambda v: splitAndStrip(v, stringSeparator), ensureListValue(vars_scope.get("ansible_post_tasks"), stringSeparator)) vars_scope["ansible_environment"] = vars_scope.get("ansible_environment") or {} env = os.environ.get("SPLUNK_ANSIBLE_ENV") if env: diff --git a/site.yml b/site.yml index 81657c0a..543d63c0 100644 --- a/site.yml +++ b/site.yml @@ -8,13 +8,16 @@ - block: - name: Execute pre-setup playbooks + loop: "{{ ansible_pre_tasks }}" + loop_control: + loop_var: ansible_pre_tasks_item include_tasks: execute_adhoc_plays.yml vars: - playbook: "{{ ansible_pre_tasks }}" + playbook: "{{ ansible_pre_tasks_item }}" when: - - ansible_pre_tasks is defined - - ansible_pre_tasks is not none - - ansible_pre_tasks is match("^(http|https|file)://.*") + - ansible_pre_tasks_item is defined + - ansible_pre_tasks_item is not none + - ansible_pre_tasks_item is match("^(http|https|file)://.*") - name: Provision role include_role: @@ -23,13 +26,16 @@ - splunk.role is defined - name: Execute post-setup playbooks + loop: "{{ ansible_post_tasks }}" + loop_control: + loop_var: ansible_post_tasks_item include_tasks: execute_adhoc_plays.yml vars: - playbook: "{{ ansible_post_tasks }}" + playbook: "{{ ansible_post_tasks_item }}" when: - - ansible_post_tasks is defined - - ansible_post_tasks is not none - - ansible_post_tasks is match("^(http|https|file)://.*") + - ansible_post_tasks_item is defined + - ansible_post_tasks_item is not none + - ansible_post_tasks_item is match("^(http|https|file)://.*") - name: Check all instances for required restarts include_tasks: ./roles/splunk_common/tasks/check_for_required_restarts.yml diff --git a/tests/small/test_environ.py b/tests/small/test_environ.py index c41aa657..28961f10 100644 --- a/tests/small/test_environ.py +++ b/tests/small/test_environ.py @@ -307,31 +307,76 @@ def test_getLaunchConf(default_yml, os_env, output): environ.getLaunchConf(vars_scope) assert vars_scope["splunk"] == output +@pytest.mark.parametrize(("value", "separator", "output"), + [ + # Check null value + (None, ",", []), + # Check empty value + ("", ",", []), + # Check string value + ("a", ",", ["a"]), + # Check comma separated string value + ("a,b,c", ",", ["a", "b", "c"]), + # Check list value + (["a"], ",", ["a"]), + (["a", "b", "c"], ",", ["a", "b", "c"]) + ] + ) +def test_ensureListValue(value, separator, output): + result = environ.ensureListValue(value, separator) + assert result == output + +@pytest.mark.parametrize(("value", "separator", "output"), + [ + # Check null value + (None, ",", []), + # Check empty value + ("", ",", []), + # Check string value + ("a", ",", ["a"]), + # Check comma separated string value + ("a,b,c", ",", ["a", "b", "c"]), + # Check comma separated string value with whitespaces + (" a, b,c ", ",", ["a", "b", "c"]), + ] + ) +def test_splitAndStrip(value, separator, output): + result = environ.splitAndStrip(value, separator) + assert result == output + @pytest.mark.parametrize(("default_yml", "os_env", "output"), [ # Check null parameters - ({}, {}, {"ansible_pre_tasks": None, "ansible_post_tasks": None, "ansible_environment": {}}), + ({}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {}}), # Check ansible_pre_tasks using defaults or env vars - ({"ansible_pre_tasks": ""}, {}, {"ansible_pre_tasks": "", "ansible_post_tasks": None, "ansible_environment": {}}), - ({"ansible_pre_tasks": "a"}, {}, {"ansible_pre_tasks": "a", "ansible_post_tasks": None, "ansible_environment": {}}), - ({"ansible_pre_tasks": "a,b,c"}, {}, {"ansible_pre_tasks": "a,b,c", "ansible_post_tasks": None, "ansible_environment": {}}), - ({}, {"SPLUNK_ANSIBLE_PRE_TASKS": "d"}, {"ansible_pre_tasks": "d", "ansible_post_tasks": None, "ansible_environment": {}}), - ({}, {"SPLUNK_ANSIBLE_PRE_TASKS": "e,f,g"}, {"ansible_pre_tasks": "e,f,g", "ansible_post_tasks": None, "ansible_environment": {}}), - ({"ansible_pre_tasks": "a,b,c"}, {"SPLUNK_ANSIBLE_PRE_TASKS": "e,f,g"}, {"ansible_pre_tasks": "e,f,g", "ansible_post_tasks": None, "ansible_environment": {}}), + ({"ansible_pre_tasks": ""}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_pre_tasks": None}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_pre_tasks": "a"}, {}, {"ansible_pre_tasks": ["a"], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_pre_tasks": ["a"]}, {}, {"ansible_pre_tasks": ["a"], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_pre_tasks": "a,b,c"}, {}, {"ansible_pre_tasks": ["a","b","c"], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_pre_tasks": ["a","b","c"]}, {}, {"ansible_pre_tasks": ["a","b","c"], "ansible_post_tasks": [], "ansible_environment": {}}), + ({}, {"SPLUNK_ANSIBLE_PRE_TASKS": "d"}, {"ansible_pre_tasks": ["d"], "ansible_post_tasks": [], "ansible_environment": {}}), + ({}, {"SPLUNK_ANSIBLE_PRE_TASKS": "e,f,g"}, {"ansible_pre_tasks": ["e","f","g"], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_pre_tasks": "a,b,c"}, {"SPLUNK_ANSIBLE_PRE_TASKS": "e,f,g"}, {"ansible_pre_tasks": ["e","f","g"], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_pre_tasks": ["a","b","c"]}, {"SPLUNK_ANSIBLE_PRE_TASKS": "e,f,g"}, {"ansible_pre_tasks": ["e","f","g"], "ansible_post_tasks": [], "ansible_environment": {}}), # Check ansible_post_tasks using defaults or env vars - ({"ansible_post_tasks": ""}, {}, {"ansible_pre_tasks": None, "ansible_post_tasks": "", "ansible_environment": {}}), - ({"ansible_post_tasks": "a"}, {}, {"ansible_pre_tasks": None, "ansible_post_tasks": "a", "ansible_environment": {}}), - ({"ansible_post_tasks": "a,b,c"}, {}, {"ansible_pre_tasks": None, "ansible_post_tasks": "a,b,c", "ansible_environment": {}}), - ({}, {"SPLUNK_ANSIBLE_POST_TASKS": "d"}, {"ansible_pre_tasks": None, "ansible_post_tasks": "d", "ansible_environment": {}}), - ({}, {"SPLUNK_ANSIBLE_POST_TASKS": "e,f,g"}, {"ansible_pre_tasks": None, "ansible_post_tasks": "e,f,g", "ansible_environment": {}}), - ({"ansible_post_tasks": "a,b,c"}, {"SPLUNK_ANSIBLE_POST_TASKS": "e,f,g"}, {"ansible_pre_tasks": None, "ansible_post_tasks": "e,f,g", "ansible_environment": {}}), + ({"ansible_post_tasks": ""}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_post_tasks": None}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_post_tasks": "a"}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["a"], "ansible_environment": {}}), + ({"ansible_post_tasks": ["a"]}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["a"], "ansible_environment": {}}), + ({"ansible_post_tasks": "a,b,c"}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["a","b","c"], "ansible_environment": {}}), + ({"ansible_post_tasks": ["a","b","c"]}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["a","b","c"], "ansible_environment": {}}), + ({}, {"SPLUNK_ANSIBLE_POST_TASKS": "d"}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["d"], "ansible_environment": {}}), + ({}, {"SPLUNK_ANSIBLE_POST_TASKS": "e,f,g"}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["e","f","g"], "ansible_environment": {}}), + ({"ansible_post_tasks": "a,b,c"}, {"SPLUNK_ANSIBLE_POST_TASKS": "e,f,g"}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["e","f","g"], "ansible_environment": {}}), + ({"ansible_post_tasks": ["a","b","c"]}, {"SPLUNK_ANSIBLE_POST_TASKS": "e,f,g"}, {"ansible_pre_tasks": [], "ansible_post_tasks": ["e","f","g"], "ansible_environment": {}}), # Check ansible_environment using defaults or env vars - ({"ansible_environment": None}, {}, {"ansible_pre_tasks": None, "ansible_post_tasks": None, "ansible_environment": {}}), - ({"ansible_environment": {"a": "b"}}, {}, {"ansible_pre_tasks": None, "ansible_post_tasks": None, "ansible_environment": {"a": "b"}}), - ({"ansible_environment": {"a": "b", "d": "e"}}, {}, {"ansible_pre_tasks": None, "ansible_post_tasks": None, "ansible_environment": {"a": "b", "d": "e"}}), - ({}, {"SPLUNK_ANSIBLE_ENV": "a=b"}, {"ansible_pre_tasks": None, "ansible_post_tasks": None, "ansible_environment": {"a": "b"}}), - ({}, {"SPLUNK_ANSIBLE_ENV": "a=b,x=y"}, {"ansible_pre_tasks": None, "ansible_post_tasks": None, "ansible_environment": {"a": "b", "x": "y"}}), - ({"ansible_environment": {"a": "c", "d": "e"}}, {"SPLUNK_ANSIBLE_ENV": "a=b,x=y"}, {"ansible_pre_tasks": None, "ansible_post_tasks": None, "ansible_environment": {"a": "b", "d": "e", "x": "y"}}), + ({"ansible_environment": None}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {}}), + ({"ansible_environment": {"a": "b"}}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {"a": "b"}}), + ({"ansible_environment": {"a": "b", "d": "e"}}, {}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {"a": "b", "d": "e"}}), + ({}, {"SPLUNK_ANSIBLE_ENV": "a=b"}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {"a": "b"}}), + ({}, {"SPLUNK_ANSIBLE_ENV": "a=b,x=y"}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {"a": "b", "x": "y"}}), + ({"ansible_environment": {"a": "c", "d": "e"}}, {"SPLUNK_ANSIBLE_ENV": "a=b,x=y"}, {"ansible_pre_tasks": [], "ansible_post_tasks": [], "ansible_environment": {"a": "b", "d": "e", "x": "y"}}), ] ) def test_getAnsibleContext(default_yml, os_env, output): From 985334a7cc4fb3bf7154ae41d8bdf76a6542517a Mon Sep 17 00:00:00 2001 From: Nelson Wang Date: Fri, 15 Jan 2021 17:13:22 -0800 Subject: [PATCH 2/6] Updating codeowners --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 06e9c090..cfd9c318 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -7,10 +7,10 @@ # Default owners for everything in docker-splunk: # * @splunk/if-01 -* @nwang92 @alishamayor @arctan5x @jrigassio-splunk @jmeixensperger @hendolim @bb03 @sarahotis @martinluo22 @Devmalion +* @nwang92 @alishamayor @jrigassio-splunk @jmeixensperger @hendolim @bb03 @sarahotis @martinluo22 @msuthar-splunk @ttwd80 @matt-sm # Docs-only pull requests: /docs/ @alishamayor @nwang92 @bb03 # Release changelog -docs/CHANGELOG.md @nwang92 @alishamayor @arctan5x @jrigassio-splunk @jmeixensperger @hendolim @bb03 @sarahotis @martinluo22 @Devmalion +docs/CHANGELOG.md @nwang92 @alishamayor @jrigassio-splunk @jmeixensperger @hendolim @bb03 @sarahotis @martinluo22 @msuthar-splunk @ttwd80 @matt-sm From c445d85dd1a3f146219b94f3c31f74b2d75896ea Mon Sep 17 00:00:00 2001 From: Nelson Wang Date: Tue, 19 Jan 2021 11:05:40 -0800 Subject: [PATCH 3/6] Handling edge case from onboarding (#593) --- roles/splunk_cluster_master/tasks/main.yml | 8 ++++---- roles/splunk_deployer/tasks/main.yml | 10 ++++------ roles/splunk_deployment_server/tasks/main.yml | 3 +-- roles/splunk_heavy_forwarder/tasks/main.yml | 3 +-- roles/splunk_indexer/tasks/main.yml | 2 +- roles/splunk_license_master/tasks/main.yml | 3 +-- .../tasks/initialize_standalone_search_head.yml | 2 +- roles/splunk_search_head/tasks/main.yml | 2 +- roles/splunk_standalone/tasks/main.yml | 2 +- roles/splunk_universal_forwarder/tasks/main.yml | 3 +-- 10 files changed, 16 insertions(+), 22 deletions(-) diff --git a/roles/splunk_cluster_master/tasks/main.yml b/roles/splunk_cluster_master/tasks/main.yml index ca95e6a6..6d81bce2 100644 --- a/roles/splunk_cluster_master/tasks/main.yml +++ b/roles/splunk_cluster_master/tasks/main.yml @@ -1,14 +1,14 @@ --- - include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml when: - - splunk.apps_location + - "'apps_location' in splunk and splunk.apps_location" - splunk.deployment_server is not defined or not splunk.deployment_server - include_tasks: ../../../roles/splunk_common/tasks/set_as_deployment_client.yml when: splunk.deployment_server is defined and splunk.deployment_server - include_tasks: prepare_apps_bundle.yml - when: splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - include_tasks: initialize_cluster_master.yml @@ -17,10 +17,10 @@ # This installed_apps list gets mutated by ESS bundle generation, hence we # need to refresh this array of apps before disabling them all - include_tasks: ../../../roles/splunk_common/tasks/find_installed_apps.yml - when: splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - include_tasks: ../../../roles/splunk_common/tasks/disable_installed_apps.yml - when: splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - include_tasks: setup_multisite.yml when: diff --git a/roles/splunk_deployer/tasks/main.yml b/roles/splunk_deployer/tasks/main.yml index d340f696..6fcd0f5a 100644 --- a/roles/splunk_deployer/tasks/main.yml +++ b/roles/splunk_deployer/tasks/main.yml @@ -51,22 +51,20 @@ delay: "{{ retry_delay }}" when: - splunk_search_head_cluster | bool - - splunk.apps_location + - "'apps_location' in splunk and splunk.apps_location" - include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml when: - - splunk.apps_location + - "'apps_location' in splunk and splunk.apps_location" - splunk.deployment_server is not defined or not splunk.deployment_server - include_tasks: ../../../roles/splunk_common/tasks/set_as_deployment_client.yml when: splunk.deployment_server is defined and splunk.deployment_server - include_tasks: push_apps_to_search_heads.yml - when: - - splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - include_tasks: ../../../roles/splunk_common/tasks/disable_installed_apps.yml - when: - - splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - include_tasks: ../../../roles/splunk_common/tasks/check_for_required_restarts.yml diff --git a/roles/splunk_deployment_server/tasks/main.yml b/roles/splunk_deployment_server/tasks/main.yml index 65a6118c..114f400d 100644 --- a/roles/splunk_deployment_server/tasks/main.yml +++ b/roles/splunk_deployment_server/tasks/main.yml @@ -2,8 +2,7 @@ - include_tasks: ../../../roles/splunk_common/tasks/enable_forwarding.yml - include_tasks: create_deployment_apps.yml - when: - - splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - include_tasks: generate_server_classes.yml diff --git a/roles/splunk_heavy_forwarder/tasks/main.yml b/roles/splunk_heavy_forwarder/tasks/main.yml index ff9ca614..f83eecaa 100644 --- a/roles/splunk_heavy_forwarder/tasks/main.yml +++ b/roles/splunk_heavy_forwarder/tasks/main.yml @@ -13,8 +13,7 @@ when: splunk.add is defined - include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml - when: - - splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - name: Execute Splunk commands command: "{{ splunk.exec }} {{ item }} -auth {{ splunk.admin_user }}:{{ splunk.password }}" diff --git a/roles/splunk_indexer/tasks/main.yml b/roles/splunk_indexer/tasks/main.yml index ed44fd77..1affd74c 100644 --- a/roles/splunk_indexer/tasks/main.yml +++ b/roles/splunk_indexer/tasks/main.yml @@ -12,7 +12,7 @@ - include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml when: - - splunk.apps_location + - "'apps_location' in splunk and splunk.apps_location" - not splunk_indexer_cluster | bool - splunk.deployment_server is not defined or not splunk.deployment_server diff --git a/roles/splunk_license_master/tasks/main.yml b/roles/splunk_license_master/tasks/main.yml index fd6b9507..0694781d 100644 --- a/roles/splunk_license_master/tasks/main.yml +++ b/roles/splunk_license_master/tasks/main.yml @@ -2,8 +2,7 @@ - include_tasks: ../../splunk_common/tasks/enable_forwarding.yml - include_tasks: ../../splunk_common/tasks/provision_apps.yml - when: - - splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" - name: Enable license master local indexing ini_file: diff --git a/roles/splunk_monitor/tasks/initialize_standalone_search_head.yml b/roles/splunk_monitor/tasks/initialize_standalone_search_head.yml index 60dd0256..8096329e 100644 --- a/roles/splunk_monitor/tasks/initialize_standalone_search_head.yml +++ b/roles/splunk_monitor/tasks/initialize_standalone_search_head.yml @@ -9,7 +9,7 @@ - include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml when: - - splunk.apps_location + - "'apps_location' in splunk and splunk.apps_location" - not splunk_search_head_cluster | bool - splunk.deployment_server is not defined or not splunk.deployment_server diff --git a/roles/splunk_search_head/tasks/main.yml b/roles/splunk_search_head/tasks/main.yml index 6d8cf55c..39b00908 100644 --- a/roles/splunk_search_head/tasks/main.yml +++ b/roles/splunk_search_head/tasks/main.yml @@ -44,7 +44,7 @@ - include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml when: - - splunk.apps_location + - "'apps_location' in splunk and splunk.apps_location" - not splunk_search_head_cluster | bool - splunk.deployment_server is not defined or not splunk.deployment_server diff --git a/roles/splunk_standalone/tasks/main.yml b/roles/splunk_standalone/tasks/main.yml index 5a679400..006f05ce 100644 --- a/roles/splunk_standalone/tasks/main.yml +++ b/roles/splunk_standalone/tasks/main.yml @@ -36,7 +36,7 @@ - include_tasks: ../../splunk_common/tasks/provision_apps.yml when: - - splunk.apps_location + - "'apps_location' in splunk and splunk.apps_location" - splunk.deployment_server is not defined or not splunk.deployment_server - include_tasks: ../../../roles/splunk_common/tasks/enable_dfs.yml diff --git a/roles/splunk_universal_forwarder/tasks/main.yml b/roles/splunk_universal_forwarder/tasks/main.yml index 76c5092a..9cd87fd7 100644 --- a/roles/splunk_universal_forwarder/tasks/main.yml +++ b/roles/splunk_universal_forwarder/tasks/main.yml @@ -13,8 +13,7 @@ when: splunk.add is defined - include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml - when: - - splunk.apps_location + when: "'apps_location' in splunk and splunk.apps_location" # Execute other Splunk commands - name: Execute Splunk commands From 79dfa92d51d44b4574a7a84d96f9ff3fc67c6ac9 Mon Sep 17 00:00:00 2001 From: Nelson Wang Date: Tue, 19 Jan 2021 12:55:12 -0800 Subject: [PATCH 4/6] Adding small delay/retry around build fetching to account for instability (#594) Co-authored-by: James Rigassio <51932491+jrigassio-splunk@users.noreply.github.com> --- roles/splunk_common/tasks/install_splunk_tgz.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/splunk_common/tasks/install_splunk_tgz.yml b/roles/splunk_common/tasks/install_splunk_tgz.yml index 23732886..c18bf4ef 100644 --- a/roles/splunk_common/tasks/install_splunk_tgz.yml +++ b/roles/splunk_common/tasks/install_splunk_tgz.yml @@ -9,6 +9,9 @@ mode: 0666 when: splunk.build_location is match("^(https?)://.*") register: download_result + until: download_result is succeeded + retries: 5 + delay: "{{ retry_delay }}" become: yes become_user: "{{ privileged_user }}" From 69639affdb91f31c3d740cd92fa505a213a1c983 Mon Sep 17 00:00:00 2001 From: Alisha Mayor Date: Thu, 21 Jan 2021 17:31:55 -0800 Subject: [PATCH 5/6] Updating changelog for release/8.0.8 --- docs/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 109cbf88..5364c3c2 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ * [8.1.1](#811) * [8.1.0.1](#8101) * [8.1.0](#810) +* [8.0.8](#808) * [8.0.7](#807) * [8.0.6.1](#8061) * [8.0.6](#806) @@ -72,6 +73,16 @@ --- +## 8.0.8 + +#### What's New? +Syncing with latest codebase - currently up to sync with 8.1.1. + +#### Changes +* See [8.1.1](#811) changes above. + +--- + ## 8.0.7 #### What's New? From 1f661cc934a543a7aed70ef310d3fa5b6daf70fe Mon Sep 17 00:00:00 2001 From: Alisha Mayor Date: Tue, 2 Feb 2021 08:12:25 -0800 Subject: [PATCH 6/6] Updating changelog for Release/8.1.2 (#598) * Updating changelog for release/8.1.2 * Pin pip version to 20.3.3 * Update CI machine image and Python versions --- .circleci/config.yml | 14 ++++++++++---- Makefile | 4 ++-- docs/CHANGELOG.md | 8 ++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c0a6d513..9f756bde 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,9 @@ -version: 2 +version: 2.1 + jobs: splunk-ansible-test: machine: - image: circleci/classic:latest + image: ubuntu-1604:202007-01 steps: - checkout - run: @@ -24,12 +25,17 @@ jobs: path: tests/results py3k-splunk-ansible-test: machine: - image: circleci/classic:latest + image: ubuntu-1604:202007-01 steps: - checkout - run: name: Setup Python3 - command: pyenv global 2.7.12 3.5.2 + command: | + pyenv global 2.7.18 3.7.8 + python --version + pip --version + python3 --version + pip3 --version - run: name: Run small tests command: make py3k-small-tests diff --git a/Makefile b/Makefile index dd819a6b..dae2e19d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SHELL := /bin/bash test-setup: @echo 'Install test requirements' - pip install --upgrade pip + pip install pip==20.3.3 pip install -r $(shell pwd)/tests/requirements.txt --upgrade py3k-test-setup: @@ -15,7 +15,7 @@ lint: test-setup ansible-lint -v -c ./tests/ansible-lint.cfg site.yml roles/**/**/*.yml roles/**/**/**/*.yml py3k-lint: test-setup - # We're treating each file separately here, because of their scarsity + # We're treating each file separately here, because of their scarcity # This will need to be re-evaluated if a full blown module gets in here pylint --py3k $(shell find . -name "*.py") caniusepython3 -r tests/requirements.txt diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5364c3c2..ae6b60eb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,7 @@ ## Navigation +* [8.1.2](#812) * [8.1.1](#811) * [8.1.0.1](#8101) * [8.1.0](#810) @@ -44,6 +45,13 @@ --- +## 8.1.2 + +#### Changes +* Bugfixes and documentation updates + +--- + ## 8.1.1 #### Changes