forked from neophenix/lxdepot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.yaml
111 lines (100 loc) · 4.33 KB
/
sample.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# This sample config should have an example of every option available
# if not pull requests welcome
# PKI files can take two forms
# first is file:PATH if we see file: we will read the contents off disk
cert: file:/path/to/client/cert/here/cert.crt
# Next you can just put the contents here
key: |
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
# lxdhosts is an array of the hosts we will operate against
lxdhosts:
# host is the ip or hostname we will use to communicate
- host: 192.168.1.100
# name is an alias for more human consumption
name: mylxdhost
# the port that lxd listens on
port: 8443
# the server cert can be a file path or contents like our client PKI
cert: file:/path/to/cert/server.crt
# dns lets us configure how our containers will get their IP addresses
dns:
# what provider to use (google / amazon / dhcp)
provider: google
# list of network blocks to look for a free IP in, inclusive (if we aren't using dhcp)
network_blocks:
- 10.0.0.0/32,10.0.1.255/32
- 10.1.1.200/32,10.1.1.250/32
# DNS ttl
ttl: 300
# The zone that will be appended to our container names
# ex mycontainer would become mycontainer.dev.example.com
zone: dev.example.com
# provider options (dependent on provider)
options:
# GCP Options
# Path to our GCP service account credentials file for adding and removing entries
gcp_creds_file: /path/to/creds/service_account.json
# our GCP project name
gcp_project_name: example.com:dev
# our GCP DNS zone name
gcp_zone_name: example-dev-zone
# AWS (Route 53) Options
# Path to the shared credentials file as that seems recommended
aws_creds_file: /path/to/shared/creds/file
# Profile within the creds file to use
aws_creds_profile: default
# Hosted zone id
aws_zone_id: THISIS123ATEST
# networking currently houses "files" that will be parsed through text/template and passed
# an IP to fill out, these are then uploaded to the container after creation and before starting
#
# The OS, etc is current hardcorded into the create container handler
networking:
# The OS name + release here has to match the image.os returned by LXD for it to run
Centos7:
# each network config script needs a remote path to tell lxdepot where to upload and a template
- remote_path: /etc/sysconfig/network-scripts/ifcfg-eth0
template: |
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR={{.IP}}
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=1.1.1.1
DOMAIN="dev.example.com"
# bootstrap is a list of things we do after container start to get it into something we can use
# this can upload files and run commands. Steps are run sequentially
bootstrap:
# Like in networking, the OS name + release here has to match the image.os returned by LXD for it to run
Centos7:
# file upload example. a lack of local_path and a remote_path ending in / tells the system
# that we want to create a directory
- type: file
# perms set the permissions on the file in the container
perms: 0700
remote_path: /root/.ssh/
# this time we want to take a local file and upload its contents to the remote_path
- type: file
perms: 0600
local_path: /var/tmp/root_auth_keys
remote_path: /root/.ssh/authorized_keys
# now using a command we can do things like install a ssh server
- type: command
command: [yum, -y, install, openssh-server]
# and we can run a custom file we uploaded
- type: command
command: [/tmp/bootstrap.sh]
# playbooks is a section to define anything else users might want to run on a container.
# this would be things like, installing the right packages for a dev environment
playbooks:
# Like above, the OS name + release here has to match the image.os returned by LXD for it to run
Centos7:
# next we have a name of the playbook that your users would understand
setupdev:
# each section here follows the same format as bootstrap
- type: command
command: [yum, -y, install, golang]