Skip to content

Commit

Permalink
Merge pull request #123 from jouvin/frontier
Browse files Browse the repository at this point in the history
Add Frontier-Squid feature
  • Loading branch information
jrha committed Dec 5, 2018
2 parents ac941d9 + a1b8b79 commit a9e517d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 11 deletions.
44 changes: 44 additions & 0 deletions features/frontier/config.pan
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
unique template features/frontier/config;

include 'features/frontier/rpms';

variable FRONTIER_LOCAL_NET ?= list();
variable FRONTIER_LOCAL_NET = push('127.0.0.1/32');
variable FRONTIER_HOST_MONITOR ?= list();
variable FRONTIER_HOST_MONITOR = push('127.0.0.1/32');
variable FRONTIER_CACHE_MEM ?= "128 MB";
variable FRONTIER_CACHE_DIR ?= '10000';

variable FRONTIER_LOCAL_NET_STRING ?= {
tmp = "";
foreach (k; v; FRONTIER_LOCAL_NET) {
tmp = tmp + " " + v + " ";
};
tmp
};

variable FRONTIER_HOST_MONITOR_STRING ?= {
tmp = "";
foreach (k; v; FRONTIER_HOST_MONITOR) {
tmp = tmp + " " + v + " ";
};
tmp
};

include 'components/filecopy/config';
'/software/components/filecopy/services/{/etc/squid/customized.sh}' = dict(
'config', format(
file_contents('features/frontier/customized.sh.file'),
FRONTIER_LOCAL_NET_STRING,
FRONTIER_HOST_MONITOR_STRING,
FRONTIER_CACHE_MEM,
FRONTIER_CACHE_DIR,
),
'restart', 'service frontier-squid reload',
'perms', '0644',
);

include 'components/chkconfig/config';

'/software/components/chkconfig/service/frontier-squid/on' = "";
'/software/components/chkconfig/service/frontier-squid/startstop' = true;
10 changes: 10 additions & 0 deletions features/frontier/customized.sh.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
#

awk --file `dirname $0`/customhelps.awk --source '{
setoption("acl NET_LOCAL src", "%s")
setoption("acl HOST_MONITOR src","%s")
setoption("cache_mem", "%s")
setoptionparameter("cache_dir", 3, "%s")
print
}'
3 changes: 3 additions & 0 deletions features/frontier/rpms.pan
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
template features/frontier/rpms;

'/software/packages' = pkg_repl('frontier-squid');
13 changes: 2 additions & 11 deletions machine-types/frontier.pan
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
############################################################
#
# object template machine-types/nfs
#
# Defines a NFS server
#
# RESPONSIBLE: Michel Jouvin
#
############################################################

template machine-types/frontier;

# CREATE_HOME must be defined as undef
variable CREATE_HOME ?= undef;

include { 'machine-types/core' };
include 'machine-types/core';

include { 'features/frontier/services' };
include 'features/frontier/config';

0 comments on commit a9e517d

Please sign in to comment.