Skip to content

installers.infra.coredns #

Installer - CoreDNS Module

This module provides heroscript actions for installing and managing CoreDNS.

Actions

coredns.install

Installs the CoreDNS server.

Parameters:

  • reset (bool): If true, force a reinstall even if CoreDNS is already detected. Default: false.

Example:

!!coredns.install
reset: true

Constants #

const version = '1.12.0'

fn configure #

fn configure() !

fn delete #

fn delete(args ArgsGet) !

fn example_configure #

fn example_configure() !

fn exists #

fn exists(args ArgsGet) !bool

does the config exists?

fn fix #

fn fix() !

fn get #

fn get(args ArgsGet) !&CoreDNS

fn heroscript_dumps #

fn heroscript_dumps(obj CoreDNS) !string

///////////NORMALLY NO NEED TO TOUCH

fn heroscript_loads #

fn heroscript_loads(heroscript string) !CoreDNS

fn list #

fn list(args ArgsList) ![]&CoreDNS

if fromdb set: load from filesystem, and not from mem, will also reset what is in mem

fn new #

fn new(args ArgsGet) !&CoreDNS

fn play #

fn play(mut plbook PlayBook) !

fn set #

fn set(o CoreDNS) !

register the config for the future

fn switch #

fn switch(name string)

switch instance to be used for coredns

struct ArgsGet #

@[params]
struct ArgsGet {
pub mut:
	name   string = 'default'
	fromdb bool // will load from filesystem
	create bool // default will not create if not exist
}

///////FACTORY

struct ArgsList #

@[params]
struct ArgsList {
pub mut:
	fromdb bool // will load from filesystem
}

struct CoreDNS #

@[heap]
struct CoreDNS {
pub mut:
	name          string = 'default'
	config_path   string
	config_url    string // path to Corefile through e.g. git url, will pull it if it is not local yet
	dnszones_path string // path to where all the dns zones are
	dnszones_url  string // path on git url pull if needed (is comma or \n separated list)
	plugins       string // list of plugins to build CoreDNS with (is comma or \n separated list)
	example       bool = true // if true we will install examples
}

THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED

fn (CoreDNS) build #

fn (mut self CoreDNS) build() !

fn (CoreDNS) destroy #

fn (mut self CoreDNS) destroy() !

fn (CoreDNS) install #

fn (mut self CoreDNS) install(args InstallArgs) !

fn (CoreDNS) install_start #

fn (mut self CoreDNS) install_start(args InstallArgs) !

fn (CoreDNS) reload #

fn (mut self CoreDNS) reload() !

load from disk and make sure is properly intialized

fn (CoreDNS) restart #

fn (mut self CoreDNS) restart() !

fn (CoreDNS) running #

fn (mut self CoreDNS) running() !bool

fn (CoreDNS) start #

fn (mut self CoreDNS) start() !

fn (CoreDNS) stop #

fn (mut self CoreDNS) stop() !

struct InstallArgs #

@[params]
struct InstallArgs {
pub mut:
	reset bool
}