Documentation ¶
Index ¶
- Variables
- func AnsibleFacts() *commander.Command
- func AutoStartCommand() *commander.Command
- func CPathCommand() *commander.Command
- func ContainerizePath(p string) (string, error)
- func CopyCommand() *commander.Command
- func CopyFile(src, dest string) error
- func DefaultInterface() (string, error)
- func EditLxcAddLine(n string, find, duplicate *regexp.Regexp, line string) error
- func EnsureChain(chain string) error
- func ExistsCommand() *commander.Command
- func ExistsContainer(name string) (bool, error)
- func ExposePort(n string, containerPort, hostPort int) error
- func ExposePortCommand() *commander.Command
- func FixIP(containerName string, ip string) error
- func FixIPCommand() *commander.Command
- func GetDefinedContainer(n string) (*lxc.Container, error)
- func GetIP(containerName string) (string, error)
- func GetIPCommand() *commander.Command
- func GetSSHKey(name string) (string, error)
- func HostCommand() *commander.Command
- func IPTables(args ...string) (success bool, err error)
- func IsDir(p string) (bool, error)
- func LinkDirIntoContainer(n, src, dest string) error
- func LnCommand() *commander.Command
- func MakeDir(fn string) error
- func MakeWriter(a bool, fn string) (out io.WriteCloser, err error)
- func PortForward(containerName string, portToForward int, destinationPort int) error
- func PortForwardCommand() *commander.Command
- func SSHKeyCommand() *commander.Command
- func SSHKeyScan(name string, euser string) error
- func SSHKeyScanCommand() *commander.Command
- func SaveIPTablesRules() error
- func SetContainerAutoStart(n string, autostart bool) error
- func SetSudoer(n, u string) error
- func Shell(n, script string) error
- func ShellCommand() *commander.Command
- func SudoerCommand() *commander.Command
- func Tee(a bool, out []string) (err error)
- func TeeCommand() *commander.Command
- func WriteAnsibleFact() *commander.Command
Constants ¶
This section is empty.
Variables ¶
var ErrNoDefaultInterfaceFound = errors.New(`Failed to find default interface`)
Functions ¶
func AnsibleFacts ¶
func AutoStartCommand ¶
func CPathCommand ¶
func ContainerizePath ¶
ContainerizePath takes a path that potentially starts with containerName:/path/ and turns it into a full path on the local machine.
func CopyCommand ¶
func DefaultInterface ¶
DefaultInterface returns the name of the default interface on this system (eg 'eth0')
func EditLxcAddLine ¶
EditLxcAddLine adds a line to the LXC config file. It will add the line line, after it finds a line matching the `find` regexp. It will remove any line matching the 'duplicate' regexp. `n` is the name of the container to whose config this is being added.
func EnsureChain ¶
EnsureChain ensures that the chain exists, creating it if it does not.
func ExistsCommand ¶
func ExistsContainer ¶
func ExposePort ¶
ExposePort is going to expose a containerPort on the Host. The basic iptables commands to accomplish this are: #sudo iptables -N PHPC #sudo iptables -A PHPC -p tcp -d 10.0.3.192 --dport 80 -j ACCEPT #sudo iptables -A PHPC -j DROP #sudo iptables -A FORWARD -i eth0 -o lxcbr0 -j PHPC #sudo iptables -A FORWARD -j DROP # not sure if this is necessary sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 10.0.3.192:80
func ExposePortCommand ¶
func FixIP ¶
FixIP sets the IP of the named container to the given ip in the string, or to the container's current IP if the container is running.
func FixIPCommand ¶
func GetDefinedContainer ¶
func GetIP ¶
GetIP returns the IPv4 of the named container, or an error if the container does not exist.
func GetIPCommand ¶
func HostCommand ¶
func LinkDirIntoContainer ¶
func MakeWriter ¶
func MakeWriter(a bool, fn string) (out io.WriteCloser, err error)
func PortForward ¶
func PortForwardCommand ¶
func SSHKeyCommand ¶
func SSHKeyScan ¶
SSHKeyScan adds the host keys for the named container to the current user's known hosts.
func SSHKeyScanCommand ¶
func SaveIPTablesRules ¶
func SaveIPTablesRules() error
func SetContainerAutoStart ¶
func ShellCommand ¶
func SudoerCommand ¶
func TeeCommand ¶
func WriteAnsibleFact ¶
Types ¶
This section is empty.
Source Files ¶
- AnsibleCommands.go
- AutoStartCommand.go
- CPathCommand.go
- CopyCommand.go
- ExistsCommand.go
- ExposeCommand.go
- FixIPCommand.go
- GetIPCommand.go
- HostCommand.go
- IPTables.go
- LinkCommand.go
- PortForwardCommand.go
- SSHAuthKeyCommand.go
- SSHHostKeys.go
- SSHKey.go
- ShellCommand.go
- SudoerCommand.go
- TeeCommand.go
- lxc_config_editing.go
- lxc_utils.go