HenryGP / om_ansible

Minimalistic, disposable Ops Manager environment with Ansible
19 stars 17 forks source link

Adding mongodb-org-4.4.repo for OM 4.4 installs #71

Closed MartinCanovas closed 4 years ago

MartinCanovas commented 4 years ago

New Ops Manager 4.4.0 needs mongodb-org-4.4.repo to be installed.

S3 Blockstore in OM 4.4 has a new parameter: disableProxyS3. Calling the OM API without this new parameter will fail to configure the S3 Blockstore.

Removed unnecessary spaces at the end of several lines/files.

HenryGP commented 4 years ago

The newly added parameter to the S3 creation is breaking the provisioning in previous versions of Ops Manager. From Travis CI:

TASK [Configure S3 Blockstore] *************************************************
fatal: [opsmgr]: FAILED! => 
{"changed": false, "connection": "close", 
"content": "{\n  \"detail\" : \"Invalid attribute disableProxyS3 specified.\",\n  \"error\" : 400,\n  \"errorCode\" : \"INVALID_ATTRIBUTE\",\n  \"parameters\" : [ \"disableProxyS3\" ],\n
 \"reason\" : \"Bad Request\"\n}", "content_length": "183", "content_type": "application/json", "date": "Fri, 31 Jul 2020 02:22:10 GMT", "elapsed": 0, "json": {"detail": "Invalid attribute disableProxyS3 specified.", "error": 400, "errorCode": "INVALID_ATTRIBUTE", "parameters": ["disableProxyS3"], "reason": "Bad Request"}, "msg": "Status code was 400 and not [201]: HTTP Error 400: Bad Request", "redirected": false, "status": 400, "url": "http://omserver.omansible.int:8080/api/public/v1.0/admin/backup/snapshot/s3Configs?pretty=true", "x_mongodb_service_version": "gitHash=ef953ced7bfa25edadd20632d7c6642ef31ec701; versionString=4.2.14.56911.20200603T2241Z"}

@MartinCanovas please add a condition to the tasks/api-create-s3-blockstore.yaml to consider the Ops Manager version so it makes the relevant API call including disableProxyS3. A side-note about this, it is a new mandatory parameter when creating S3 blockstores?

MartinCanovas commented 4 years ago

The newly added parameter to the S3 creation is breaking the provisioning in previous versions of Ops Manager. From Travis CI:

TASK [Configure S3 Blockstore] *************************************************
fatal: [opsmgr]: FAILED! => 
{"changed": false, "connection": "close", 
"content": "{\n  \"detail\" : \"Invalid attribute disableProxyS3 specified.\",\n  \"error\" : 400,\n  \"errorCode\" : \"INVALID_ATTRIBUTE\",\n  \"parameters\" : [ \"disableProxyS3\" ],\n
 \"reason\" : \"Bad Request\"\n}", "content_length": "183", "content_type": "application/json", "date": "Fri, 31 Jul 2020 02:22:10 GMT", "elapsed": 0, "json": {"detail": "Invalid attribute disableProxyS3 specified.", "error": 400, "errorCode": "INVALID_ATTRIBUTE", "parameters": ["disableProxyS3"], "reason": "Bad Request"}, "msg": "Status code was 400 and not [201]: HTTP Error 400: Bad Request", "redirected": false, "status": 400, "url": "http://omserver.omansible.int:8080/api/public/v1.0/admin/backup/snapshot/s3Configs?pretty=true", "x_mongodb_service_version": "gitHash=ef953ced7bfa25edadd20632d7c6642ef31ec701; versionString=4.2.14.56911.20200603T2241Z"}

@MartinCanovas please add a condition to the tasks/api-create-s3-blockstore.yaml to consider the Ops Manager version so it makes the relevant API call including disableProxyS3. A side-note about this, it is a new mandatory parameter when creating S3 blockstores?

Yes, the parameter "disableProxyS3" is required for OM 4.4. If not provided, the deployment will fail when using the API to configure the S3 blockstore as shown below:

fatal: [opsmgr]: FAILED! => {"changed": false, "connection": "close", "content": "{\n \"detail\" : \"The required attributes [disableProxyS3] were not specified.\",\n \"error\" : 400,\n \"errorCode\" : \"MISSING_ATTRIBUTES\",\n \"parameters\" : [ \"[disableProxyS3]\" ],\n \"reason\" : \"Bad Request\"\n}", "content_length": "203", "content_type": "application/json", "date": "Fri, 31 Jul 2020 12:49:01 GMT", "elapsed": 0, "json": {"detail": "The required attributes [disableProxyS3] were not specified.", "error": 400, "errorCode": "MISSING_ATTRIBUTES", "parameters": ["[disableProxyS3]"], "reason": "Bad Request"}, "msg": "Status code was 400 and not [201]: HTTP Error 400: Bad Request", "redirected": false, "status": 400, "url": "http://omserver.omansible.int:8080/api/public/v1.0/admin/backup/snapshot/s3Configs?pretty=true", "x_mongodb_service_version": "gitHash=a952261c611cc8516f06c3cb0b517cd364ffb577; versionString=4.4.0.101.20200728T1856Z"}

MartinCanovas commented 4 years ago

api-create-s3-blockstore.yaml requires added logic to handle newly added parameter to create S3 blockstore if 4.4 is being used.

Logic added to handle other OM versions.

I noticed an error when deploying OM 4.0.x:

TASK [Start mongodb-mms service] *********************************************************************************
fatal: [opsmgr]: FAILED! => {"changed": false, "msg": "Unable to start service mongodb-mms.service: Job for mongodb-mms.service failed because the control process exited with error code. See \"systemctl status mongodb-mms.service\" and \"journalctl -xe\" for details.\n"}

However, the above error is unrelated to the changes made in this PR.

HenryGP commented 4 years ago

@MartinCanovas tests in Travis complete successfully for all versions except 4.4.0. Only item missing to merge this code would be to add a new line to .travis.yaml for testing out 4.4.x versions. I have also created the pertinent variables in Travis CI to make this happen:

env:
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM34} MONGO=${MONGO_REPO_34}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM36} MONGO=${MONGO_REPO_36}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM40} MONGO=${MONGO_REPO_40}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM42} MONGO=${MONGO_REPO_42}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM44} MONGO=${MONGO_REPO_44}

This last change will trigger a new series of tests in Travis and we can get the final confirmation to merge the code into master.

MartinCanovas commented 4 years ago

@MartinCanovas tests in Travis complete successfully for all versions except 4.4.0. Only item missing to merge this code would be to add a new line to .travis.yaml for testing out 4.4.x versions. I have also created the pertinent variables in Travis CI to make this happen:

env:
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM34} MONGO=${MONGO_REPO_34}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM36} MONGO=${MONGO_REPO_36}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM40} MONGO=${MONGO_REPO_40}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM42} MONGO=${MONGO_REPO_42}
  - ANSIBLE_HOME=/usr/local/bin PLAYBOOKS_PATH=/root/tests/playbooks OM=${OM44} MONGO=${MONGO_REPO_44}

This last change will trigger a new series of tests in Travis and we can get the final confirmation to merge the code into master.

New line added in .travis.yml for testing OM 4.4.x. Perfect day to add this line when Lewis Hamilton with his car number 44 just won the Silverstone Grand Prix.

HenryGP commented 4 years ago

@MartinCanovas and just like Hamilton, the test won after the first turn of the race.

Merging and thanking you for opening this PR 👍