func()

in lib/ec2macosinit/usermanagement.go [25:39]


func (c *UserManagementModule) Do(ctx *ModuleContext) (message string, err error) {
	// Check if randomizing password is requested. If so, then perform action, otherwise return with no work to do
	if c.RandomizePassword {
		message, err = c.randomizePassword()
		if err != nil {
			return "", fmt.Errorf("ec2macosinit: failed to randomize password: %s", err)
		}
	} else {
		return "randomizing password disabled, skipping", nil
	}

	// For now, `message` will only be set if RandomizePassword is true. Instead of returning above, it is returned here
	// for readability and future additions to the module
	return message, nil
}