Hello,
Still working on the reprepro property
Here A property that I am using to publish a repository via apache (this is a prototype)
website :: String -> Property
website hn = toProp $ Apache.siteEnabled hn apachecfg
where
apachecfg = [ "<VirtualHost *>"
, "DocumentRoot " ++ basePath
, "<Directory " ++ basePath ++ ">"
, " Options Indexes FollowSymLinks Multiviews"
, " Order allow,deny"
, Apache.allowAll
, "</Directory>"
] ++ concatMap deny ["db", "conf", "incoming"]
++ ["</VirtualHost>"]
deny dir = [ "<Directory \"" ++ basePath ++ "apt/*/" ++ dir ++ "\">"
, " Order deny,allow"
, " Deny from all"
, "</Directory>"
]
during my test I am runing the config.hs with runhaskell config.hs (it work the first time, the apache config files are ok)
but when I do a modification on the apachecfg and rerun the runhaskell, the config files are not updated. I need to remove them to have an updated version.
cheers
Fred
root@mordor:~/propellor/src# PROPELLOR_DEBUG=1 runhaskell config.hs
[2014-12-08 10:27:10 CET] read: hostname ["-f"] [2014-12-08 10:27:10 CET] command line: Run "mordor" [2014-12-08 10:27:10 CET] read: git ["remote"] [2014-12-08 10:27:10 CET] read: git ["symbolic-ref","--short","HEAD"] [2014-12-08 10:27:10 CET] call: git ["fetch"] Pull from central git repository ... done [2014-12-08 10:27:12 CET] read: git ["show-ref","--hash","master"] [2014-12-08 10:27:12 CET] read: git ["show-ref","--hash","master"] mordor has Operating System (Debian Unstable) "i386" ... ok [2014-12-08 10:27:12 CET] read: apt-cache ["policy","etckeeper"] mordor apt installed etckeeper ... ok [2014-12-08 10:27:13 CET] read: apt-cache ["policy","ssh"] mordor apt installed ssh ... ok [2014-12-08 10:27:13 CET] read: passwd ["-S","root"] mordor root has password ... ok [2014-12-08 10:27:13 CET] call: a2query ["-q","-s","reprepro"] [2014-12-08 10:27:14 CET] read: apt-cache ["policy","apache2"] [2014-12-08 10:27:14 CET] call: a2ensite ["--quiet","reprepro"] Enabling site reprepro. [2014-12-08 10:27:15 CET] call: sh ["-c","set -e ; service 'apache2' reload >/dev/null 2>&1 || true"] mordor create reprepro ... done mordor overall ... done
Second run after adding a space here
I forgot to say that the content of
/etc/apache2/site-xxx/reprepro[.conf]
is unmodifed after this second run
Pretty obvious why if you look at the code:
So that property was skipped entirely if the site was already enabled and never looked at the config file.
I've put in a fix.