threatstack / threatstack-ansible

Ansible for installing Threatstack Agent
https://www.threatstack.com
MIT License
23 stars 17 forks source link

Upgrade from agent 1.x series fails #44

Closed stevenscg closed 5 years ago

stevenscg commented 5 years ago

This role does not appear to detect an existing installation of a 1.x version agent.

It fails on the Agent setup step as shown below because the tsagent is not available (that I could find).

Ansible version 2.7.5.

TASK [threatstack : Check if agent is v1.x] *************************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Define v1 variable] *****************************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Define v2 package URL variable] *****************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Ensure ThreatStack repo is installed.] **********************************************************************************************************
changed: [10.101.0.73]

TASK [threatstack : Add ThreatStack repo GPG key.] ******************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Ensure Agent is installed.] *********************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Get setup string] *******************************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Get checksum of setup string] *******************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Create file to track checksum of setup string] **************************************************************************************************
changed: [10.101.0.73]

TASK [threatstack : Get config string] ******************************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : Get checksum of config string] ******************************************************************************************************************
ok: [10.101.0.73]

TASK [threatstack : debug] ******************************************************************************************************************************************
ok: [10.101.0.73] => {
    "msg": null
}

TASK [threatstack : Agent setup] ************************************************************************************************************************************
fatal: [10.101.0.73]: FAILED! => {"changed": false, "cmd": "tsagent setup -url https://app.threatstack.com -deploy-key XXXXX -ruleset 'Base Rule Set'", "msg": "[Errno 2] No such file or directory", "rc": 2}

PLAY RECAP **********************************************************************************************************************************************************
10.101.0.73                : ok=14   changed=2    unreachable=0    failed=1   
Shplorf commented 5 years ago

Yep, I think I see the issue. This happens when a version is not explicitly specified and an existing 1.x install is present. For now, if you want it to upgrade to 2.x, you can set threatstack_pkg to threatstack-agent-2.0.0 or threatstack-agent-2*. But yes, this is a bug in the role. Fix coming shortly. Thanks for writing it up!

stevenscg commented 5 years ago

Sounds good. I was going to work up a solution but ran out of time. I was able to verify that a clean install works just fine on CentOS 7.5.

kbachand commented 5 years ago

I'm having the same issue. Installing on a Ubuntu 16.04 machine and currently have a 1X agent installed.

Shplorf commented 5 years ago

Fixed in release v4.0.1