Graylog2 / graylog-ansible-role

Ansible role which installs and configures Graylog
Apache License 2.0
212 stars 126 forks source link

Fix server package version #72

Closed jccomputing closed 7 years ago

jccomputing commented 7 years ago

When you force the server's package version, the playbook tests if the graylog_server_version variable is defined but the graylog_version is used.

Here is a small fix for this.

Tested on graylog-server 2.2.2-1 on Ubuntu.

CLAassistant commented 7 years ago

CLA assistant check
All committers have signed the CLA.

mariussturm commented 7 years ago

Thanks for the contribution. The tests are failing, could you review this?

jccomputing commented 7 years ago

CLA signed. Sorry for the disturbance.

joschi commented 7 years ago

@jccomputing The build is still failing: https://travis-ci.org/Graylog2/graylog-ansible-role/builds/211375470#L5073

mariussturm commented 7 years ago

On Debian Wheezy Ansible exits with:

TASK [../../role : Graylog server package should be installed] *****************

fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'graylog_server_version' is undefined\n\nThe error appears to have been in '/role/tasks/setup-Debian.yml': line 68, 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: Graylog server package should be installed\n  ^ here\n"}
mariussturm commented 7 years ago

LGTM :+1:, thanks!

x-drum commented 7 years ago

Sorry for necrobumping this one, but maybe i'm missing something: how to fix server package version under RH systems?

if you set graylog_server_version to '2.2.2-1' you will get:

TASK [Graylog2.graylog-ansible-role : Graylog server should be installed] ****** fatal: [redacted]: FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'graylog-server-2.2' found available, installed or updated", "rc": 126, "results": ["No package matching 'graylog-server-2.2' found available, installed or updated"]}

if you instead set graylog_version to '2.2.2-1' the role will attempt to enable the wrong repo:

TASK [Graylog2.graylog-ansible-role : Repositories should be updated] ********** fatal: [redacted]: FAILED! => {"changed": false, "failed": true, "msg": "Failure downloading https://packages.graylog2.org/repo/packages/graylog-2.2.2-1-repository_latest.rpm, 'NoneType' object has no attribute 'read'"}

jccomputing commented 7 years ago

@x-drum that's strange. What you describe is the behavior before the PR.

Did you test a version with the patch applied?

x-drum commented 7 years ago

@jccomputing damn sorry totally overlooked it, wrong branch... i thought i was on master

fxfitz commented 7 years ago

Do we know when this is going to be pushed to Ansible Galaxy?