├── .gitignore ├── .travis.yml ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── Vagrantfile ├── files ├── centos │ ├── librenms.conf │ └── nginx.conf └── ubuntu │ ├── librenms.conf │ └── nginx.conf ├── http ├── ubuntu-20.04 │ ├── meta-data │ └── user-data └── ubuntu-22.04 │ ├── meta-data │ └── user-data ├── release.sh ├── scripts ├── common │ ├── clean_users.sh │ ├── finish.sh │ ├── minimize.sh │ ├── sshd.sh │ └── vagrant.sh └── ubuntu │ ├── cleanup.sh │ ├── init.sh │ ├── librenms.sh │ ├── minimize.sh │ ├── oxidized.sh │ ├── syslog-ng.sh │ ├── update.sh │ ├── virtualbox.sh │ └── vmware.sh ├── spec ├── epel_spec.rb ├── network_spec.rb ├── selinux_spec.rb ├── spec_helper.rb ├── sshd_spec.rb ├── time_spec.rb ├── vagrant_spec.rb ├── virtualbox_spec.rb └── vmware_spec.rb ├── ubuntu-22.04-amd64.json ├── upload.sh ├── vagrantfile_templates ├── freebsd.rb └── openbsd.rb └── vars ├── development.json └── release.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.box 2 | .bundle/ 3 | .vagrant/ 4 | output-*/ 5 | packer_cache/ 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.5 4 | install: 5 | - bundle update --bundler 6 | - bundle install 7 | - curl -L -o packer.zip https://releases.hashicorp.com/packer/1.7.3/packer_1.7.3_linux_amd64.zip && unzip -d bin packer.zip 8 | script: 9 | - PATH=$(pwd)/bin:$PATH bundle exec rake 10 | - find . -name \*.sh -exec bash -n {} \; 11 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | group :test do 4 | gem 'rainbow' 5 | gem 'rake' 6 | gem 'serverspec' 7 | end 8 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | diff-lcs (1.3) 5 | multi_json (1.12.1) 6 | net-scp (1.2.1) 7 | net-ssh (>= 2.6.5) 8 | net-ssh (4.1.0) 9 | net-telnet (0.1.1) 10 | rainbow (2.2.2) 11 | rake 12 | rake (12.3.3) 13 | rspec (3.6.0) 14 | rspec-core (~> 3.6.0) 15 | rspec-expectations (~> 3.6.0) 16 | rspec-mocks (~> 3.6.0) 17 | rspec-core (3.6.0) 18 | rspec-support (~> 3.6.0) 19 | rspec-expectations (3.6.0) 20 | diff-lcs (>= 1.2.0, < 2.0) 21 | rspec-support (~> 3.6.0) 22 | rspec-its (1.2.0) 23 | rspec-core (>= 3.0.0) 24 | rspec-expectations (>= 3.0.0) 25 | rspec-mocks (3.6.0) 26 | diff-lcs (>= 1.2.0, < 2.0) 27 | rspec-support (~> 3.6.0) 28 | rspec-support (3.6.0) 29 | serverspec (2.40.0) 30 | multi_json 31 | rspec (~> 3.0) 32 | rspec-its 33 | specinfra (~> 2.68) 34 | sfl (2.3) 35 | specinfra (2.70.1) 36 | net-scp 37 | net-ssh (>= 2.7, < 5.0) 38 | net-telnet 39 | sfl 40 | 41 | PLATFORMS 42 | ruby 43 | 44 | DEPENDENCIES 45 | rainbow 46 | rake 47 | serverspec 48 | 49 | BUNDLED WITH 50 | 1.15.3 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Satoshi Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Usage 3 | 4 | Clone the repository: 5 | 6 | ```bash 7 | git clone https://github.com/librenms/packer-builds && cd packer-builds 8 | ``` 9 | 10 | Install requirements: 11 | 12 | - [packer.io](https://packer.io/downloads.html) 13 | - [VirtualBox](https://www.virtualbox.org/wiki/Linux_Downloads) 14 | 15 | ## Configuration 16 | 17 | You can configure each template to match your requirements by setting the following [user variables](https://packer.io/docs/templates/user-variables.html). 18 | 19 | User Variable | Default Value | Description 20 | ---------------------|---------------|---------------------------------------------------------------------------------------- 21 | `cpus` | 1 | Number of CPUs 22 | `disk_size` | 40000 | [Documentation](https://packer.io/docs/builders/virtualbox-iso.html#disk_size) 23 | `headless` | 0 | [Documentation](https://packer.io/docs/builders/virtualbox-iso.html#headless) 24 | `memory` | 512 | Memory size in MB 25 | `mirror` | | A URL of the mirror where the ISO image is available 26 | `librenms_version` | master | Available options are master or release, master will be up to the latest commit and release will be the latest tag 27 | `oxidized` | true | Install Oxidized as part of the image 28 | `syslog_ng` | true | Install and configure Syslog-NG 29 | 30 | ### Example 31 | 32 | Build a LibreNMS Ubuntu 22.04 (NGINX) box with a 10GB hard disk using the VirtualBox provider: 33 | 34 | ```bash 35 | packer build -only=virtualbox-iso -var disk_size=10000 ubuntu-22.04-amd64.json 36 | ``` 37 | 38 | If running on a remote system over ssh, or on a system without a graphical 39 | console, add `-var headless=true` 40 | 41 | For debugging, run with `PACKER_LOG=1` and/or check `~/.config/VirtualBox/VBoxSVC.log` 42 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'json' 2 | require 'net/http' 3 | require 'pathname' 4 | require 'rainbow' 5 | require 'rspec/core/rake_task' 6 | require 'uri' 7 | 8 | VAGRANT_PROVIDERS = { 9 | virtualbox: { 10 | builder_type: 'virtualbox-iso' 11 | }, 12 | vmware_desktop: { 13 | builder_type: 'vmware-iso' 14 | } 15 | }.freeze 16 | 17 | task default: ['packer:validate', 'packer:check_iso_url'] 18 | 19 | namespace :packer do 20 | desc 'Validate all the packer templates' 21 | task :validate do 22 | Pathname.glob('*.json').sort.each do |template| 23 | puts Rainbow("Validating #{template}...").green 24 | unless system "packer validate #{template}" 25 | puts Rainbow("#{template} is not a valid packer template").red 26 | raise "#{template} is not a valid packer template" 27 | end 28 | end 29 | end 30 | 31 | desc 'Check if all the ISO URLs are available' 32 | task :check_iso_url do 33 | Pathname.glob('*.json').sort.each do |template| 34 | json = JSON.parse(template.read) 35 | mirror = json['variables']['mirror'] 36 | iso = json['variables']['iso_name'] 37 | iso_urls = json['builders'].map do |builder| 38 | builder['iso_urls'].at(1).sub('{{ user `mirror` }}', mirror).sub('{{ user `iso_name` }}', iso) 39 | end 40 | iso_urls.uniq.each do |iso_url| 41 | puts Rainbow("Checking if #{iso_url} is available...").green 42 | request_head(iso_url) do |response| 43 | unless available?(response) 44 | puts Rainbow("#{iso_url} is not available: uri=#{response.uri}, message=#{response.message}").red 45 | raise "#{iso_url} is not available" 46 | end 47 | end 48 | end 49 | end 50 | end 51 | 52 | end 53 | 54 | desc 'Run serverspec tests' 55 | RSpec::Core::RakeTask.new(:spec, :host) do |_t, args| 56 | ENV['HOST'] = args[:host] 57 | end 58 | 59 | def request_head(uri, &block) 60 | uri = URI(uri) 61 | response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http| 62 | http.request_head(uri) 63 | end 64 | if response.is_a?(Net::HTTPRedirection) 65 | request_head(response['Location'], &block) 66 | else 67 | yield response 68 | end 69 | end 70 | 71 | def available?(response) 72 | response.is_a?(Net::HTTPSuccess) 73 | end 74 | 75 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 | # configures the configuration version (we support older styles for 6 | # backwards compatibility). Please don't change it unless you know what 7 | # you're doing. 8 | Vagrant.configure("2") do |config| 9 | # The most common configuration options are documented and commented below. 10 | # For a complete reference, please see the online documentation at 11 | # https://docs.vagrantup.com. 12 | 13 | # Every Vagrant development environment requires a box. You can search for 14 | # boxes at https://vagrantcloud.com/search. 15 | config.vm.box = "librenms-test" 16 | 17 | # Disable automatic box update checking. If you disable this, then 18 | # boxes will only be checked for updates when the user runs 19 | # `vagrant box outdated`. This is not recommended. 20 | # config.vm.box_check_update = false 21 | 22 | # Create a forwarded port mapping which allows access to a specific port 23 | # within the machine from a port on the host machine. In the example below, 24 | # accessing "localhost:8080" will access port 80 on the guest machine. 25 | # NOTE: This will enable public access to the opened port 26 | # config.vm.network "forwarded_port", guest: 80, host: 8080 27 | 28 | # Create a forwarded port mapping which allows access to a specific port 29 | # within the machine from a port on the host machine and only allow access 30 | # via 127.0.0.1 to disable public access 31 | # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" 32 | 33 | # Create a private network, which allows host-only access to the machine 34 | # using a specific IP. 35 | # config.vm.network "private_network", ip: "192.168.33.10" 36 | 37 | # Create a public network, which generally matched to bridged network. 38 | # Bridged networks make the machine appear as another physical device on 39 | # your network. 40 | # config.vm.network "public_network" 41 | 42 | # Share an additional folder to the guest VM. The first argument is 43 | # the path on the host to the actual folder. The second argument is 44 | # the path on the guest to mount the folder. And the optional third 45 | # argument is a set of non-required options. 46 | # config.vm.synced_folder "../data", "/vagrant_data" 47 | 48 | # Provider-specific configuration so you can fine-tune various 49 | # backing providers for Vagrant. These expose provider-specific options. 50 | # Example for VirtualBox: 51 | # 52 | # config.vm.provider "virtualbox" do |vb| 53 | # # Display the VirtualBox GUI when booting the machine 54 | # vb.gui = true 55 | # 56 | # # Customize the amount of memory on the VM: 57 | # vb.memory = "1024" 58 | # end 59 | # 60 | # View the documentation for the provider you are using for more 61 | # information on available options. 62 | 63 | # Enable provisioning with a shell script. Additional provisioners such as 64 | # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the 65 | # documentation for more information about their specific syntax and use. 66 | # config.vm.provision "shell", inline: <<-SHELL 67 | # apt-get update 68 | # apt-get install -y apache2 69 | # SHELL 70 | end 71 | -------------------------------------------------------------------------------- /files/centos/librenms.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name librenms.example.com; 4 | root /opt/librenms/html; 5 | index index.php; 6 | 7 | charset utf-8; 8 | gzip on; 9 | gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; 10 | location / { 11 | try_files $uri $uri/ /index.php?$query_string; 12 | } 13 | location /api/v0 { 14 | try_files $uri $uri/ /api_v0.php?$query_string; 15 | } 16 | location ~ \.php { 17 | include fastcgi.conf; 18 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 19 | fastcgi_pass unix:/var/run/php-fpm/php7.2-fpm.sock; 20 | } 21 | location ~ /\.ht { 22 | deny all; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /files/centos/nginx.conf: -------------------------------------------------------------------------------- 1 | # For more information on configuration, see: 2 | # * Official English Documentation: http://nginx.org/en/docs/ 3 | # * Official Russian Documentation: http://nginx.org/ru/docs/ 4 | 5 | user nginx; 6 | worker_processes auto; 7 | error_log /var/log/nginx/error.log; 8 | pid /run/nginx.pid; 9 | 10 | events { 11 | worker_connections 1024; 12 | } 13 | 14 | http { 15 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 16 | '$status $body_bytes_sent "$http_referer" ' 17 | '"$http_user_agent" "$http_x_forwarded_for"'; 18 | 19 | access_log /var/log/nginx/access.log main; 20 | 21 | sendfile on; 22 | tcp_nopush on; 23 | tcp_nodelay on; 24 | keepalive_timeout 65; 25 | types_hash_max_size 2048; 26 | 27 | include /etc/nginx/mime.types; 28 | default_type application/octet-stream; 29 | 30 | # Load modular configuration files from the /etc/nginx/conf.d directory. 31 | # See http://nginx.org/en/docs/ngx_core_module.html#include 32 | # for more information. 33 | include /etc/nginx/conf.d/*.conf; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /files/ubuntu/librenms.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root /opt/librenms/html; 4 | index index.php; 5 | 6 | charset utf-8; 7 | gzip on; 8 | gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; 9 | location / { 10 | try_files $uri $uri/ /index.php?$query_string; 11 | } 12 | location ~ [^/]\.php(/|$) { 13 | fastcgi_pass unix:/run/php-fpm-librenms.sock; 14 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 15 | include fastcgi.conf; 16 | } 17 | location ~ /\.(?!well-known).* { 18 | deny all; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /files/ubuntu/nginx.conf: -------------------------------------------------------------------------------- 1 | # For more information on configuration, see: 2 | # * Official English Documentation: http://nginx.org/en/docs/ 3 | # * Official Russian Documentation: http://nginx.org/ru/docs/ 4 | 5 | user nginx; 6 | worker_processes auto; 7 | error_log /var/log/nginx/error.log; 8 | pid /run/nginx.pid; 9 | 10 | events { 11 | worker_connections 1024; 12 | } 13 | 14 | http { 15 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 16 | '$status $body_bytes_sent "$http_referer" ' 17 | '"$http_user_agent" "$http_x_forwarded_for"'; 18 | 19 | access_log /var/log/nginx/access.log main; 20 | 21 | sendfile on; 22 | tcp_nopush on; 23 | tcp_nodelay on; 24 | keepalive_timeout 65; 25 | types_hash_max_size 2048; 26 | 27 | include /etc/nginx/mime.types; 28 | default_type application/octet-stream; 29 | 30 | # Load modular configuration files from the /etc/nginx/conf.d directory. 31 | # See http://nginx.org/en/docs/ngx_core_module.html#include 32 | # for more information. 33 | include /etc/nginx/conf.d/*.conf; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /http/ubuntu-20.04/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/librenms/packer-builds/fc33d48f2108d65fc93cda04dafa32d3ad7b9826/http/ubuntu-20.04/meta-data -------------------------------------------------------------------------------- /http/ubuntu-20.04/user-data: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | autoinstall: 3 | version: 1 4 | identity: 5 | hostname: librenms 6 | password: $6$p7TmlCd1WIljlXVE$B8Yr1f6eVvQrlE5qsk3dp6heo1YveUdXBzXwYY5bhMlbcyl9rvZtH0AkW1ntiE2jgYA8GEQ4vx/lsjxYNwHuK. 7 | username: vagrant 8 | storage: 9 | layout: 10 | name: lvm 11 | update: true 12 | ssh: 13 | install-server: true 14 | allow-pw: true 15 | -------------------------------------------------------------------------------- /http/ubuntu-22.04/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/librenms/packer-builds/fc33d48f2108d65fc93cda04dafa32d3ad7b9826/http/ubuntu-22.04/meta-data -------------------------------------------------------------------------------- /http/ubuntu-22.04/user-data: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | autoinstall: 3 | version: 1 4 | locale: en_US.UTF-8 5 | refresh-installer: 6 | update: yes 7 | keyboard: 8 | layout: us 9 | network: 10 | network: 11 | version: 2 12 | ethernets: 13 | eth0: 14 | dhcp4: yes 15 | apt: 16 | primary: 17 | - arches: [default] 18 | uri: http://archive.ubuntu.com/ubuntu/ 19 | storage: 20 | swap: 21 | size: 0 22 | config: 23 | - { type: disk, id: disk-0, ptable: gpt, wipe: superblock-recursive, grub_device: true } 24 | - { type: partition, id: partition-0, number: 1, device: disk-0, size: 1M, wipe: superblock, flag: bios_grub } 25 | - { type: partition, id: partition-1, number: 2, device: disk-0, size: 512M, wipe: superblock, flag: boot } 26 | - { type: partition, id: partition-2, number: 3, device: disk-0, size: 8192M, wipe: superblock, flag: swap } 27 | - { type: partition, id: partition-3, number: 4, device: disk-0, size: -1, wipe: superblock } 28 | - { type: format, id: format-0, volume: partition-1, fstype: ext4 } 29 | - { type: format, id: format-1, volume: partition-2, fstype: swap } 30 | - { type: format, id: format-2, volume: partition-3, fstype: ext4 } 31 | - { type: mount, id: mount-0, device: format-0, path: /boot } 32 | - { type: mount, id: mount-1, device: format-1, path: none } 33 | - { type: mount, id: mount-2, device: format-2, path: / } 34 | identity: 35 | username: root 36 | hostname: ubuntu.localdomain 37 | password: "$6$pniguAcReslhK$wwOrj4o.CXt6HL7NiOZ2J7/UOC4ivAIVs8BU/h6qpRIBdWX824Qg.VQadCVQCAJNr4/Fv3J55Zf936Jm5dlKT/" 38 | ssh: 39 | install-server: yes 40 | authorized-keys: [] 41 | allow-pw: yes 42 | user-data: 43 | disable_root: false 44 | packages: 45 | - ca-certificates 46 | - cloud-guest-utils 47 | - cloud-init 48 | - curl 49 | - e2fsprogs 50 | - iproute2 51 | - openssh-server 52 | - perl 53 | - python3 54 | - rsync 55 | - sudo 56 | early-commands: 57 | - systemctl stop ssh.service 58 | late-commands: 59 | - | 60 | curtin in-target --target=/target -- /bin/bash -c ' \ 61 | echo "root:vagrant" | chpasswd; \ 62 | rm -rf /root/.bash_logout; \ 63 | mkdir -p /root/.ssh; \ 64 | chmod 0700 /root/.ssh; \ 65 | echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > /root/.ssh/authorized_keys; \ 66 | chmod 0600 /root/.ssh/authorized_keys; \ 67 | chown -Rf root:root /root; \ 68 | groupadd -g 1000 vagrant; \ 69 | useradd -g 1000 -u 1000 -d /home/vagrant -s /bin/bash -m vagrant; \ 70 | echo "vagrant:vagrant" | chpasswd; \ 71 | rm -rf /home/vagrant/.bash_logout; \ 72 | mkdir -p /home/vagrant/.ssh; \ 73 | chmod 0700 /home/vagrant/.ssh; \ 74 | echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > /home/vagrant/.ssh/authorized_keys; \ 75 | chmod 0600 /home/vagrant/.ssh/authorized_keys; \ 76 | chown -Rf vagrant:vagrant /home/vagrant; \ 77 | mkdir -p /etc/sudoers.d; \ 78 | chmod 0755 /etc/sudoers.d; \ 79 | echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant; \ 80 | chmod 0440 /etc/sudoers.d/vagrant; \ 81 | chown -Rf root:root /etc/sudoers.d; \ 82 | sed -ie "s/^[#\s]*UseDNS.*$/UseDNS no/g" /etc/ssh/sshd_config; \ 83 | ssh-keygen -A; \ 84 | systemctl enable ssh.service; \ 85 | sed -ie "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=\"0\"/g" /etc/default/grub; \ 86 | sed -ie "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0 systemd.unified_cgroup_hierarchy=0\"/g" /etc/default/grub; \ 87 | sed -ie "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"net.ifnames=0 biosdevname=0 systemd.unified_cgroup_hierarchy=0\"/g" /etc/default/grub; \ 88 | update-grub; \ 89 | update-initramfs -c -k all; \ 90 | mkdir -p /etc/ssh/sshd_config.d; \ 91 | echo "PubkeyAcceptedKeyTypes +ssh-rsa" > /etc/ssh/sshd_config.d/10-PubkeyAcceptedKeyTypes-ssh-rsa.conf; \ 92 | chmod 600 /etc/ssh/sshd_config.d/10-PubkeyAcceptedKeyTypes-ssh-rsa.conf; \ 93 | mkdir -p /etc/ssh/ssh_config.d; \ 94 | echo "Host *" >> /etc/ssh/ssh_config.d/10-PubkeyAcceptedKeyTypes-ssh-rsa.conf; \ 95 | echo " HostkeyAlgorithms +ssh-rsa" >> /etc/ssh/ssh_config.d/10-PubkeyAcceptedKeyTypes-ssh-rsa.conf; \ 96 | echo " PubkeyAcceptedKeyTypes +ssh-rsa" >> /etc/ssh/ssh_config.d/10-PubkeyAcceptedKeyTypes-ssh-rsa.conf; \ 97 | chmod 644 /etc/ssh/ssh_config.d/10-PubkeyAcceptedKeyTypes-ssh-rsa.conf; \ 98 | apt-get -y purge snapd; \ 99 | systemctl disable apt-daily.service; \ 100 | systemctl disable apt-daily.timer; \ 101 | systemctl disable apt-daily-upgrade.service; \ 102 | systemctl disable apt-daily-upgrade.timer; \ 103 | exit 0 \ 104 | ' 105 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURL='/usr/bin/env curl' 4 | JQ='/usr/bin/env jq' 5 | PACKER='/usr/bin/env packer' 6 | RE='^[0-9]+([.][0-9]+)?$' 7 | FIND='/usr/bin/env find' 8 | IMAGES="centos-7.6-x86_64 9 | ubuntu-18.04-amd64" 10 | BUILDERS="virtualbox-iso" 11 | 12 | echo "Removing old files in output dirs" 13 | FILES=$($FIND ./output-* -type f -print) 14 | for FILE in $FILES; do 15 | echo "Removing $FILE" 16 | rm -f $FILE 17 | done 18 | 19 | echo "Please enter your GitHub personal access token (we don't save it):" 20 | read -s TOKEN 21 | 22 | LATEST_TAG=$($CURL -s https://api.github.com/repos/librenms/librenms/releases/latest | $JQ -r ".tag_name") 23 | 24 | if ! [[ "$LATEST_TAG" =~ $RE ]] ; then 25 | echo "Tag not found"; exit 1; 26 | fi 27 | 28 | echo "Tag $LATEST_TAG, found, building images" 29 | 30 | for IMAGE in $IMAGES; do 31 | for BUILDER in $BUILDERS; do 32 | echo "Building $IMAGE with $BUILDER" 33 | BUILD=$($PACKER build -force -only=$BUILDER -var "librenms_version=$LATEST_TAG" -var 'headless=true' $IMAGE.json) 34 | if [ $? != 0 ] ; then 35 | echo "Build failed:" 36 | echo $BUILD 37 | else 38 | echo "Build completed" 39 | fi 40 | done 41 | done 42 | 43 | echo "Creating new release $LATEST_TAG" 44 | 45 | UPLOAD_URL=$($CURL -s https://api.github.com/repos/librenms/packer-builds/releases -H "Authorization: token $TOKEN" -X POST --header "Content-Type: application/json" -d "{\"tag_name\":\"$LATEST_TAG\",\"name\":\"v$LATEST_TAG\"}" | $JQ -r ".upload_url") 46 | UPLOAD_URL="${UPLOAD_URL//\{\?name,label\}/}" 47 | FILES=$($FIND ./output-* -type f -print) 48 | for FILE in $FILES; do 49 | IFS='/' read -a OVA <<< "$FILE" 50 | NAME=${OVA[2]} 51 | echo "$CURL -s \"$UPLOAD_URL?name=$NAME\" -H \"Authorization: token \" --data-binary @\"$FILE\" -H \"Content-Type: application/tar\"" 52 | UPLOAD=$($CURL -s "$UPLOAD_URL?name=$NAME" -H "Authorization: token $TOKEN" --data-binary @"$FILE" -H "Content-Type: application/tar") 53 | if [ $? != 0 ] ; then 54 | echo "Upload failed:" 55 | echo $UPLOAD 56 | else 57 | echo "Upload completed" 58 | fi 59 | done 60 | -------------------------------------------------------------------------------- /scripts/common/clean_users.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | set -x 5 | 6 | sudo bash -c 'cat < /etc/sudoers.d/vagrant 7 | Defaults:vagrant !requiretty 8 | vagrant ALL=(ALL) NOPASSWD: ALL 9 | EOF' 10 | 11 | sudo chmod 440 /etc/sudoers.d/vagrant 12 | -------------------------------------------------------------------------------- /scripts/common/finish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | set -x 5 | 6 | # Remove rrd folders for data is clean 7 | sudo rm -Rf /opt/librenms/rrd/* 8 | -------------------------------------------------------------------------------- /scripts/common/minimize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | set -x 5 | 6 | sudo dd if=/dev/zero of=/EMPTY bs=1M || : 7 | sudo rm /EMPTY 8 | 9 | # In CentOS 7, blkid returns duplicate devices 10 | swap_device_uuid=`sudo /sbin/blkid -t TYPE=swap -o value -s UUID | uniq` 11 | swap_device_label=`sudo /sbin/blkid -t TYPE=swap -o value -s LABEL | uniq` 12 | if [ -n "$swap_device_uuid" ]; then 13 | swap_device=`readlink -f /dev/disk/by-uuid/"$swap_device_uuid"` 14 | elif [ -n "$swap_device_label" ]; then 15 | swap_device=`readlink -f /dev/disk/by-label/"$swap_device_label"` 16 | fi 17 | sudo /sbin/swapoff "$swap_device" 18 | sudo dd if=/dev/zero of="$swap_device" bs=1M || : 19 | sudo /sbin/mkswap ${swap_device_label:+-L "$swap_device_label"} ${swap_device_uuid:+-U "$swap_device_uuid"} "$swap_device" 20 | -------------------------------------------------------------------------------- /scripts/common/sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | set -x 5 | 6 | sudo tee -a /etc/ssh/sshd_config < Cleaning up udev rules" 7 | rm -rf /dev/.udev/ 8 | rm -f /lib/udev/rules.d/75-persistent-net-generator.rules 9 | echo "==> Cleaning up tmp" 10 | rm -rf /tmp/* 11 | 12 | # Cleanup apt cache 13 | apt-get -y autoremove --purge 14 | apt-get -y clean 15 | 16 | echo "==> Installed packages" 17 | dpkg --get-selections | grep -v deinstall 18 | 19 | DISK_USAGE_BEFORE_CLEANUP=$(df -h) 20 | 21 | # Remove Bash history 22 | unset HISTFILE 23 | rm -f /root/.bash_history 24 | rm -f /home/${SSH_USER}/.bash_history 25 | 26 | # Clean up log files 27 | find /var/log -type f | while read f; do echo -ne '' > "${f}"; done; 28 | 29 | echo "==> Clearing last login information" 30 | >/var/log/lastlog 31 | >/var/log/wtmp 32 | >/var/log/btmp 33 | 34 | echo '==> Clear out swap and disable until reboot' 35 | set +e 36 | swapuuid=$(/sbin/blkid -o value -l -s UUID -t TYPE=swap) 37 | case "$?" in 38 | 2|0) ;; 39 | *) exit 1 ;; 40 | esac 41 | set -e 42 | if [ "x${swapuuid}" != "x" ]; then 43 | # Whiteout the swap partition to reduce box size 44 | # Swap is disabled till reboot 45 | swappart=$(readlink -f /dev/disk/by-uuid/$swapuuid) 46 | /sbin/swapoff "${swappart}" 47 | dd if=/dev/zero of="${swappart}" bs=1M || echo "dd exit code $? is suppressed" 48 | /sbin/mkswap -U "${swapuuid}" "${swappart}" 49 | fi 50 | 51 | echo "==> Disk usage before cleanup" 52 | echo ${DISK_USAGE_BEFORE_CLEANUP} 53 | 54 | echo "==> Disk usage after cleanup" 55 | df -h 56 | 57 | echo '==> Clearing Ubuntu machine-id' 58 | sudo cp /dev/null /etc/machine-id 59 | 60 | sudo bash -c 'cat << EOF > /etc/netplan/01-netcfg.yaml 61 | network: 62 | version: 2 63 | renderer: networkd 64 | ethernets: 65 | eth: 66 | match: 67 | name: en* 68 | dhcp4: yes 69 | EOF' 70 | cloud-init clean --seed --logs 71 | -------------------------------------------------------------------------------- /scripts/ubuntu/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | sudo sed -i -e 's,^\(ACTIVE_CONSOLES="/dev/tty\).*,\11",' /etc/default/console-setup 7 | for f in /etc/init/tty[^1]*.conf; do 8 | sudo mv "$f"{,.bak} 9 | done 10 | -------------------------------------------------------------------------------- /scripts/ubuntu/librenms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | if [[ -z "$LIBRENMS_VERSION" ]]; then 4 | LIBRENMS_VERSION="master" 5 | fi 6 | echo '==> Aquiring prerequisite packages' 7 | apt -y install software-properties-common 8 | add-apt-repository universe 9 | apt -y update 10 | apt -y install acl curl fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php-cli php-curl php-fpm php-gd php-gmp php-json php-mbstring php-mysql php-snmp php-xml php-zip rrdtool snmp snmpd whois unzip python3-pymysql python3-dotenv python3-redis python3-setuptools python3-systemd python3-pip 11 | 12 | 13 | echo '==> Downloading LibreNMS' 14 | 15 | sudo useradd librenms -d /opt/librenms -M -s /bin/bash 16 | echo "librenms:CDne3fwdfds" | sudo chpasswd 17 | sudo usermod -a -G librenms www-data 18 | sudo bash -c 'cat < /etc/sudoers.d/librenms 19 | Defaults:librenms !requiretty 20 | librenms ALL=(ALL) NOPASSWD: ALL 21 | EOF' 22 | sudo chmod 440 /etc/sudoers.d/librenms 23 | 24 | cd /opt 25 | git clone --branch master --depth 1 https://github.com/librenms/librenms.git 26 | chown -R librenms:librenms /opt/librenms 27 | chmod 771 /opt/librenms 28 | setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/ 29 | setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/ 30 | cd /opt/librenms 31 | if [[ "$LIBRENMS_VERSION" == "release" ]]; then 32 | #sudo -u librenms git fetch --tags && sudo -u librenms git checkout $(sudo -u librenms git describe --tags $(sudo -u librenms git rev-list --tags --max-count=1)) 33 | RELEASE=$(sudo -u librenms git ls-remote --tags origin|tail -1|cut -d$'\t' -f1) 34 | sudo -u librenms git fetch origin "$RELEASE" 35 | sudo -u librenms git checkout "$RELEASE" 36 | #sudo -u librenms git checkout $(sudo -u librenms git fetch origin $(sudo -u librenms git ls-remote --tags origin|tail -1|cut -d$'\t' -f1)) 37 | fi 38 | echo '==> Running composer install' 39 | sudo -u librenms ./scripts/composer_wrapper.php install --no-dev 40 | 41 | echo '==> Configuring PHP' 42 | sudo sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php/8.1/fpm/php.ini 43 | sudo sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php/8.1/cli/php.ini 44 | mv /etc/php/8.1/fpm/pool.d/www.conf /etc/php/8.1/fpm/pool.d/librenms.conf 45 | sed -i "s/user = .*/user = librenms/" /etc/php/8.1/fpm/pool.d/librenms.conf 46 | sed -i "s/group = .*/group = librenms/" /etc/php/8.1/fpm/pool.d/librenms.conf 47 | sed -i "s|listen = .*|listen = /run/php-fpm-librenms.sock|" /etc/php/8.1/fpm/pool.d/librenms.conf 48 | systemctl restart php8.1-fpm.service 49 | systemctl enable php8.1-fpm.service 50 | 51 | echo '==> Installing lnms' 52 | ln -s /opt/librenms/lnms /usr/bin/lnms 53 | cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/ 54 | 55 | echo '==> Configuring nginx' 56 | sudo cp /tmp/librenms.conf /etc/nginx/conf.d/librenms.conf 57 | sudo rm -f /etc/nginx/sites-enabled/default 58 | sudo systemctl enable nginx 59 | sudo systemctl restart nginx 60 | 61 | echo '==> Configuring logrotate' 62 | sudo cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms 63 | 64 | echo '==> Installing RRDCached' 65 | sudo apt install -y rrdcached 66 | sudo mkdir /var/run/rrdcached 67 | sudo chown librenms:librenms /var/run/rrdcached 68 | sudo chmod 755 /var/run/rrdcached 69 | 70 | bash -c 'cat << EOF > /etc/default/rrdcached 71 | DAEMON=/usr/bin/rrdcached 72 | DAEMON_USER=librenms 73 | DAEMON_GROUP=librenms 74 | WRITE_THREADS=4 75 | WRITE_TIMEOUT=1800 76 | WRITE_JITTER=1800 77 | BASE_PATH=/opt/librenms/rrd/ 78 | JOURNAL_PATH=/var/lib/rrdcached/journal/ 79 | PIDFILE=/run/rrdcached.pid 80 | SOCKFILE=/run/rrdcached.sock 81 | SOCKGROUP=librenms 82 | BASE_OPTIONS="-B -F -R" 83 | EOF' 84 | chown librenms:librenms /var/lib/rrdcached/journal/ 85 | systemctl restart rrdcached.service 86 | 87 | echo '==> Installing mariadb database' 88 | sudo bash -c 'cat << EOF > /etc/mysql/mariadb.conf.d/99-librenms.cnf 89 | [server] 90 | innodb_file_per_table=1 91 | lower_case_table_names=0 92 | innodb_flush_log_at_trx_commit = 2 93 | EOF' 94 | 95 | sudo systemctl enable mariadb 96 | sudo systemctl restart mariadb 97 | 98 | mysql_pass="D42nf23rewD"; 99 | 100 | echo "CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; 101 | GRANT ALL PRIVILEGES ON librenms.* 102 | TO 'librenms'@'localhost' 103 | IDENTIFIED BY '$mysql_pass'; 104 | FLUSH PRIVILEGES;" | mysql -u root 105 | 106 | 107 | echo '==> Creating base config.php and .env' 108 | sudo cp /opt/librenms/config.php.default /opt/librenms/config.php 109 | echo \$config[\'db_host\'] = \'localhost\'\; | tee -a /opt/librenms/config.php 110 | echo \$config[\'db_user\'] = \'librenms\'\; | tee -a /opt/librenms/config.php 111 | echo \$config[\'db_pass\'] = \'$mysql_pass\'\; | tee -a /opt/librenms/config.php 112 | echo \$config[\'db_name\'] = \'librenms\'\; | tee -a /opt/librenms/config.php 113 | echo \$config[\'rrdcached\'] = \'unix:/var/run/rrdcached.sock\'\; | tee -a /opt/librenms/config.php 114 | 115 | echo "DB_HOST=localhost" | tee -a /opt/librenms/.env 116 | echo "DB_DATABASE=librenms" | tee -a /opt/librenms/.env 117 | echo "DB_USER=localhost" | tee -a /opt/librenms/.env 118 | echo "DB_PASSWORD=$mysql_pass" | tee -a /opt/librenms/.env 119 | echo "LIBRENMS_USER=librenms" | tee -a /opt/librenms/.env 120 | echo "APP_URL=/" | tee -a /opt/librenms/.env 121 | sed -i '/INSTALL=true/d' /opt/librenms/.env 122 | 123 | echo '==> Installing database & setting basic configs' 124 | 125 | sudo -u librenms /usr/bin/lnms --force -n migrate 126 | 127 | sudo -u librenms /usr/bin/lnms -n config:set update_channel $LIBRENMS_VERSION 128 | sudo -u librenms /usr/bin/lnms -n config:set service_poller_workers 4 129 | sudo -u librenms /usr/bin/lnms -n config:set show_services 1 130 | sudo -u librenms /usr/bin/lnms -n config:set service_services_enabled true 131 | sudo -u librenms /usr/bin/lnms -n config:set enable_billing 1 132 | 133 | echo '==> Setting up localhost snmpd' 134 | sudo bash -c 'cat < /etc/snmp/snmpd.conf 135 | rocommunity public 127.0.0.1 136 | extend distro /usr/bin/distro 137 | extend hardware "/bin/cat /sys/devices/virtual/dmi/id/product_name" 138 | extend manufacturer "/bin/cat /sys/devices/virtual/dmi/id/sys_vendor" 139 | EOF' 140 | sudo curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro 141 | sudo chmod +x /usr/bin/distro 142 | sudo systemctl restart snmpd 143 | sudo systemctl enable snmpd 144 | 145 | echo '==> Setting up dispatcher service' 146 | sudo -u librenms python3 -m pip install --user -r /opt/librenms/requirements.txt 147 | cp /opt/librenms/misc/librenms.service /etc/systemd/system/librenms.service 148 | systemctl enable librenms.service 149 | 150 | echo '==> Creating first user and device' 151 | sudo -u librenms /usr/bin/lnms -n user:add -p D32fwefwef -r admin -n librenms 152 | sudo -u librenms /usr/bin/lnms -n --v2c device:add localhost 153 | 154 | echo '==> Installing Weathermap plugin' 155 | sudo git clone https://github.com/librenms-plugins/Weathermap.git /opt/librenms/html/plugins/Weathermap/ 156 | echo "INSERT INTO plugins SET plugin_name = 'Weathermap', plugin_active = 1;" | mysql -u root librenms 157 | sudo bash -c "echo '*/5 * * * * librenms /opt/librenms/html/plugins/Weathermap/map-poller.php >> /dev/null 2>&1' >> /etc/cron.d/librenms" 158 | chown -R librenms:librenms /opt/librenms/html/plugins/Weathermap/ 159 | chmod -R 775 /opt/librenms/html/plugins/Weathermap/configs/ 160 | 161 | echo '==> Running final cleanup for LibreNMS Application' 162 | cd /opt/librenms 163 | sudo chown -R librenms:librenms /opt/librenms 164 | sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/ 165 | sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/ 166 | sudo -u librenms git checkout . 167 | -------------------------------------------------------------------------------- /scripts/ubuntu/minimize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | 3 | if [[ "$DESKTOP" =~ ^(true|yes|on|1|TRUE|YES|ON])$ ]]; then 4 | exit 5 | fi 6 | 7 | echo "==> Disk usage before minimization" 8 | df -h 9 | 10 | echo "==> Installed packages before cleanup" 11 | dpkg --get-selections | grep -v deinstall 12 | 13 | # Remove some packages to get a minimal install 14 | echo "==> Removing all linux kernels except the currrent one" 15 | #dpkg --list | awk '{ print $2 }' | grep 'linux-image-3.*-generic' | grep -v $(uname -r) | xargs apt-get -y purge 16 | apt-get -y purge `ls /boot/vmlinuz-* | sed -e '$d' | sed s/.*vmlinuz/linux-image/` 17 | apt-get -y purge $(dpkg --list |egrep 'linux-image-[0-9]' |awk '{print $3,$2}' |sort -nr |tail -n +2 |grep -v $(uname -r) |awk '{ print $2}') 18 | apt-get -y purge $(dpkg --list |grep '^rc' |awk '{print $2}') 19 | echo "==> Removing linux source" 20 | dpkg --list | awk '{ print $2 }' | grep linux-source | xargs apt-get -y purge 21 | echo "==> Removing documentation" 22 | dpkg --list | awk '{ print $2 }' | grep -- '-doc$' | xargs apt-get -y purge 23 | #echo "==> Removing development packages" 24 | #dpkg --list | awk '{ print $2 }' | grep -- '-dev$' | xargs apt-get -y purge 25 | #echo "==> Removing development tools" 26 | #dpkg --list | grep -i compiler | awk '{ print $2 }' | xargs apt-get -y purge 27 | #apt-get -y purge cpp gcc g++ 28 | #apt-get -y purge build-essential git 29 | #echo "==> Removing default system Ruby" 30 | #apt-get -y purge ruby ri doc 31 | #echo "==> Removing default system Python" 32 | #apt-get -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30 python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5 33 | echo "==> Removing other oddities" 34 | apt-get -y purge popularity-contest landscape-common wireless-tools wpasupplicant 35 | apt-get -y purge nano 36 | 37 | # Clean up the apt cache 38 | apt-get -y autoremove --purge 39 | apt-get -y clean 40 | 41 | echo "==> Removing man pages" 42 | rm -rf /usr/share/man/* 43 | echo "==> Removing APT files" 44 | find /var/lib/apt -type f | xargs rm -f 45 | echo "==> Removing any docs" 46 | rm -rf /usr/share/doc/* 47 | echo "==> Removing caches" 48 | find /var/cache -type f -exec rm -rf {} \; 49 | echo "==> Removing snapd files" 50 | rm -rf /var/lib/snapd/seed/ /var/lib/snapd/snaps/ 51 | echo "==> Removing journal files" 52 | rm -rf /var/log/journal/* 53 | echo "==> Cleaning up LibreNMS" 54 | rm -rf /opt/librenms/rrd/* /opt/librenms/.cache/composer/* 55 | cd /opt/librenms; sudo -u librenms git repack -a -d --depth=250 --window=250 56 | echo "==> Removing VBoxGuestAdditions.iso" 57 | rm -f /home/vagrant/VBoxGuestAdditions.iso 58 | 59 | # Zero out the free space to save space in the final image 60 | dd if=/dev/zero of=/EMPTY bs=1M || echo "dd exit code $? is suppressed" 61 | rm -f /EMPTY 62 | sync 63 | 64 | echo "==> Disk usage after cleanup" 65 | df -h 66 | -------------------------------------------------------------------------------- /scripts/ubuntu/oxidized.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | if [[ "$OXIDIZED" == false ]]; then 4 | echo "Oxidized support disabled" 5 | exit 0 6 | fi 7 | sudo add-apt-repository universe 8 | sudo apt install -y ruby ruby-dev libsqlite3-dev libssl-dev pkg-config cmake libssh2-1-dev libicu-dev zlib1g-dev 9 | sudo gem install oxidized 10 | sudo gem install oxidized-script oxidized-web 11 | sudo useradd oxidized -m 12 | sudo bash -c 'cat << EOF > /etc/systemd/system/oxidized.service 13 | [Unit] 14 | Description=Oxidized - Network Device Configuration Backup Tool 15 | 16 | [Service] 17 | ExecStart=/usr/local/bin/oxidized 18 | User=oxidized 19 | 20 | [Install] 21 | WantedBy=multi-user.target 22 | EOF' 23 | sudo systemctl enable oxidized 24 | 25 | -------------------------------------------------------------------------------- /scripts/ubuntu/syslog-ng.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | if [[ "$SYSLOG_NG" == false ]]; then 4 | echo "Syslog-ng support disabled" 5 | exit 0 6 | fi 7 | 8 | sudo apt remove -y rsyslog 9 | sudo apt install -y syslog-ng 10 | sudo sh -c "echo '' > /var/log/secure" 11 | 12 | sudo bash -c 'cat << EOF > /etc/syslog-ng/syslog-ng.conf 13 | @version: 3.5 14 | @include "scl.conf" 15 | 16 | # First, set some global options. 17 | options { 18 | chain_hostnames(off); 19 | flush_lines(0); 20 | use_dns(no); 21 | use_fqdn(no); 22 | owner("root"); 23 | group("adm"); 24 | perm(0640); 25 | stats_freq(0); 26 | bad_hostname("^gconfd$"); 27 | }; 28 | 29 | ######################## 30 | # Sources 31 | ######################## 32 | source s_sys { 33 | system(); 34 | internal(); 35 | }; 36 | 37 | source s_net { 38 | tcp(port(514) flags(syslog-protocol)); 39 | udp(port(514) flags(syslog-protocol)); 40 | }; 41 | 42 | ######################## 43 | # Destinations 44 | ######################## 45 | destination d_librenms { 46 | program("/opt/librenms/syslog.php" template ("\$HOST||\$FACILITY||\$PRIORITY||\$LEVEL||\$TAG||\$YEAR-\$MONTH-\$DAY \$HOUR:\$MIN:\$SEC||\$MSG||\$PROGRAM\n") template-escape(yes)); 47 | }; 48 | 49 | ######################## 50 | # Log paths 51 | ######################## 52 | log { 53 | source(s_net); 54 | source(s_sys); 55 | destination(d_librenms); 56 | }; 57 | 58 | ### 59 | # Include all config files in /etc/syslog-ng/conf.d/ 60 | ### 61 | @include "/etc/syslog-ng/conf.d/*.conf" 62 | EOF' 63 | 64 | sudo systemctl enable syslog-ng 65 | sudo systemctl restart syslog-ng 66 | echo \$config[\'enable_syslog\'] = 1\; | tee -a /opt/librenms/config.php 67 | -------------------------------------------------------------------------------- /scripts/ubuntu/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | 3 | sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv --resizefs 4 | # locale 5 | echo "==> Configuring locales" 6 | sed -i -e '/^[^# ]/s/^/# /' /etc/locale.gen 7 | LANG=en_US.UTF-8 8 | LC_ALL=$LANG 9 | locale-gen --purge $LANG 10 | update-locale LANG=$LANG LC_ALL=$LC_ALL 11 | 12 | # Disable the release upgrader 13 | echo "==> Disabling the release upgrader" 14 | sed -i.bak 's/^Prompt=.*$/Prompt=never/' /etc/update-manager/release-upgrades 15 | 16 | echo "==> Disabling apt.daily.service" 17 | systemctl stop apt-daily.timer 18 | systemctl disable apt-daily.timer 19 | systemctl daemon-reload 20 | 21 | # install packages and upgrade 22 | echo "==> Updating list of repositories" 23 | apt -y update 24 | if [[ $UPDATE =~ true || $UPDATE =~ 1 || $UPDATE =~ yes ]]; then 25 | apt -y dist-upgrade 26 | apt -y autoremove --purge 27 | fi 28 | apt -y install build-essential linux-headers-generic 29 | apt -y install ssh nfs-common vim curl perl git cloud-init 30 | apt -y autoclean 31 | apt -y clean 32 | 33 | # Remove 5s grub timeout to speed up booting 34 | sed -i -e 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=0/' \ 35 | -e 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="nosplash"/' \ 36 | -e 's/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"/' \ 37 | -e 's/^#?GRUB_TERMINAL=.*/GRUB_TERMINAL="console serial"/' \ 38 | /etc/default/grub 39 | update-grub 40 | exit 0 41 | -------------------------------------------------------------------------------- /scripts/ubuntu/virtualbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | 3 | SSH_USER=${SSH_USERNAME:-vagrant} 4 | 5 | if [[ $PACKER_BUILDER_TYPE =~ virtualbox ]]; then 6 | echo "==> Installing VirtualBox guest additions" 7 | # Assuming the following packages are installed 8 | # apt-get install -y linux-headers-$(uname -r) build-essential perl 9 | apt-get install -y dkms 10 | 11 | VBOX_VERSION=$(cat /home/${SSH_USER}/.vbox_version) 12 | mount -o loop /home/${SSH_USER}/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt 13 | yes|sh /mnt/VBoxLinuxAdditions.run 14 | umount /mnt 15 | rm /home/${SSH_USER}/VBoxGuestAdditions_$VBOX_VERSION.iso 16 | rm /home/${SSH_USER}/.vbox_version 17 | 18 | if [[ $VBOX_VERSION = "4.3.10" ]]; then 19 | ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions 20 | fi 21 | if [[ $VBOX_VERSION = "5.1.10" ]]; then 22 | rm /sbin/mount.vboxsf && ln -s /usr/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf 23 | fi 24 | fi 25 | -------------------------------------------------------------------------------- /scripts/ubuntu/vmware.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | if [ "$PACKER_BUILDER_TYPE" != "vmware-iso" ]; then 7 | exit 0 8 | fi 9 | 10 | sudo apt-get -y install open-vm-tools 11 | sudo mkdir -p /mnt/hgfs 12 | -------------------------------------------------------------------------------- /spec/epel_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe yumrepo('epel'), if: os[:family] == 'redhat' do 4 | it { should exist } 5 | it { should_not be_enabled } 6 | end 7 | -------------------------------------------------------------------------------- /spec/network_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | def interface_name(index) 4 | if qemu? 5 | if os[:family] == 'freebsd' 6 | "vtnet#{index}" 7 | elsif os[:family] == 'openbsd' 8 | "vio#{index}" 9 | else 10 | "eth#{index}" 11 | end 12 | elsif %w(freebsd openbsd).include?(os[:family]) 13 | "em#{index}" 14 | else 15 | "eth#{index}" 16 | end 17 | end 18 | 19 | 8.times do |i| 20 | describe interface(interface_name(i)) do 21 | it { should exist } 22 | it { should be_up } 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/selinux_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe selinux, if: os[:family] == 'fedora' || os[:family] == 'redhat' do 4 | it { should be_enforcing } 5 | end 6 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'net/ssh' 2 | require 'serverspec' 3 | 4 | set :backend, :ssh 5 | 6 | options = {} 7 | ssh_config = `vagrant ssh-config #{ENV['HOST']}` 8 | ssh_config.each_line do |line| 9 | if (match = /HostName (.*)/.match(line)) 10 | options[:host_name] = match[1] 11 | elsif (match = /User (.*)/.match(line)) 12 | options[:user] = match[1] 13 | elsif (match = /IdentityFile (.*)/.match(line)) 14 | options[:keys] = [match[1].delete('"')] 15 | elsif (match = /Port (.*)/.match(line)) 16 | options[:port] = match[1] 17 | end 18 | end 19 | 20 | set :host, options[:host_name] 21 | set :ssh_options, options 22 | 23 | PROVIDER = ENV['HOST'].split('-').last 24 | 25 | def qemu? 26 | PROVIDER == 'libvirt' 27 | end 28 | 29 | def virtualbox? 30 | PROVIDER == 'virtualbox' 31 | end 32 | 33 | def vmware? 34 | %w(vmware_desktop vmware_fusion vmware_workstation).include?(PROVIDER) 35 | end 36 | -------------------------------------------------------------------------------- /spec/sshd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | def sshd 4 | case os[:family] 5 | when /(debian|solaris|ubuntu)/ 6 | 'ssh' 7 | else 8 | 'sshd' 9 | end 10 | end 11 | 12 | describe service(sshd) do 13 | it { should be_enabled } 14 | it { should be_running } 15 | end 16 | 17 | describe file('/etc/ssh/sshd_config'), unless: os[:family] == 'solaris' do 18 | its(:content) { should match /UseDNS no/ } 19 | end 20 | -------------------------------------------------------------------------------- /spec/time_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe command('date +%Z') do 4 | its(:stdout) { should match /UTC/ } 5 | end 6 | -------------------------------------------------------------------------------- /spec/vagrant_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | def home_directory 4 | if os[:family] == 'solaris' 5 | '/export/home/vagrant' 6 | else 7 | '/home/vagrant' 8 | end 9 | end 10 | 11 | def synced_folder_fstype 12 | return if %w(freebsd openbsd).include?(os[:family]) 13 | 14 | if virtualbox? 15 | 'vboxsf' 16 | elsif vmware? 17 | if os[:family] == 'redhat' 18 | 'vmhgfs' 19 | elsif os[:family] == 'debian' && os[:release] =~ /^[678]\./ 20 | 'vmhgfs' 21 | elsif os[:family] == 'ubuntu' && os[:release] == '12.04' 22 | 'vmhgfs' 23 | elsif os[:family] == 'ubuntu' && os[:release] == '14.04' 24 | 'none' 25 | else 26 | 'fuse.vmhgfs-fuse' 27 | end 28 | end 29 | end 30 | 31 | describe user('vagrant') do 32 | it { should exist } 33 | it { should belong_to_group 'vagrant' } 34 | it { should have_home_directory home_directory } 35 | end 36 | 37 | describe file("#{home_directory}/.ssh") do 38 | it { should be_directory } 39 | it { should be_owned_by 'vagrant' } 40 | it { should be_grouped_into 'vagrant' } 41 | it { should be_mode 700 } 42 | end 43 | 44 | describe file("#{home_directory}/.ssh/authorized_keys") do 45 | it { should be_file } 46 | it { should be_owned_by 'vagrant' } 47 | it { should be_grouped_into 'vagrant' } 48 | it { should be_mode 600 } 49 | end 50 | 51 | describe file('/etc/vagrant_box_build_time') do 52 | it { should be_file } 53 | end 54 | 55 | describe file('/vagrant'), if: synced_folder_fstype do 56 | it { should be_mounted.with type: synced_folder_fstype } 57 | it { should be_directory } 58 | it { should be_owned_by 'vagrant' } 59 | it { should be_grouped_into 'vagrant' } 60 | end 61 | -------------------------------------------------------------------------------- /spec/virtualbox_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | def vboxsf 4 | return unless virtualbox? 5 | 6 | case os[:family] 7 | when 'freebsd', 'openbsd', 'solaris' 8 | nil 9 | else 10 | 'vboxsf' 11 | end 12 | end 13 | 14 | def vboxfs 15 | return unless virtualbox? 16 | 17 | if os[:family] == 'solaris' 18 | 'vboxfs' 19 | else 20 | nil 21 | end 22 | end 23 | 24 | def vboxguest 25 | return unless virtualbox? 26 | 27 | case os[:family] 28 | when 'freebsd', 'openbsd' 29 | nil 30 | else 31 | 'vboxguest' 32 | end 33 | end 34 | 35 | def dkms 36 | return unless virtualbox? 37 | 38 | if os[:family] == 'fedora' && os[:release].to_i < 20 39 | 'dkms_autoinstaller' 40 | elsif os[:family] == 'fedora' 41 | 'dkms' 42 | elsif os[:family] == 'redhat' && os[:release].to_i < 7 43 | 'dkms_autoinstaller' 44 | elsif os[:family] == 'redhat' 45 | 'dkms' 46 | else 47 | nil 48 | end 49 | end 50 | 51 | describe kernel_module(vboxsf), if: vboxsf do 52 | it { should be_loaded } 53 | end 54 | 55 | describe kernel_module(vboxfs), if: vboxfs do 56 | it { should be_loaded } 57 | end 58 | 59 | describe kernel_module(vboxguest), if: vboxguest do 60 | it { should be_loaded } 61 | end 62 | 63 | describe service(dkms), if: dkms do 64 | it { should be_enabled } 65 | end 66 | -------------------------------------------------------------------------------- /spec/vmware_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | def vmhgfs 4 | return unless vmware? 5 | 6 | if os[:family] == 'redhat' 7 | 'vmhgfs' 8 | elsif os[:family] == 'debian' && os[:release] =~ /^[678]\./ 9 | 'vmhgfs' 10 | elsif os[:family] == 'ubuntu' && os[:release] == '12.04' 11 | 'vmhgfs' 12 | else 13 | nil 14 | end 15 | end 16 | 17 | describe kernel_module(vmhgfs), if: vmhgfs do 18 | it { should be_loaded } 19 | end 20 | -------------------------------------------------------------------------------- /ubuntu-22.04-amd64.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "boot_command": [ 5 | "", 6 | "", 7 | "", 8 | "", 9 | "", 10 | "", 11 | "", 12 | "", 13 | "", 14 | "", 15 | "c", 16 | "set gfxpayload=keep", 17 | "linux /casper/vmlinuz ", 18 | "autoinstall quiet fsck.mode=skip ", 19 | "net.ifnames=0 biosdevname=0 systemd.unified_cgroup_hierarchy=0 ", 20 | "ds=\"nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu-22.04/\" ", 21 | "---", 22 | "initrd /casper/initrd", 23 | "boot" 24 | ], 25 | "boot_wait": "1s", 26 | "cpus": "{{ user `cpus` }}", 27 | "disk_size": "{{ user `disk_size` }}", 28 | "format": "ova", 29 | "guest_os_type": "Ubuntu_64", 30 | "headless": "{{ user `headless` }}", 31 | "http_directory": "http", 32 | "iso_checksum": "{{ user `iso_checksum_type` }}:{{ user `iso_checksum` }}", 33 | "iso_urls": [ 34 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 35 | "{{ user `mirror` }}/22.04.2/{{ user `iso_name` }}" 36 | ], 37 | "memory": "{{ user `memory` }}", 38 | "output_directory": "output-ubuntu-22.04-amd64", 39 | "shutdown_command": "sudo shutdown -h now", 40 | "ssh_password": "vagrant", 41 | "ssh_port": 22, 42 | "ssh_read_write_timeout": "600s", 43 | "ssh_timeout": "120m", 44 | "ssh_username": "vagrant", 45 | "type": "virtualbox-iso", 46 | "export_opts": [ 47 | "--manifest", 48 | "--vsys", 49 | "0", 50 | "--product", 51 | "LibreNMS", 52 | "--producturl", 53 | "https://www.librenms.org", 54 | "--description", 55 | "LibreNMS, a fully featured network monitoring system that provides a wealth of features and device support.", 56 | "--version", 57 | "LibreNMS" 58 | ], 59 | "vboxmanage": [ 60 | [ 61 | "modifyvm", 62 | "{{.Name}}", 63 | "--cpu-profile", 64 | "host" 65 | ], 66 | [ 67 | "modifyvm", 68 | "{{.Name}}", 69 | "--nat-localhostreachable1", 70 | "on" 71 | ], 72 | [ 73 | "modifyvm", 74 | "{{.Name}}", 75 | "--natpf1", 76 | "ssh,tcp,,2023,,22" 77 | ], 78 | [ 79 | "modifyvm", 80 | "{{.Name}}", 81 | "--natpf1", 82 | "http,tcp,,8080,,80" 83 | ] 84 | ], 85 | "virtualbox_version_file": ".vbox_version", 86 | "vm_name": "librenms-ubuntu-22.04-amd64", 87 | "vrdp_bind_address": "0.0.0.0", 88 | "vrdp_port_max": 6000, 89 | "vrdp_port_min": 5900 90 | } 91 | ], 92 | "post-processors": [ 93 | { 94 | "compression_level": 9, 95 | "keep_input_artifact": true, 96 | "output": "output-ubuntu-22.04-amd64/librenms-vagrant.box", 97 | "provider_override": "virtualbox", 98 | "type": "vagrant" 99 | } 100 | ], 101 | "provisioners": [ 102 | { 103 | "destination": "/tmp/librenms.conf", 104 | "source": "files/ubuntu/librenms.conf", 105 | "type": "file" 106 | }, 107 | { 108 | "environment_vars": [ 109 | "DEBIAN_FRONTEND=noninteractive", 110 | "DESKTOP={{user `desktop`}}", 111 | "UPDATE={{user `update`}}", 112 | "INSTALL_VAGRANT_KEY={{user `install_vagrant_key`}}", 113 | "SSH_USERNAME={{user `ssh_username`}}", 114 | "SSH_PASSWORD={{user `ssh_password`}}", 115 | "http_proxy={{user `http_proxy`}}", 116 | "https_proxy={{user `https_proxy`}}", 117 | "LIBRENMS_VERSION={{user `librenms_version`}}", 118 | "OXIDIZED={{user `oxidized`}}", 119 | "SYSLOG_NG={{user `syslog_ng`}}" 120 | ], 121 | "execute_command": "echo '{{ user `ssh_password` }}' | {{.Vars}} sudo -E -S bash '{{.Path}}'", 122 | "expect_disconnect": true, 123 | "scripts": [ 124 | "scripts/ubuntu/update.sh", 125 | "scripts/ubuntu/vmware.sh", 126 | "scripts/common/vagrant.sh", 127 | "scripts/common/sshd.sh", 128 | "scripts/ubuntu/librenms.sh", 129 | "scripts/ubuntu/syslog-ng.sh", 130 | "scripts/ubuntu/oxidized.sh", 131 | "scripts/ubuntu/cleanup.sh", 132 | "scripts/common/finish.sh", 133 | "scripts/ubuntu/minimize.sh", 134 | "scripts/common/clean_users.sh" 135 | ], 136 | "type": "shell" 137 | } 138 | ], 139 | "variables": { 140 | "cpus": "1", 141 | "desktop": "false", 142 | "disk_size": "40960", 143 | "headless": "false", 144 | "install_vagrant_key": "true", 145 | "iso_checksum": "5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931", 146 | "iso_checksum_type": "sha256", 147 | "iso_name": "ubuntu-22.04.2-live-server-amd64.iso", 148 | "iso_path": "iso", 149 | "memory": "2048", 150 | "mirror": "http://releases.ubuntu.com", 151 | "no_proxy": "{{env `no_proxy`}}", 152 | "ssh_fullname": "vagrant", 153 | "ssh_password": "vagrant", 154 | "ssh_timeout": "60m", 155 | "ssh_username": "vagrant", 156 | "update": "true", 157 | "librenms_version": "master" 158 | } 159 | } 160 | 161 | -------------------------------------------------------------------------------- /upload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURL='/usr/bin/env curl' 4 | JQ='/usr/bin/env jq' 5 | PACKER='/usr/bin/env packer' 6 | RE='^[0-9]+[.][0-9]+([.][0-9]+)?$' 7 | FIND='/usr/bin/env find' 8 | IMAGES="centos-7.6-x86_64 9 | ubuntu-18.04-amd64" 10 | BUILDERS="virtualbox-iso" 11 | 12 | echo "Please enter your GitHub personal access token (we don't save it):" 13 | read -s TOKEN 14 | 15 | LATEST_TAG=$($CURL -s https://api.github.com/repos/librenms/librenms/releases/latest | $JQ -r ".tag_name") 16 | 17 | if ! [[ "$LATEST_TAG" =~ $RE ]] ; then 18 | echo "Tag not found"; exit 1; 19 | fi 20 | 21 | echo "Creating new release $LATEST_TAG" 22 | 23 | UPLOAD_URL=$($CURL -s https://api.github.com/repos/librenms/packer-builds/releases -H "Authorization: token $TOKEN" -X POST --header "Content-Type: application/json" -d "{\"tag_name\":\"$LATEST_TAG\",\"name\":\"v$LATEST_TAG\"}" | $JQ -r ".upload_url") 24 | UPLOAD_URL="${UPLOAD_URL//\{\?name,label\}/}" 25 | FILES=$($FIND ./output-* -type f -print) 26 | for FILE in $FILES; do 27 | IFS='/' read -a OVA <<< "$FILE" 28 | NAME=${OVA[2]} 29 | echo "$CURL -s \"$UPLOAD_URL?name=$NAME\" -H \"Authorization: token \" -T \"$FILE\" -X POST -H \"Content-Type: application/tar\"" 30 | UPLOAD=$($CURL -s "$UPLOAD_URL?name=$NAME" -H "Authorization: token $TOKEN" -T "$FILE" -X POST -H "Content-Type: application/tar") 31 | if [ $? != 0 ] ; then 32 | echo "Upload failed:" 33 | echo $UPLOAD 34 | else 35 | echo "Upload completed" 36 | fi 37 | done 38 | -------------------------------------------------------------------------------- /vagrantfile_templates/freebsd.rb: -------------------------------------------------------------------------------- 1 | Vagrant.configure('2') do |config| 2 | config.ssh.shell = 'sh' 3 | config.vm.synced_folder '', '/vagrant', disabled: true 4 | config.vm.provider :virtualbox do |v| 5 | v.functional_vboxsf = false 6 | end 7 | config.vm.provider :vmware_fusion do |v| 8 | v.functional_hgfs = false 9 | end 10 | config.vm.provider :vmware_workstation do |v| 11 | v.functional_hgfs = false 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vagrantfile_templates/openbsd.rb: -------------------------------------------------------------------------------- 1 | Vagrant.configure('2') do |config| 2 | config.ssh.shell = 'sh' 3 | config.vm.synced_folder '', '/vagrant', disabled: true 4 | config.vm.provider :virtualbox do |v| 5 | v.check_guest_additions = false 6 | v.functional_vboxsf = false 7 | end 8 | config.vm.provider :vmware_fusion do |v| 9 | v.functional_hgfs = false 10 | end 11 | config.vm.provider :vmware_workstation do |v| 12 | v.functional_hgfs = false 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /vars/development.json: -------------------------------------------------------------------------------- 1 | { 2 | "compression_level": "0", 3 | "disk_size": "4000", 4 | "ssh_timeout": "24h" 5 | } 6 | -------------------------------------------------------------------------------- /vars/release.json: -------------------------------------------------------------------------------- 1 | { 2 | "compression_level": "9" 3 | } 4 | --------------------------------------------------------------------------------