From 13052cfb39d3224e3a820823f7405a25869fb2c8 Mon Sep 17 00:00:00 2001 From: Mark Tearle Date: Sat, 3 Jan 2015 15:53:46 +0800 Subject: [PATCH] Add default configs for dispense client and server --- puppet/manifests/init.pp | 3 ++ .../modules/uccvend-configs/manifests/init.pp | 29 ++++++++++++++++ .../templates/dispense-client.conf.erb | 5 +++ .../templates/dispense-items.cfg.erb | 28 ++++++++++++++++ .../templates/dispense-server.conf.erb | 33 +++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 puppet/modules/uccvend-configs/manifests/init.pp create mode 100644 puppet/modules/uccvend-configs/templates/dispense-client.conf.erb create mode 100644 puppet/modules/uccvend-configs/templates/dispense-items.cfg.erb create mode 100644 puppet/modules/uccvend-configs/templates/dispense-server.conf.erb diff --git a/puppet/manifests/init.pp b/puppet/manifests/init.pp index ffeca85..84f1464 100644 --- a/puppet/manifests/init.pp +++ b/puppet/manifests/init.pp @@ -18,3 +18,6 @@ include uccvend-snackrom include virtualsnack include opendispense2 include uccvend-vendserver + +# setup configs for development environment +include uccvend-configs diff --git a/puppet/modules/uccvend-configs/manifests/init.pp b/puppet/modules/uccvend-configs/manifests/init.pp new file mode 100644 index 0000000..d712df2 --- /dev/null +++ b/puppet/modules/uccvend-configs/manifests/init.pp @@ -0,0 +1,29 @@ +class uccvend-configs { + # Directory for dispense config + file { "/etc/opendispense": + ensure => directory; + } + + # Client config file for dispense + file { 'dispense-client.conf': + path => '/etc/opendispense/client.conf', + ensure => file, + content => template("uccvend-configs/dispense-client.conf.erb"), + } + + # Server config file for dispense + file { 'dispense-server.conf': + path => '/etc/opendispense/dispsrv.conf', + ensure => file, + content => template("uccvend-configs/dispense-server.conf.erb"), + } + + # Items config file for dispense + + file { 'dispense-items.cfg': + path => '/etc/opendispense/items.cfg', + ensure => file, + content => template("uccvend-configs/dispense-items.cfg.erb"), + } + +} diff --git a/puppet/modules/uccvend-configs/templates/dispense-client.conf.erb b/puppet/modules/uccvend-configs/templates/dispense-client.conf.erb new file mode 100644 index 0000000..2ff39a4 --- /dev/null +++ b/puppet/modules/uccvend-configs/templates/dispense-client.conf.erb @@ -0,0 +1,5 @@ +# +# OpenDispense2 Client config file +# +dispense_server localhost +dispense_port 11021 diff --git a/puppet/modules/uccvend-configs/templates/dispense-items.cfg.erb b/puppet/modules/uccvend-configs/templates/dispense-items.cfg.erb new file mode 100644 index 0000000..d78529d --- /dev/null +++ b/puppet/modules/uccvend-configs/templates/dispense-items.cfg.erb @@ -0,0 +1,28 @@ + +# Items prefixed with a '-' will not show up in the GUI +# (Actually aren't returned by ENUM_ITEMS) + +# Type ID Price Description + +# Drinks +coke 0 200 Vagrant Hooch +coke 1 200 Mother Energy Drink +coke 2 75 Solo +coke 3 75 Lemonade +coke 4 75 Orange Foo +coke 5 92 NULL Coke +coke 6 93 Coke + +# Pseudo items +pseudo 0 10 laserprint 5 pages # print 5 pages +pseudo 1 30 manual phone # Ring Ring! +pseudo 2 128 clue # clue.flac - Don't Ask +pseudo 3 3500 polo postorder # Polo Shirt! (With UCC Sun Logo) +pseudo 4 2500 membership # here comes the money! + +-door 0 0 Open Door # Open Sesame + +# Snack machine +-snack 13 128 Smiths Salt & Vinegar +-snack 33 128 Smiths Original +-snack 53 128 Smiths Barbeque diff --git a/puppet/modules/uccvend-configs/templates/dispense-server.conf.erb b/puppet/modules/uccvend-configs/templates/dispense-server.conf.erb new file mode 100644 index 0000000..1da6ba1 --- /dev/null +++ b/puppet/modules/uccvend-configs/templates/dispense-server.conf.erb @@ -0,0 +1,33 @@ +# +# OpenDispense2 Server config file +# +daemonise yes +server_port 11021 +cokebank_database cokebank.db +items_file items.cfg + +# PLC - coke brain +#coke_modbus_address 130.95.13.73 +coke_modbus_address 0.0.0.0 + +# Zero price items, defaults to off +test_mode no +#test_mode yes + +disable_syslog yes + +# Used to set dispense into a dummy mode when the coke machine is out of action +# and we're dispensing drinks from the fridge (or manually) +coke_dummy_mode no +#coke_dummy_mode yes + +door_serial_port /dev/ttyUSB0 +door_unlocked_delay 10 + +trusted_host 127.0.0.1 # localhost + +#trusted_host 130.95.13.4 # Merlo +#trusted_host 130.95.13.7 # motsugo +#trusted_host 130.95.13.18 # mussel +#trusted_host 130.95.13.23 # martello +#trusted_host 130.95.13.42 # meersau -- 2.20.1