Documentation
¶
Index ¶
- Variables
- func CommentConfig(clsName string) error
- func GetHostPort(srv *aini.Host, cfg *ini.File) int
- func ImportConfig(ctx context.Context, name string, clsMeta *spec.ClusterMeta, ...) error
- func LoadConfig(clsName string, cls *spec.ClusterMeta) error
- func ParseAndImportInventory(ctx context.Context, dir, ansCfgFile string, clsMeta *spec.ClusterMeta, ...) error
- func ReadInventory(ctx context.Context, dir, inventoryFileName string) (string, *spec.ClusterMeta, *aini.InventoryData, error)
- func SSHKeyPath() string
Constants ¶
This section is empty.
Variables ¶
var ( // AnsibleInventoryFile is the default inventory file name AnsibleInventoryFile = "inventory.ini" // AnsibleConfigFile is the default ansible config file name AnsibleConfigFile = "ansible.cfg" )
Functions ¶
func CommentConfig ¶ added in v1.5.0
CommentConfig add `#` to the head of each lines for imported configs
func GetHostPort ¶ added in v1.1.0
GetHostPort tries to read the SSH port of the host 1. get from Host.Vars["ansible_port"] 2. get from cfg.Section("defaults").Key("remote_port") 3. get from srv.Port
func ImportConfig ¶
func ImportConfig(ctx context.Context, name string, clsMeta *spec.ClusterMeta, gOpt operator.Options) error
ImportConfig copies config files from cluster which deployed through tidb-ansible
func LoadConfig ¶ added in v1.3.0
func LoadConfig(clsName string, cls *spec.ClusterMeta) error
LoadConfig files to clusterMeta, include tidbservers, tikvservers, pdservers pumpservers and drainerservers
func ParseAndImportInventory ¶
func ParseAndImportInventory(ctx context.Context, dir, ansCfgFile string, clsMeta *spec.ClusterMeta, inv *aini.InventoryData, sshTimeout uint64, sshType executor.SSHType) error
ParseAndImportInventory builds a basic ClusterMeta from the main Ansible inventory
func ReadInventory ¶
func ReadInventory(ctx context.Context, dir, inventoryFileName string) (string, *spec.ClusterMeta, *aini.InventoryData, error)
ReadInventory reads the inventory files of a TiDB cluster deployed by TiDB-Ansible
func SSHKeyPath ¶
func SSHKeyPath() string
SSHKeyPath gets the path to default SSH private key, this is the key Ansible uses to connect deployment servers
Types ¶
This section is empty.