diff --git a/tfrobot/example/conf.json b/tfrobot/example/conf.json index 702d5a55d..7bec1ec4c 100644 --- a/tfrobot/example/conf.json +++ b/tfrobot/example/conf.json @@ -36,7 +36,8 @@ "env_vars": { "user": "user1", "pwd": "1234" - } + }, + "wireguard": false } ], "ssh_keys": { diff --git a/tfrobot/example/conf.yaml b/tfrobot/example/conf.yaml index 494819c8f..3892bda94 100644 --- a/tfrobot/example/conf.yaml +++ b/tfrobot/example/conf.yaml @@ -29,6 +29,7 @@ vms: env_vars: # env vars are passed to the newly created vms user: user1 pwd: 1234 + wireguard: false ssh_keys: # map of ssh keys with key=name and value=the actual ssh key example1: ssh_key1 diff --git a/tfrobot/example/test.yaml b/tfrobot/example/test.yaml index 3bdef9760..8b3f1a8d3 100644 --- a/tfrobot/example/test.yaml +++ b/tfrobot/example/test.yaml @@ -16,6 +16,11 @@ node_groups: free_cpu: 2 free_mru: 8 + - name: group_d + nodes_count: 2 + free_cpu: 1 + free_mru: 4 + vms: - name: example_a #test deployment of vms with public ip vms_count: 3 @@ -49,5 +54,15 @@ vms: entry_point: /sbin/zinit init ssh_key: key1 + - name: example_d #test deployment with wireguard access + vms_count: 2 + node_group: group_d + cpu: 1 + mem: 1 + wireguard: true + flist: https://hub.grid.tf/tf-official-apps/base:latest.flist + entry_point: /sbin/zinit init + ssh_key: key1 + ssh_keys: key1: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsnouceyLPDj1OFjMO0amzznxbSurxLbZ21WEY5o6uaBuhAlDa2zMIvN8gmeZZeJcKHZfOZI0+atVo0FCjFc2VWZX7LwasW4Lbb2MV3xk4RTlkIRlKov/Iyj8lcAXEnFIV81fpLZtTmk6ERp5gYIBYP2n5CISK0lCiWeu/QFerYa9lb1cYpo/+epSREts4ka80XifA12kWMKfDNJKcWqv4EZZyRyPTVTTxKSJzHahu+J+Kpg+fs65toRaDAuXDzwBLJ/d2qCeR3dfbJl681jiFUlS46ap4njSrnGLssSSwpbhxPEWF3lJ+mQFn14aPLQikq4lOhGUhq7BCYQH9RNkZ diff --git a/tfrobot/pkg/deployer/deployer.go b/tfrobot/pkg/deployer/deployer.go index 4fc067334..047d483e6 100644 --- a/tfrobot/pkg/deployer/deployer.go +++ b/tfrobot/pkg/deployer/deployer.go @@ -326,7 +326,6 @@ func buildNetworkDeployment(vm Vms, nodeID uint32, name, solutionType string) wo myceliumKeys[nodeID] = key } - return workloads.ZNet{ Name: fmt.Sprintf("%s_network", name), Description: "network for mass deployment", @@ -335,7 +334,7 @@ func buildNetworkDeployment(vm Vms, nodeID uint32, name, solutionType string) wo IP: net.IPv4(10, 20, 0, 0), Mask: net.CIDRMask(16, 32), }), - AddWGAccess: false, + AddWGAccess: vm.WireGuard, MyceliumKeys: myceliumKeys, SolutionType: solutionType, } diff --git a/tfrobot/pkg/deployer/types.go b/tfrobot/pkg/deployer/types.go index a1ba42bcf..a3ade0459 100644 --- a/tfrobot/pkg/deployer/types.go +++ b/tfrobot/pkg/deployer/types.go @@ -43,6 +43,7 @@ type Vms struct { Entrypoint string `yaml:"entry_point" validate:"required" json:"entry_point"` SSHKey string `yaml:"ssh_key" validate:"required" json:"ssh_key"` EnvVars map[string]string `yaml:"env_vars" json:"env_vars"` + WireGuard bool `yaml:"wireguard" json:"wireguard"` } type Disk struct {