Guest User

Untitled

a guest
Sep 16th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.46 KB | None | 0 0
  1. #cloud-config
  2. # vim: syntax=yaml
  3. #
  4.  
  5. # The current version of cloud-init in the Hypriot rpi-64 is 0.7.9
  6. # When dealing with cloud-init, it is SUPER important to know the version
  7. # I have wasted many hours creating servers to find out the module I was trying to use wasn't in the cloud-init version I had
  8. # Documentation: http://cloudinit.readthedocs.io/en/0.7.9/index.html
  9.  
  10. # Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
  11. hostname: fridge-watch
  12. manage_etc_hosts: true
  13. apt_preserve_sources_list: true
  14.  
  15. # You could modify this for your own user information
  16. users:
  17.   - name: fridge
  18.     gecos: "Hypriot Pirate"
  19.     sudo: ALL=(ALL) NOPASSWD:ALL
  20.     shell: /bin/bash
  21.     groups: users,docker,video
  22.     passwd: lolno
  23.     ssh_pwauth: true
  24.     chpasswd: { expire: false }
  25.     ssh-import-id: None
  26.     lock_passwd: false
  27.     ssh-authorized-keys:
  28.      - lolno
  29. # # Set the locale of the system
  30. locale: "en_US.UTF-8"
  31.  
  32. # # Set the timezone
  33. # # Value of 'timezone' must exist in /usr/share/zoneinfo
  34. timezone: "America/Chicago"
  35.  
  36. # # Update apt packages on first boot
  37. package_update: true
  38. package_upgrade: true
  39. package_reboot_if_required: true
  40.  
  41. # # Install any additional apt packages you need here
  42. packages:
  43.  - ntp
  44.   - git
  45.   - snmp
  46.   - snmpd
  47.  
  48. # # WiFi connect to HotSpot
  49. # To make wifi work with RPi3 and RPi0
  50. # you also have to set "enable_uart=0" in config.txt
  51. # See no-uart-config.txt for an example.
  52. #
  53. # # - use `wpa_passphrase SSID PASSWORD` to encrypt the psk
  54. write_files:
  55.   - content: |
  56.      allow-hotplug wlan0
  57.       iface wlan0 inet dhcp
  58.       wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  59.       iface default inet dhcp
  60.     path: /etc/network/interfaces.d/wlan0
  61.   - content: |
  62.      country=US
  63.       ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
  64.       update_config=1
  65.       network={
  66.       ssid="lolno"
  67.       psk=lolno
  68.       proto=RSN
  69.       key_mgmt=WPA-PSK
  70.       pairwise=CCMP
  71.       auth_alg=OPEN
  72.       }
  73.     path: /etc/wpa_supplicant/wpa_supplicant.conf
  74.   - content: |
  75.      #!/bin/bash
  76.       git clone "https://github.com/stephanGarland/useful-scripts"
  77.       ./useful-scripts/main.sh unattended
  78.     permissions: "0755"
  79.     path: /run/useful.sh
  80.  
  81. # These commands will be ran once on first boot only
  82. runcmd:
  83.  # Pickup the hostname changes
  84.   - 'systemctl restart avahi-daemon'
  85.  
  86.   # Activate WiFi interface
  87.   - 'ifup wlan0'
  88.  
  89.   # Clone and run useful-scripts
  90.   - [ bash, /run/useful.sh ]
Add Comment
Please, Sign In to add comment