Hi All, Is there any to guide me.
Iam trying to download, install and configure Morpheusdata using ansible playbook. I have done download, install, reconfigure, changed Appliance name. Now I want to use cli commands in ansible playbook to do initial setup. I have tried but it’s not working.
I tried with the following syntax.
Hi,
I think you’d be better doing this via the Morpheus API in a playbook instead of the CLI.
We have an example of an ansible task in the gomorpheus repo that does exactly this. You can find the task here
You would need to be more specific about what is not working. The CLI isn’t really designed to be used in scripts or any other non-interactive way. In fact, the CLI just translates your inputs into API calls and sends them to Morpheus.
If you are getting prompts in Ansible from the CLI, most commands have a -N flag that will disable prompting for input. If you don’t have all the required information in the CLI command, you will receive an error, so you will have to test your inputs.
I am trying to automate the download, install and configure and automate the initial setup of morpheusdata using ansible playbook. I have downloaded, installed and configured the morpheusdata using ansible playbook. but the initial setup is not working.
When i use the above syntax it is changing the appliance name but it is not prompting for the other details, like user name, email etc.
It is possible to do using cli command in ansible playbook. If it is possible then how would it be.
please guide.
Ansible is not interactive. You can attempting to run a command that is interactive and expects user input. You would need to find a way to have Ansible respond to requests for input from the script. I’ve been using Ansible for over 7 years and I would be hard pressed to make that work.
The correct way to perform this task is to use the API through Ansible. If you must use the CLI, Ansible is the wrong tool to perform that task.
The error you are getting is a failure to register with the Morpheus hub. There could be a number of environmental issues causing this. Try setting the variable morpheus_setup_hub_mode to skip. This will bypass hub registration and then you can confirm if the set up works.
If running the playbook on a multi-node Morpheus setup e.g 3 node HA, the setup task only needs to run once. If it runs on all 3 you will see the error that you get on 2 of the nodes. But on the node where the task runs, registration to the hub will work fine. Try and log into the hub using the user that you specified in the setup to check if the appliance has registered.
The initial start-up of Morpheus can take a few minutes as the database is seeded and plugins are loaded. You will need to factor this in to make sure that the setup task only runs after the application has completely started. You can check in the morpheus-ui current log file to see when the application startup has completed. Look for the Morpheus logo.
The password you are specifying to register with the hub does not meet the minimum password requirements (8 charactes, 1 uppercase, 1 symbol). This will be the reason for the failure.