Skip to content

Configure pfSense using developer shell with YAML configfile

License

Notifications You must be signed in to change notification settings

rudibroekhuizen/pfsense

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configure pfSense using developer shell

The ruby script creator.rb will convert a YAML file into pfSense developer shell commands. This way it is possible to configure your pfSense device.

#master.yaml:

system:
  hostname: 'master'
  domain: 'localdomain'
  dnsserver:
    '0': '8.8.8.8'
    '1': '8.8.4.4'

Run the script:

ruby creator.rb master.yaml > master.conf

The settings above will look like this after running creator.rb:

#master.conf:

$config['system']['hostname'] = 'master';
$config['system']['domain'] = 'localdomain';
$config['system']['dnsserver']['0'] = '8.8.8.8';
$config['system']['dnsserver']['1'] = '8.8.4.4';
write_config();
exec
exit

You can apply those settings with the following command:

ssh [email protected] '/usr/local/sbin/pfSsh.php' < master.conf

Blog: https://rudibroekhuizen.wordpress.com

About

Configure pfSense using developer shell with YAML configfile

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages