moving conf_files creation scripts to nodeconfig
Thierry Parmentelat [Tue, 19 Jan 2010 21:25:25 +0000 (21:25 +0000)]
20 files changed:
bin/clean-empty-dirs.py [moved from clean-empty-dirs.py with 100% similarity]
bin/db-config [moved from db-config with 100% similarity]
bin/dns-config [moved from dns-config with 100% similarity]
bin/mtail.py [moved from mtail.py with 100% similarity]
bin/plc-check-ssl-peering.py [moved from plc-check-ssl-peering.py with 100% similarity]
bin/plc-config [moved from plc-config with 100% similarity]
bin/plc-config-tty [moved from plc-config-tty with 100% similarity]
bin/plc-kml.py [moved from plc-kml.py with 100% similarity]
bin/plc-map.py [moved from plc-map.py with 100% similarity]
bin/plc-orphan-accounts.py [moved from plc-orphan-accounts.py with 100% similarity]
bin/refresh-peer.py [moved from refresh-peer.py with 100% similarity]
build.sh
db-config.d/030-conf_files_iptables [deleted file]
db-config.d/030-conf_files_kernel [deleted file]
db-config.d/030-conf_files_node_update [deleted file]
db-config.d/030-conf_files_ping_of_death [deleted file]
db-config.d/030-conf_files_plc_config [deleted file]
db-config.d/030-conf_files_security [deleted file]
db-config.d/030-conf_files_services [deleted file]
db-config.d/030-conf_files_sfa [deleted file]

similarity index 100%
rename from clean-empty-dirs.py
rename to bin/clean-empty-dirs.py
similarity index 100%
rename from db-config
rename to bin/db-config
similarity index 100%
rename from dns-config
rename to bin/dns-config
similarity index 100%
rename from mtail.py
rename to bin/mtail.py
similarity index 100%
rename from plc-config
rename to bin/plc-config
similarity index 100%
rename from plc-config-tty
rename to bin/plc-config-tty
similarity index 100%
rename from plc-kml.py
rename to bin/plc-kml.py
similarity index 100%
rename from plc-map.py
rename to bin/plc-map.py
similarity index 100%
rename from refresh-peer.py
rename to bin/refresh-peer.py
index 5fb557a..30304c3 100755 (executable)
--- a/build.sh
+++ b/build.sh
 
 . build.functions
 
-# XXX .spec file needs to have the appropriate set of requires statements
-
 # Install configuration scripts
-echo "* myplc-native: Installing configuration scripts"
+echo "* Installing configuration scripts"
 pldistro=$1; shift
 RPM_BUILD_ROOT=$1 ; shift
 PYTHON_SITEARCH=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`
 rm -rf ${RPM_BUILD_ROOT}
 mkdir -p ${RPM_BUILD_ROOT}
-echo "* myplc-native: installing plc_config.py in " ${PYTHON_SITEARCH}
+
+echo "* Installing plc_config.py in " ${PYTHON_SITEARCH}
 install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/${PYTHON_SITEARCH}/plc_config.py
-install -D -m 644 bashrc ${RPM_BUILD_ROOT}/usr/share/myplc/bashrc
 
-echo "* myplc-native: installing scripts in /usr/bin"
-install -D -m 755 plc-config ${RPM_BUILD_ROOT}/usr/bin/plc-config
-install -D -m 755 plc-config-tty ${RPM_BUILD_ROOT}/usr/bin/plc-config-tty
-install -D -m 755 db-config ${RPM_BUILD_ROOT}/usr/bin/db-config
-install -D -m 755 dns-config ${RPM_BUILD_ROOT}/usr/bin/dns-config
-install -D -m 755 plc-map.py ${RPM_BUILD_ROOT}/usr/bin/plc-map.py
-install -D -m 755 plc-kml.py ${RPM_BUILD_ROOT}/usr/bin/plc-kml.py
-install -D -m 755 refresh-peer.py ${RPM_BUILD_ROOT}/usr/bin/refresh-peer.py
-install -D -m 755 clean-empty-dirs.py ${RPM_BUILD_ROOT}/usr/bin/clean-empty-dirs.py
-install -D -m 755 mtail.py ${RPM_BUILD_ROOT}/usr/bin/mtail.py
-install -D -m 755 plc-check-ssl-peering.py ${RPM_BUILD_ROOT}/usr/bin/plc-check-ssl-peering.py
-install -D -m 755 plc-orphan-accounts.py ${RPM_BUILD_ROOT}/usr/bin/plc-orphan-accounts.py
+echo "* Installing scripts in /usr/bin"
+mkdir -p ${RPM_BUILD_ROOT}/usr/bin
+rsync -av --exclude .svn bin/ ${RPM_BUILD_ROOT}/usr/bin/
+chmod 755 ${RPM_BUILD_ROOT}/usr/bin/*
 
 # Install initscript 
+echo "* Installing plc initscript"
 install -D -m 755 plc.init ${RPM_BUILD_ROOT}/etc/init.d/plc
 
 # Install initscripts
-echo "* myplc-native: Installing initscripts"
+echo "* Installing plc.d initscripts"
 find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
 chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
 
 # Install db-config.d files
-echo "* myplc: Installing db-config.d files"
+echo "* Installing db-config.d files"
 mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
 cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
 chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
 
 # Extra scripts (mostly for mail and dns) not installed by myplc by default.  Used in production
-echo "* myplc-native: installing scripts in /etc/support-scripts"
+echo "* Installing scripts in /etc/support-scripts"
 mkdir -p ${RPM_BUILD_ROOT}/etc/support-scripts
 cp support-scripts/* ${RPM_BUILD_ROOT}/etc/support-scripts
 chmod 444 ${RPM_BUILD_ROOT}/etc/support-scripts/*
@@ -70,6 +61,9 @@ echo "* myplc: Installing configuration file"
 install -D -m 444 default_config.xml ${RPM_BUILD_ROOT}/etc/planetlab/default_config.xml
 install -D -m 444 plc_config.dtd ${RPM_BUILD_ROOT}/etc/planetlab/plc_config.dtd
 
+echo "* Installing bashrc convenience"
+install -D -m 644 bashrc ${RPM_BUILD_ROOT}/usr/share/myplc/bashrc
+
 # yumgroups.xml and yum repo : let noderepo handle that
 
 exit 0
diff --git a/db-config.d/030-conf_files_iptables b/db-config.d/030-conf_files_iptables
deleted file mode 100644 (file)
index 66c155d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-# iptables
-    # Firewall configuration
-    {'enabled': True,
-     'source': 'PlanetLabConf/blacklist.php',
-     'dest': '/etc/planetlab/blacklist',
-     'file_permissions': '600',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '/sbin/iptables-restore --noflush < /etc/planetlab/blacklist',
-     'error_cmd': '',
-     'ignore_cmd_errors': True,
-     'always_update': False},
-    
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_kernel b/db-config.d/030-conf_files_kernel
deleted file mode 100644 (file)
index 8f9bb37..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-# linux-2.6
-    # Kernel sysctl parameters
-    {'enabled': True,
-     'source': 'PlanetLabConf/sysctl.conf',
-     'dest': '/etc/sysctl.conf',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '/sbin/sysctl -e -p /etc/sysctl.conf',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_node_update b/db-config.d/030-conf_files_node_update
deleted file mode 100644 (file)
index d3d9434..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-# myplc/noderepo
-    # YUM configuration
-    {'enabled': True,
-     'source': 'yum/myplc.repo.php?gpgcheck=1',
-     'dest': '/etc/yum.myplc.d/myplc.repo',
-     'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
-     'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    {'enabled': True,
-     'source': 'yum/yum.conf',
-     'dest': '/etc/yum.conf',
-     'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
-     'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    {'enabled': True,
-     'source': 'yum/stock.repo',
-     'dest': '/etc/yum.myplc.d/stock.repo',
-     'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
-     'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-# NodeUpdate
-    {'enabled': True,
-     'source': 'PlanetLabConf/delete-rpm-list-production',
-     'dest': '/etc/planetlab/delete-rpm-list',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-# NodeUpdate
-    # /etc/planetlab/extensions
-    {'enabled': True,
-     'source': 'PlanetLabConf/extensions.php',
-     'dest': '/etc/planetlab/extensions',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_ping_of_death b/db-config.d/030-conf_files_ping_of_death
deleted file mode 100644 (file)
index 79da0e4..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-# PoD
-    # Ping of death configuration
-    # the 'restart' postcommand doesn't work, b/c the pod script doesn't support it.
-    {'enabled': True,
-     'source': 'PlanetLabConf/ipod.conf.php',
-     'dest': '/etc/ipod.conf',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '/etc/init.d/pod start',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_plc_config b/db-config.d/030-conf_files_plc_config
deleted file mode 100644 (file)
index da1eb49..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-    # PLC configuration
-    {'enabled': True,
-     'source': 'PlanetLabConf/get_plc_config.php',
-     'dest': '/etc/planetlab/plc_config',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    {'enabled': True,
-     'source': 'PlanetLabConf/get_plc_config.php?python',
-     'dest': '/etc/planetlab/plc_config.py',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    {'enabled': True,
-     'source': 'PlanetLabConf/get_plc_config.php?perl',
-     'dest': '/etc/planetlab/plc_config.pl',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    {'enabled': True,
-     'source': 'PlanetLabConf/get_plc_config.php?php',
-     'dest': '/etc/planetlab/php/plc_config.php',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_security b/db-config.d/030-conf_files_security
deleted file mode 100644 (file)
index 22d909d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-    # SSH server configuration
-    # keys for root and site_admin are now handled as part of the specialaccounts NodeManager plugin
-    {'enabled': True,
-     'source': 'PlanetLabConf/sshd_config',
-     'dest': '/etc/ssh/sshd_config',
-     'file_permissions': '600',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '/etc/init.d/sshd restart',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    # sudo configuration
-    {'enabled': True,
-     'source': 'PlanetLabConf/sudoers.php',
-     'dest': '/etc/sudoers',
-     'file_permissions': '440',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '/usr/sbin/visudo -c',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-
-    # GPG signing keys
-    {'enabled': True,
-     'source': 'PlanetLabConf/get_gpg_key.php',
-     'dest': '/etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': 'rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    # Proxy ARP setup
-    {'enabled': True,
-     'source': 'PlanetLabConf/proxies.php',
-     'dest': '/etc/planetlab/proxies',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_services b/db-config.d/030-conf_files_services
deleted file mode 100644 (file)
index ef027d4..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-    # NTP configuration
-    {'enabled': True,
-     'source': 'PlanetLabConf/ntp.conf.php',
-     'dest': '/etc/ntp.conf',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '/etc/rc.d/init.d/ntpd restart',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    {'enabled': True,
-     'source': 'PlanetLabConf/ntp/step-tickers.php',
-     'dest': '/etc/ntp/step-tickers',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '/etc/rc.d/init.d/ntpd restart',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    # Log rotation configuration
-    {'enabled': True,
-     'source': 'PlanetLabConf/logrotate.conf',
-     'dest': '/etc/logrotate.conf',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    # updatedb/locate nightly cron job
-    {'enabled': True,
-     'source': 'PlanetLabConf/slocate.cron',
-     'dest': '/etc/cron.daily/slocate.cron',
-     'file_permissions': '755',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    # Sendmail configuration
-    {'enabled': True,
-     'source': 'PlanetLabConf/sendmail.mc',
-     'dest': '/etc/mail/sendmail.mc',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    {'enabled': True,
-     'source': 'PlanetLabConf/sendmail.cf',
-     'dest': '/etc/mail/sendmail.cf',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': 'service sendmail restart',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-    
-    # /etc/issue
-    {'enabled': True,
-     'source': 'PlanetLabConf/issue.php',
-     'dest': '/etc/issue',
-     'file_permissions': '644',
-     'file_owner': 'root',
-     'file_group': 'root',
-     'preinstall_cmd': '',
-     'postinstall_cmd': '',
-     'error_cmd': '',
-     'ignore_cmd_errors': False,
-     'always_update': False},
-
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_sfa b/db-config.d/030-conf_files_sfa
deleted file mode 100644 (file)
index 63d4ec5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*-python-*-
-# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
-#################### conf files
-
-conf_files = [
-
-# sfa
-    # /etc/sfa/sfa_config
-    {'enabled': True,
-     'source': u'PlanetLabConf/sfa_config.php', 
-     'dest': u'/etc/sfa/sfa_config', 
-     'file_permissions': u'644', 
-     'file_owner': u'root', 
-     'file_group': u'root',
-     'preinstall_cmd': u'mkdir /etc/sfa', 
-     'postinstall_cmd': '', 
-     'error_cmd': '', 
-     'ignore_cmd_errors': False, 
-     'always_update': False}
-
-    ]
-
-for conf_file in conf_files:
-       SetConfFile(conf_file)