This provides the automated agent deployment on multiple target hosts, where monitoring is required.
Following sections will walk you through the pre-requisites, configuration and executing the playbooks.
The current playbooks works for linux based hosts, but this can be extended to other operating systems as well.
-
Make sure you have SSH capability on the target hosts and the user connecting through SSH has the capability to become root.
-
You need to have OCI CLI installed and OCI configuration created only on the localhost from where the deployment is initiated.
refer: https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#Quickstart -
You need ansible collection to execute playbooks and configured with OCI CLI on the localhost from where the deployment is initiated.
refer: https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/ansiblegetstarted.htm#Getting_Started_with_Oracle_Cloud_Infrastructure_and_Ansible
-
The hosts file contains the configurations for the playbooks.
- target_hosts = where you want to install the agent
- target_hosts:vars = target host specific variables
- all:vars = global variables, which are applicable to all, including localhost
Refer the hosts file for detailed information.
- compartment_ocid: This specifies the compartment for the Management Agent. This needs to be set as environment variable.
e.g.
export compartment_ocid=<your_compartment_ocid_goes_here>
ansible-playbook -i hosts mgmt_agent_install.yaml -kK
ansible-playbook -i hosts mgmt_agent_uninstall.yaml -kK
Note:
-
The -kK option is the shorthand of --ask-pass and --ask-become-pass
-
SSH password: The ssh user password
-
BECOME password[defaults to SSH password]: The password to become the root user.
- At the end of each playbook run, you should be able to see something similar like this for a successful execution
PLAY RECAP ***************************************************************************************************************************************************************
host1.subnetxyz.regionaplh1.oraclevcn.com : ok=10 changed=5 unreachable=0 failed=0 skipped=5 rescued=0 ignored=0
localhost : ok=12 changed=1 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
- Go to oracle cloud - Observability & Management - Management Agents - Agents
- select the compartment and verify the installed agents
Copyright (c) 2022 Oracle and/or its affiliates.