Overidding identifiers¶
Within a given inventory you may provide a regular expression to alter the identifiers (i.e. the names) of your servers as they appear and are referenced within Bcome.
This is useful when you have server names that include metadata that you want to strip within Bcome.
The regular expression must match the server name, and include a single selector that is used to replace the orignal name.
In the following example, I have setup two GCP inventories. Both return the same servers, but one inventory alters their names with an override removing the prefix “prod_net_”.
Note
For further configuration details, please refer to the documentation.
Tree Hierarchy¶
The tree hierarchy below is generated by invoking Bcome’s tree
command:
▐▆ Namespace tree wbz
│
└───╸ collection gcp
├───╸ inventory not_overriden
│ ├───╸ server prod_net_bastion
│ ├───╸ server prod_net_puppet
│ └───╸ server prod_net_wbzsite_app_sq6v
│
└───╸ inventory overriden
├───╸ server bastion
├───╸ server puppet
└───╸ server wbzsite_app_sq6v
Network Configuration¶
---
wbz:
type: collection
description: Entire WBZ estate
ssh_settings: {}
wbz:gcp:
type: collection
description: WBZ gcp estate
network:
type: gcp
project: wbznet
authentication_scheme: oauth
secrets_filename: wbz-net-oauth-secrets.json
service_scopes:
- https://www.googleapis.com/auth/compute.readonly
- https://www.googleapis.com/auth/cloud-platform
wbz:gcp:not_overriden:
type: inventory
description: GCP Production
ssh_settings:
proxy:
- host_lookup: by_bcome_namespace
namespace: gcp:not_overriden:prod_net_bastion
network:
filters: status:running AND labels.environment=prod-net
zone: europe-west1-b
wbz:gcp:overriden:
type: inventory
description: GCP Production
ssh_settings:
proxy:
- host_lookup: by_bcome_namespace
namespace: gcp:overriden:bastion
network:
filters: status:running AND labels.environment=prod-net
zone: europe-west1-b
override_identifier: "prod_net_(.+)"
Note
You may override identifiers within namespaces of type inventory
, or inventory-subselect
Any reference to an overriden server uses the overriden name. See the proxy referenced by “gcp:overriden:bastion” above as an example.
Ascii Cast¶
The following Asciicast presents a quick run-through of navigating the namespace configuration.
Note
To replay this Asciicast in your own terminal, install the asciinema
package from https://asciinema.org/, and then enter the following in your terminal:
asciinema play https://asciinema.org/a/l28TSXqlLjQCF9trrbtvO5KSL