add-ssh-web-app.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #cloud-config
  2. # Add groups to the system
  3. # Adds the ubuntu group with members 'root' and 'sys'
  4. # and the empty group hashicorp.
  5. groups:
  6. - ubuntu: [root,sys]
  7. - 3nets
  8. # Add users to the system. Users are added after groups are added.
  9. users:
  10. - default
  11. - name: 3nets
  12. gecos: 3nets
  13. shell: /bin/bash
  14. primary_group: 3nets
  15. sudo: ALL=(ALL) NOPASSWD:ALL
  16. groups: users, admin
  17. lock_passwd: false
  18. ssh_authorized_keys: "${ssh_key}"
  19. ssh_file_name: "${ssh_public_key_file}"
  20. # Downloads the golang package
  21. packages:
  22. - golang-go
  23. - wireguard
  24. - wireguard-tools
  25. # Sets the GOPATH & downloads the demo payload
  26. runcmd:
  27. - sudo su 3nets
  28. - sudo mkdir /home/3nets/go
  29. - sudo chown 3nets:3nets /home/3nets/go
  30. - export GOPATH=/home/3nets/go
  31. - export HOME=/home/3nets/
  32. - cd /home/3nets/
  33. - git clone https://notabug.org/pellucide/gowireguard.git
  34. - cd /home/3nets/gowireguard/cmd
  35. - bash build.sh
  36. - sudo chown -R 3nets:3nets /home/3nets/gowireguard
  37. - sudo chown -R 3nets:3nets /home/3nets/go
  38. - sudo ./wireguardEdgeClient &
  39. write_files:
  40. - path: /etc/3nets.conf
  41. owner: root:root
  42. permissions: "0644"
  43. content: "Signature=\"${Signature}\" \nManagerIp=\"${ManagerIp}\"\n"