splunk / splunk-platform-automator

Ansible framework providing a fast and simple way to spin up complex Splunk environments.
Apache License 2.0
117 stars 46 forks source link

Splunk Upgrade is not working #19

Closed tonyprinzler closed 2 years ago

tonyprinzler commented 2 years ago

Describe the bug After installing Splunk with version 8.2.1 via the ansible deployment, the upgrade to version is going wrong

To Reproduce Steps to reproduce the behavior: config: `---

splunk_config.yml

plugin: splunkenizer

custom: ansible_port: 22 ansible_user: labuser become_user: root

os: packages:

virtualbox:

box: "centos/7" # Default

box: "ubuntu/xenial64"

Splunk default settings

splunk_defaults: splunk_env_name: splk splunk_version: '8.2.3' splunk_admin_password: 'splunklab'

splunk_license_file: Splunk_Enterprise.lic

splunk_indexes:

Indexer Cluster settings

splunk_idxclusters:

Splunk hosts with its settings

splunk_hosts:

Cluster Master

commands tested:

Expected behavior I expected splunk will be upgraded by the playbook Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context TASK [splunk_software : find target version] ************************************************************************************************************************************************************************************************************************************************* fatal: [host-8947]: FAILED! => {"msg": "The conditional check 'find_target_version|default(true) is true' failed. The error was: template error while templating string: no test named 'true'. String: {% if find_target_version|default(true) is true %} True {% else %} False {% endif %}\n\nThe error appears to be in '/home/tony/Vagrant/Splunkenizer/ansible/roles/splunk_software/tasks/check_splunk_version.yml': line 31, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: find target version\n ^ here\n"} fatal: [host-8948]: FAILED! => {"msg": "The conditional check 'find_target_version|default(true) is true' failed. The error was: template error while templating string: no test named 'true'. String: {% if find_target_version|default(true) is true %} True {% else %} False {% endif %}\n\nThe error appears to be in '/home/tony/Vagrant/Splunkenizer/ansible/roles/splunk_software/tasks/check_splunk_version.yml': line 31, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: find target version\n ^ here\n"} fatal: [host-8945]: FAILED! => {"msg": "The conditional check 'find_target_version|default(true) is true' failed. The error was: template error while templating string: no test named 'true'. String: {% if find_target_version|default(true) is true %} True {% else %} False {% endif %}\n\nThe error appears to be in '/home/tony/Vagrant/Splunkenizer/ansible/roles/splunk_software/tasks/check_splunk_version.yml': line 31, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: find target version\n ^ here\n"} fatal: [host-8946]: FAILED! => {"msg": "The conditional check 'find_target_version|default(true) is true' failed. The error was: template error while templating string: no test named 'true'. String: {% if find_target_version|default(true) is true %} True {% else %} False {% endif %}\n\nThe error appears to be in '/home/tony/Vagrant/Splunkenizer/ansible/roles/splunk_software/tasks/check_splunk_version.yml': line 31, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: find target version\n ^ here\n"} fatal: [host-8959]: FAILED! => {"msg": "The conditional check 'find_target_version|default(true) is true' failed. The error was: template error while templating string: no test named 'true'. String: {% if find_target_version|default(true) is true %} True {% else %} False {% endif %}\n\nThe error appears to be in '/home/tony/Vagrant/Splunkenizer/ansible/roles/splunk_software/tasks/check_splunk_version.yml': line 31, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: find target version\n ^ here\n"}

splunkenizer commented 2 years ago

Looks like the same issue of evaluating true or false in the code. So, when I fix Issue #18 this one can be fixed as well and can go through the code to find all the occurrences.

splunkenizer commented 2 years ago

sub playbooks cannot be run directly with ansible-playbook command. Because they are based on artifacts defined from the main or other sub playbook called from main. So, that's why you get the error here.

tonyprinzler commented 2 years ago

Hi, thats true. This was a mistake by my site. But the error described came up by executing the upgrade yaml.

splunkenizer commented 2 years ago

This will be fixed in #18 as this is a duplicate of the root cause.