Creating the Director Config File
Extracting a director configuration file, an externalized config that lives outside of Ops Manager, can make it easier to manage multiple foundations as well as help with:
- avoiding configuration drift
- configuration promotion
To extract the configuration for an director, you will first need to do the following:
Create the infrastructure for your installation. To make the infrastructure creation easier, consider using terraform to create the resources needed:
Install Ops Manager using the create-vm task
(Optional) Configure Ops Manager manually within the Ops Manager UI (Instructions for doing so can be found using the Official-Pivotal-Platform-Documentation)
om has a command called staged-director-config, which is used to extract the Ops Manager and the BOSH director configuration from the targeted foundation.
staged-director-config will not be able to grab all sensitive fields in your Ops Manager installation (for example: vcenter_username and vcenter_password if using vsphere). To find these missing fields, please refer to the Ops Manager API Documentation
om --env env.yml staged-director-config > director.yml
will give you the whole configuration of Ops Manager in a single yml file. It will look more or less the same as the example above. You can check it in to your VCS.
The following is an example configuration file for Ops Manager that might return after running this command:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
Configuring Director Using Config File
Now you can modify the settings in the configuration file directly instead of operating in the web ui. After you finish editing the file, the configuration file will need to apply back to the Ops Manager instance. The command configure-director will do the job.
om --env env.yml configure-director --config director.yml
Promoting Ops Manager to Another Foundation
The configuration file is the exact state of a given foundation, it contains
some environment specific properties. You need to manually edit those
properties to reflect the state of the new foundation. Or, when extracting
the configuration file from the foundation, you can use the flag
--include-placeholders, it will help to parameterize some variables to
ease the process of adapt for another foundation.