From 533ccb512e5902e653ae1fccca7af3edec3d7a84 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Tue, 27 Apr 2010 02:33:17 +0000 Subject: doc: Add quickstart updates from Fabian Affolter Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5840 ce84e21b-d406-0410-9b95-82705330c041 --- doc/getting_started/using-bcfg2-with-centos.txt | 183 +++++++----------------- doc/quickstart/centos.txt | 147 +++++-------------- doc/quickstart/index.txt | 11 +- doc/quickstart/ubuntu.txt | 118 +++------------ doc/server/reports/index.txt | 1 + doc/server/reports/install.txt | 181 +++++++++++++++++++++++ doc/unsorted/index.txt | 4 - 7 files changed, 296 insertions(+), 349 deletions(-) create mode 100644 doc/server/reports/install.txt diff --git a/doc/getting_started/using-bcfg2-with-centos.txt b/doc/getting_started/using-bcfg2-with-centos.txt index 261519f68..7c452f422 100644 --- a/doc/getting_started/using-bcfg2-with-centos.txt +++ b/doc/getting_started/using-bcfg2-with-centos.txt @@ -1,12 +1,17 @@ .. -*- mode: rst -*- -.. _using_bcfg2-with-centos: +.. _EPEL: http://fedoraproject.org/wiki/EPEL +.. _RPMForge: https://rpmrepo.org/RPMforge + +.. _getting_started-using_bcfg2-with-centos: ======================= Using Bcfg2 With CentOS ======================= -This section covers specific topics for using Bcfg2 with CentOS. Most likely the tips on this page also apply to other members of the RedHat family of Linux operating systems. +This section covers specific topics for using Bcfg2 with CentOS. Most +likely the tips on this page also apply to other members of the Red Hat +family of Linux operating systems. From Source +++++++++++ @@ -14,149 +19,61 @@ From Source Install Prerequisities ###################### -While you can go about building all these things from source, this how -to will try and meet the dependencies using packages from -rpmforge. The el5 package should be compatible with centos5. :: +While you can go about building all these things from source, this +how to will try and meet the dependencies using packages from EPEL_ +or RPMforge_. The *el5* package should be compatible with CentOS 5.x. + +EPEL_:: + + [root@centos ~]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm - [root@centos ~]# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm - --09:51:43-- http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm - Resolving dag.wieers.com... 62.213.193.164 - Connecting to dag.wieers.com|62.213.193.164|:80... connected. - HTTP request sent, awaiting response... 302 Found - Location: http://rpmforge.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm [following] - --09:51:44-- http://rpmforge.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm - Resolving rpmforge.sw.be... 130.133.35.16 - Connecting to rpmforge.sw.be|130.133.35.16|:80... connected. - HTTP request sent, awaiting response... 200 OK - Length: 16697 (16K) [application/x-rpm] - Saving to: `rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm' +RPMforge_:: - 100%[====================================================================================================================================================================================================>] 16,697 51.6K/s in 0.3s + [root@centos ~]# rpm -Uvh http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm - 09:51:45 (51.6 KB/s) - `rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm' saved [16697/16697] +.. note:: - [root@centos ~]# rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm - warning: rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6 - Preparing... ########################################### [100%] - 1:rpmforge-release ########################################### [100%] + Be careful with `mixing package repositories + `_. Now you can install the rest of the prerequisites:: [root@centos ~]# yum install python-genshi python-cheetah python-lxml - Loading "fastestmirror" plugin - Loading mirror speeds from cached hostfile - * rpmforge: ftp-stud.fht-esslingen.de - * base: mirrors.tummy.com - * updates: mirror.unl.edu - * addons: mirror.unl.edu - * extras: mirror.hmc.edu - Setting up Install Process - Parsing package install arguments - Resolving Dependencies - --> Running transaction check - ---> Package python-cheetah.x86_64 0:2.0.1-1.el5.rf set to be updated - ---> Package python-genshi.x86_64 0:0.5.1-2.el5.rf set to be updated - --> Processing Dependency: python-setuptools >= 0.6 for package: python-genshi - ---> Package python-lxml.x86_64 0:1.3.4-1.el5.rf set to be updated - --> Running transaction check - ---> Package python-setuptools.noarch 0:0.6c5-2.el5 set to be updated - --> Finished Dependency Resolution - - Dependencies Resolved - - ============================================================================= - Package Arch Version Repository Size - ============================================================================= - Installing: - python-cheetah x86_64 2.0.1-1.el5.rf rpmforge 424 k - python-genshi x86_64 0.5.1-2.el5.rf rpmforge 521 k - python-lxml x86_64 1.3.4-1.el5.rf rpmforge 1.4 M - Installing for dependencies: - python-setuptools noarch 0.6c5-2.el5 base 479 k - - Transaction Summary - ============================================================================= - Install 4 Package(s) - Update 0 Package(s) - Remove 0 Package(s) - - Total download size: 2.8 M - Is this ok [y/N]: y - Downloading Packages: - (1/4): python-setuptools- 100% |=========================| 479 kB 00:00 - (2/4): python-lxml-1.3.4- 100% |=========================| 1.4 MB 00:09 - (3/4): python-genshi-0.5. 100% |=========================| 521 kB 00:01 - (4/4): python-cheetah-2.0 100% |=========================| 424 kB 00:01 - Running rpm_check_debug - Running Transaction Test - Finished Transaction Test - Transaction Test Succeeded - Running Transaction - Installing: python-lxml ######################### [1/4] - Installing: python-cheetah ######################### [2/4] - Installing: python-setuptools ######################### [3/4] - Installing: python-genshi ######################### [4/4] - - Installed: python-cheetah.x86_64 0:2.0.1-1.el5.rf python-genshi.x86_64 0:0.5.1-2.el5.rf python-lxml.x86_64 0:1.3.4-1.el5.rf - Dependency Installed: python-setuptools.noarch 0:0.6c5-2.el5 - Complete! Build Packages from source ########################## - * After installing subversion, check out a copy of trunk :: +* After installing subversion, check out a copy of trunk :: [root@centos redhat]# svn co https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2 - Install rpm-build - [root@centos redhat]# yum install yum install rpm-build - Loading "fastestmirror" plugin - Loading mirror speeds from cached hostfile - * rpmforge: ftp-stud.fht-esslingen.de - * base: mirrors.tummy.com - * updates: mirror.unl.edu - * addons: mirror.unl.edu - * extras: mirror.hmc.edu - Setting up Install Process - Parsing package install arguments - Resolving Dependencies - --> Running transaction check - ---> Package rpm-build.x86_64 0:4.4.2-48.el5 set to be updated - --> Finished Dependency Resolution - - Dependencies Resolved - - ============================================================================= - Package Arch Version Repository Size - ============================================================================= - Installing: - rpm-build x86_64 4.4.2-48.el5 base 565 k - - Transaction Summary - ============================================================================= - Install 1 Package(s) - Update 0 Package(s) - Remove 0 Package(s) - - Total download size: 565 k - Is this ok [y/N]: y - Downloading Packages: - (1/1): rpm-build-4.4.2-48 100% |=========================| 565 kB 00:00 - Running rpm_check_debug - Running Transaction Test - Finished Transaction Test - Transaction Test Succeeded - Running Transaction - Installing: rpm-build ######################### [1/1] - - Installed: rpm-build.x86_64 0:4.4.2-48.el5 - Complete! - - * Change to the redhat directory of the checked out bcfg2 source:: - - [root@centos ~]# cd bcfg2/redhat/ - [root@centos redhat]# - - * FIXME - - .. toctree:: + +* Install the ``fedora-packager`` package :: + + [root@centos ~]# yum install fedora-packager + +* A directory structure for the RPM build process has to be established. :: + + [you@centos ~]$ rpmdev-setuptree + +* Change to the *redhat* directory of the checked out Bcfg2 source:: + + [you@centos ~]$ cd bcfg2/redhat/ + +* In the particular directory is a Makefile which will do the job of building the RPM packages. You can do this as root, but it's not recommanded:: + + [you@centos redhat]$ make + +* Now the new RPM package can be installed. Please adjust the path to your RPM package:: + + [root@centos ~]# rpm -ihv /home/YOU/rpmbuild/RPMS/noarch/bcfg2-server-1.0.0-0.2r5835.noarch.rpm + +Install Packages from Package repository +######################################## + +To install the bcfg2-server and bcfg2 from a package repository, just +use Yum to do it:: + + [root@centos ~]# yum install bcfg2-server bcfg2 + +.. toctree:: :hidden: diff --git a/doc/quickstart/centos.txt b/doc/quickstart/centos.txt index 6d9846332..5dca23f9f 100644 --- a/doc/quickstart/centos.txt +++ b/doc/quickstart/centos.txt @@ -1,39 +1,47 @@ .. -*- mode: rst -*- -.. _quickstart-centos: .. _EPEL: http://fedoraproject.org/wiki/EPEL +.. _quickstart-centos: + ===================== Quickstart for CentOS ===================== -This is a complete getting started guide for CentOS. With this document you should be able to install a Bcfg2 server, a Bcfg2 client, and change the ``/etc/motd`` file on the client. +This is a complete getting started guide for CentOS. With this document +you should be able to install a Bcfg2 server and a Bcfg2 client. -Install Bcfg2 From RPM -====================== +Install Bcfg2 +============= -The fastest way to get Bcfg2 onto your system is to get a RPM someone else has already made. We'll be using the ones that are distributed through EPEL_, but depending on your aversion to risk you could download an RPM from other places as well. See :ref:`using_bcfg2-with-centos` for information about building Bcfg2 from source and making your own packages. +The fastest way to get Bcfg2 onto your system is to use Yum or +your preferred package management tool. We'll be using the ones +that are distributed through EPEL_, but depending on your aversion +to risk you could download an RPM from other places as well. See +:ref:`getting_started-using_bcfg2-with-centos` for information about +building Bcfg2 from source and making your own packages. Using EPEL ---------- - * Make sure EPEL is a valid repository on your server. The `instructions `_ on how to do this basically say:: +Make sure EPEL_ is a valid repository on your server. The `instructions +`_ on how to do this +basically say:: - # su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm' - ...lot's of output... + [root@centos ~]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm +Install the bcfg2-server and bcfg2 RPMs:: - * Install the bcfg2-server and bcfg2 RPMs :: + [root@centos ~]# yum install bcfg2-server bcfg2 - $ sudo yum install bcfg2-server bcfg2 - -Your system should now have the necessary software to use Bcfg2. The next step is to set up your Bcfg2 :term:`repository`. +Your system should now have the necessary software to use Bcfg2. The +next step is to set up your Bcfg2 :term:`repository`. Initialize your repository ========================== -Now that you're done with the install, you need to initialize your -repository and setup your ``/etc/bcfg2.conf``. ``bcfg2-admin init`` +Now that you're done with the install, you need to initialize your +repository and setup your ``/etc/bcfg2.conf``. ``bcfg2-admin init`` is a tool which allows you to automate this:: [root@centos ~]# bcfg2-admin init @@ -68,12 +76,12 @@ Start the server You are now ready to start your bcfg2 server for the first time:: - $ sudo /sbin/service bcfg2-server start + [root@centos ~]# /sbin/service bcfg2-server start To verify that everything started ok, look for the running daemon and check the logs:: - $ sudo /sbin/service bcfg2-server status - $ sudo tail /var/log/messages + [root@centos ~]# /etc/init.d/service bcfg2-server status + [root@centos ~]# tail /var/log/messages Mar 29 12:42:26 centos bcfg2-server[5093]: service available at https://centos:6789 Mar 29 12:42:26 centos bcfg2-server[5093]: serving bcfg2-server at https://centos:6789 Mar 29 12:42:26 centos bcfg2-server[5093]: serve_forever() [start] @@ -150,14 +158,14 @@ Now if you run the client, no more warning:: Unmanaged entries: 208 Bring your first machine under Bcfg2 control --------------------------------------------- +============================================ Now it is time to get your first machine's configuration into your -Bcfg2 repository. Let's start with the server itself. +Bcfg2 :term:`repository`. Let's start with the server itself. Setup the `Packages`_ plugin -++++++++++++++++++++++++++++ +---------------------------- .. _Packages: http://trac.mcs.anl.gov/projects/bcfg2/wiki/Plugins/Packages @@ -237,13 +245,13 @@ Probes to your plugins line in ``bcfg2.conf`` and create the Probe.:: Now we restart the bcfg2-server:: - /etc/init.d/bcfg2-server restart + [root@centos ~]# /etc/init.d/bcfg2-server restart If you tail ``/var/log/syslog`` now, you will see the Packages plugin in action, updating the cache. Start managing packages -+++++++++++++++++++++++ +----------------------- Add a base-packages bundle. Let's see what happens when we just populate it with the *yum* package. @@ -472,10 +480,10 @@ Then add the files to Cfg:: Now, running the client shows only unmanaged Service entries. Woohoo! Manage services -+++++++++++++++ +--------------- Now let's clear up the unmanaged service entries by adding the following -entries to our bundle... +entries to our bundle. .. code-block:: xml @@ -546,90 +554,7 @@ Now we run the client and see there are no more unmanaged entries! :: Total managed entries: 205 Unmanaged entries: 0 -Dynamic (web) Reports ---------------------- - -Download the `Django`_ rpm and install it. I was able to find an RPM at -ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/5/x86_64/Django-1.1.1-2.el5.noarch.rpm. You will also need to ``yum install httpd``. - -.. _Django: http://www.djangoproject.com/ - -.. note:: I also had to grab the following RPMs - - * ftp://ftp.pbone.net/mirror/ftp.freshrpms.net/pub/freshrpms/pub/dag/redhat/el5/en/x86_64/dag/RPMS/python-simplejson-2.0.5-1.el5.rf.x86_64.rpm - * ftp://ftp.pbone.net/mirror/atrpms.net/el5-x86_64/atrpms/stable/python-sqlite2-2.3.3-3_0.1.el5.x86_64.rpm - -* Now we need to create the sqlite database:: - - [root@centos ~]# python /usr/lib/python2.4/site-packages/Bcfg2/Server/Reports/manage.py syncdb - Creating table auth_permission - Creating table auth_group - Creating table auth_user - Creating table auth_message - Creating table django_content_type - Creating table django_session - Creating table django_site - Creating table django_admin_log - Creating table reports_client - Creating table reports_ping - Creating table reports_interaction - Creating table reports_reason - Creating table reports_entries - Creating table reports_entries_interactions - Creating table reports_performance - Creating table reports_internaldatabaseversion - - You just installed Django's auth system, which means you don't have any superusers defined. - Would you like to create one now? (yes/no): no - Installing index for auth.Permission model - Installing index for auth.Message model - Installing index for admin.LogEntry model - Installing index for reports.Client model - Installing index for reports.Ping model - Installing index for reports.Interaction model - Installing index for reports.Entries model - Installing index for reports.Entries_interactions model - -* Add DBStats to the plugins line of bcfg2.conf. The resulting - **[server]** section should look something like this:: - - [server] - repository = /var/lib/bcfg2 - plugins = Base,Bundler,Cfg,DBStats,Metadata,Packages,Probes,Rules,SSHbase - -* Start/restart the bcfg2 server -* Run the bcfg2 client in order to populate the statistics database - (this run should take a bit longer since you are uploading the client - statistics to the database). -* Download the static reports content:: - - root@lucid:~# cd /var/www/ - root@lucid:/var/www# svn co https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2/reports - -* Configure Apache using :ref:`dynamic-http-install` as a guide -* Copy server/statistics sections of bcfg2.conf to - ``/etc/bcfg2-web.conf`` (make sure it is world-readable). You should - then have something like this:: - - [server] - repository = /var/lib/bcfg2 - plugins = Base,Bundler,Cfg,DBStats,Metadata,Packages,Probes,Rules,SSHbase - - [statistics] - sendmailpath = /usr/lib/sendmail - database_engine = sqlite3 - # 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'. - database_name = - # Or path to database file if using sqlite3. - #/etc/brpt.sqlite is default path if left empty - database_user = - # Not used with sqlite3. - database_password = - # Not used with sqlite3. - database_host = - # Not used with sqlite3. - database_port = - # Set to empty string for default. Not used with sqlite3. - web_debug = True - -* Restart apache and point a browser to your bcfg2 server +Dynamic (web) reports +===================== + +See installation instructions at :ref:`server-reports-install` diff --git a/doc/quickstart/index.txt b/doc/quickstart/index.txt index 29ea8f27b..a544d0786 100644 --- a/doc/quickstart/index.txt +++ b/doc/quickstart/index.txt @@ -65,8 +65,9 @@ acting like it is your first client. you are done. Don't run this command on a production system if you don't know what it does and aren't prepared for the consequences. We don't know of anybody having problems with it - before, but it is better to be safe than sorry. And now for the - command:: + before, but it is better to be safe than sorry. + +And now for the command:: bcfg2 -q -v -n @@ -241,9 +242,9 @@ Several other utilities can help from this point on: core (minus the networking code) for examination. From this, you can directly query: - * Client Metadata - * Which entries are provided by particular plugins - * Client Configurations +* Client Metadata +* Which entries are provided by particular plugins +* Client Configurations Run ``bcfg2-info``, and type help and the prompt when it comes up. diff --git a/doc/quickstart/ubuntu.txt b/doc/quickstart/ubuntu.txt index a45d6744d..db9719739 100644 --- a/doc/quickstart/ubuntu.txt +++ b/doc/quickstart/ubuntu.txt @@ -2,16 +2,19 @@ .. _quickstart-ubuntu: +===================== Quickstart for Ubuntu -=================================================== +===================== .. note:: - This particular how to was done on lucid, but should apply to any other `recent`_ version of Ubuntu. -.. _recent: http://www.ubuntu.com/products/ubuntu/release-cycle + This particular how to was done on lucid, but should apply to any + other `recent-ubuntu-release`_ version of Ubuntu. + +.. _recent-ubuntu-release: http://www.ubuntu.com/products/ubuntu/release-cycle Install Bcfg2 -------------- +============= We first need to install the server. For this example, we will use the bcfg2 server package from the bcfg2 `PPA`_ (note that there is also a @@ -20,12 +23,12 @@ version available in the ubuntu archives, but it is not as up to date). .. _PPA: https://launchpad.net/~bcfg2/+archive/ppa Add the Ubuntu PPA listing to your APT sources -++++++++++++++++++++++++++++++++++++++++++++++ +---------------------------------------------- See http://trac.mcs.anl.gov/projects/bcfg2/wiki/PrecompiledPackages#UbuntuLucid Install bcfg2-server -++++++++++++++++++++ +-------------------- :: aptitude install bcfg2-server @@ -35,18 +38,18 @@ Remove the default configuration preseeded by the ubuntu package:: root@lucid:~# rm -rf /etc/bcfg2* /var/lib/bcfg2 Initialize your repository --------------------------- +========================== Now that you're done with the install, you need to intialize your repository and setup your bcfg2.conf. bcfg2-admin init is a tool which allows you to automate this process.:: root@lucid:~# bcfg2-admin init - Store bcfg2 configuration in [/etc/bcfg2.conf]: - Location of bcfg2 repository [/var/lib/bcfg2]: + Store bcfg2 configuration in [/etc/bcfg2.conf]: + Location of bcfg2 repository [/var/lib/bcfg2]: Input password used for communication verification (without echoing; leave blank for a random): What is the server's hostname: [lucid] - Input the server location [https://lucid:6789]: + Input the server location [https://lucid:6789]: Input base Operating System for clients: 1: Redhat/Fedora/RHEL/RHAS/Centos 2: SUSE/SLES @@ -70,7 +73,7 @@ allows you to automate this process.:: Of course, change responses as necessary. Start the server ----------------- +================ You are now ready to start your bcfg2 server for the first time.:: @@ -100,13 +103,13 @@ Run bcfg2 to be sure you are able to communicate with the server:: Unmanaged entries: 382 Bring your first machine under Bcfg2 control --------------------------------------------- +============================================ Now it is time to get your first machine's configuration into your Bcfg2 repository. Let's start with the server itself. Setup the `Packages`_ plugin -++++++++++++++++++++++++++++ +---------------------------- .. _Packages: http://trac.mcs.anl.gov/projects/bcfg2/wiki/Plugins/Packages @@ -238,7 +241,7 @@ Now we restart the bcfg2-server:: Dec 17 22:37:28 lucid bcfg2-server[17937]: Processed 17 fam events in 0.502 seconds. 0 coalesced Start managing packages -+++++++++++++++++++++++ +----------------------- Add a base-packages bundle. Let's see what happens when we just populate it with the ubuntu-standard package. @@ -405,7 +408,7 @@ As you can see below, I no longer have any unmanaged packages. :: Service:bcfg2-server Service:grub-common Service:ondemand Service:rsync Service:ssh Manage services -+++++++++++++++ +--------------- Now let's clear up the unmanaged service entries by adding the following entries to our bundle... @@ -469,84 +472,7 @@ Now we run the client and see there are no more unmanaged entries! :: All entries correct. -Dynamic (web) Reports ---------------------- - -First, run ``aptitude install python-django apache2 -libapache2-mod-python``. - -* Now we need to create the sqlite database:: - - root@lucid:~# python /usr/share/pyshared/Bcfg2/Server/Reports/manage.py syncdb - Creating table auth_permission - Creating table auth_group - Creating table auth_user - Creating table auth_message - Creating table django_content_type - Creating table django_session - Creating table django_site - Creating table django_admin_log - Creating table reports_client - Creating table reports_ping - Creating table reports_interaction - Creating table reports_reason - Creating table reports_entries - Creating table reports_entries_interactions - Creating table reports_performance - Creating table reports_internaldatabaseversion - - You just installed Django's auth system, which means you don't have any superusers defined. - Would you like to create one now? (yes/no): no - Installing index for auth.Permission model - Installing index for auth.Message model - Installing index for admin.LogEntry model - Installing index for reports.Client model - Installing index for reports.Ping model - Installing index for reports.Interaction model - Installing index for reports.Entries model - Installing index for reports.Entries_interactions model - -* Add DBStats to the plugins line of bcfg2.conf. The resulting [server] - section should look something like this:: - - [server] - repository = /var/lib/bcfg2 - plugins = Base,Bundler,Cfg,DBStats,Metadata,Packages,Probes,Rules,SSHbase - -* Start/restart the bcfg2 server -* Run the bcfg2 client in order to populate the statistics database - (this run should take a bit longer since you are uploading the client - statistics to the database). -* Download the static reports content:: - - root@lucid:~# cd /var/www/ - root@lucid:/var/www# svn co https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2/reports - -* Configure Apache using -* :ref:`dynamic-http-install` as a guide -* Copy server/statistics sections of bcfg2.conf to - ``/etc/bcfg2-web.conf`` (make sure it is world-readable). You should - then have something like this:: - - [server] - repository = /var/lib/bcfg2 - plugins = Base,Bundler,Cfg,DBStats,Metadata,Packages,Probes,Rules,SSHbase - - [statistics] - sendmailpath = /usr/lib/sendmail - database_engine = sqlite3 - # 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'. - database_name = - # Or path to database file if using sqlite3. - #/etc/brpt.sqlite is default path if left empty - database_user = - # Not used with sqlite3. - database_password = - # Not used with sqlite3. - database_host = - # Not used with sqlite3. - database_port = - # Set to empty string for default. Not used with sqlite3. - web_debug = True - -* Restart apache and point a browser to your bcfg2 server +Dynamic (web) reports +===================== + +See installation instructions at :ref:`server-reports-install` diff --git a/doc/server/reports/index.txt b/doc/server/reports/index.txt index 1360d5ffd..bef686305 100644 --- a/doc/server/reports/index.txt +++ b/doc/server/reports/index.txt @@ -24,5 +24,6 @@ uses django and a database backend. .. toctree:: :maxdepth: 2 + install static dynamic diff --git a/doc/server/reports/install.txt b/doc/server/reports/install.txt new file mode 100644 index 000000000..6d081fffd --- /dev/null +++ b/doc/server/reports/install.txt @@ -0,0 +1,181 @@ +.. -*- mode: rst -*- + +.. _EPEL: http://fedoraproject.org/wiki/EPEL + +.. This is combination of the Ubuntu guide and the Centos guide for + installing the web reports. + +.. _server-reports-install: + +===================== +Dynamic (web) Reports +===================== + +The first step is to install the needed software components like the +Django framework and the database (SQlite2). All packages for Fedora +are in the Fedora Package Collection or in EPEL_ for CentOS/RHEL:: + + [root@system01 ~]# yum -y install Django python-simplejson python-sqlite2 + +Of course is a web server needed as well:: + + [root@system01 ~]# yum -y install httpd mod_python + +The same packages are needed for Ubuntu systems:: + + [root@system01 ~]# aptitude install python-django apache2 libapache2-mod-python + +Now we need to create the sqlite database. Use the following command on +Fedora, CentOS, or RHEL.:: + + [root@system01 ~]# python /usr/lib/python2.4/site-packages/Bcfg2/Server/Reports/manage.py syncdb + Creating table auth_permission + Creating table auth_group + Creating table auth_user + Creating table auth_message + Creating table django_content_type + Creating table django_session + Creating table django_site + Creating table django_admin_log + Creating table reports_client + Creating table reports_ping + Creating table reports_interaction + Creating table reports_reason + Creating table reports_entries + Creating table reports_entries_interactions + Creating table reports_performance + Creating table reports_internaldatabaseversion + + You just installed Django's auth system, which means you don't have any superusers defined. + Would you like to create one now? (yes/no): no + Installing index for auth.Permission model + Installing index for auth.Message model + Installing index for admin.LogEntry model + Installing index for reports.Client model + Installing index for reports.Ping model + Installing index for reports.Interaction model + Installing index for reports.Entries model + Installing index for reports.Entries_interactions model + +.. note:: There are different versions of Python available. If you are + unsure about your installed version use the following line instead of + the line above.:: + + [root@system01 ~]# PYVER=`python -c 'import sys;print(sys.version[0:3])'`; python /usr/lib/python$PYVER/site-packages/Bcfg2/site-packages/Bcfg2/Server/Reports/manage.py syncdb + +The path on Ubuntu systems is different. Please use the same path as shown +in the following command to execute the script on an Ubuntu machine in +the next steps:: + + [root@system01 ~]# python /usr/share/pyshared/Bcfg2/Server/Reports/manage.py syncdb + Creating table auth_permission + Creating table auth_group + Creating table auth_user + Creating table auth_message + Creating table django_content_type + Creating table django_session + Creating table django_site + Creating table django_admin_log + Creating table reports_client + Creating table reports_ping + Creating table reports_interaction + Creating table reports_reason + Creating table reports_entries + Creating table reports_entries_interactions + Creating table reports_performance + Creating table reports_internaldatabaseversion + + You just installed Django's auth system, which means you don't have any superusers defined. + Would you like to create one now? (yes/no): no + Installing index for auth.Permission model + Installing index for auth.Message model + Installing index for admin.LogEntry model + Installing index for reports.Client model + Installing index for reports.Ping model + Installing index for reports.Interaction model + Installing index for reports.Entries model + Installing index for reports.Entries_interactions model + +The server should be tested to make sure that there are no mistakes:: + + [root@system01 ~]# python /usr/lib/python2.6/site-packages/Bcfg2/Server/Reports/manage.py testserver + Creating test database... + Creating table auth_permission + Creating table auth_group + Creating table auth_user + Creating table auth_message + Creating table django_content_type + Creating table django_session + Creating table django_site + Creating table django_admin_log + Creating table reports_client + Creating table reports_ping + Creating table reports_interaction + Creating table reports_reason + Creating table reports_entries + Creating table reports_entries_interactions + Creating table reports_performance + Creating table reports_internaldatabaseversion + Installing index for auth.Permission model + Installing index for auth.Message model + Installing index for admin.LogEntry model + Installing index for reports.Client model + Installing index for reports.Ping model + Installing index for reports.Interaction model + Installing index for reports.Entries model + Installing index for reports.Entries_interactions model + Validating models... + 0 errors found + + Django version 1.1.1, using settings 'Reports.settings' + Development server is running at http://127.0.0.1:8000/ + Quit the server with CONTROL-C. + +Add DBStats to the plugins line of ``bcfg2.conf``. The resulting +**[server]** section should look something like this:: + + [server] + repository = /var/lib/bcfg2 + plugins = Base,Bundler,Cfg,DBStats,Metadata,Packages,Probes,Rules,SSHbase + +Start/restart the Bcfg2 server:: + + [root@system01 ~]# /etc/init.d/bcfg2-server restart + +Run the Bcfg2 client in order to populate the statistics database +(this run should take a bit longer since you are uploading the client +statistics to the database). + +Download the static reports content:: + + [root@system01 ~]# cd /var/www/ + [root@system01 ~]# svn co https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2/reports + +Configure Apache using :ref:`dynamic-http-install` as a guide + +Copy server/statistics sections of ``bcfg2.conf`` to +``/etc/bcfg2-web.conf`` (make sure it is world-readable). You should +then have something like this:: + + [server] + repository = /var/lib/bcfg2 + plugins = Base,Bundler,Cfg,DBStats,Metadata,Packages,Probes,Rules,SSHbase + + [statistics] + sendmailpath = /usr/lib/sendmail + database_engine = sqlite3 + # 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'. + database_name = + # Or path to database file if using sqlite3. + #/etc/brpt.sqlite is default path if left empty + database_user = + # Not used with sqlite3. + database_password = + # Not used with sqlite3. + database_host = + # Not used with sqlite3. + database_port = + # Set to empty string for default. Not used with sqlite3. + web_debug = True + +Restart apache and point a browser to your Bcfg2 server. diff --git a/doc/unsorted/index.txt b/doc/unsorted/index.txt index 8e079de10..3ff8e4c70 100644 --- a/doc/unsorted/index.txt +++ b/doc/unsorted/index.txt @@ -13,8 +13,6 @@ list below. .. _TitleIndex: https://trac.mcs.anl.gov/projects/bcfg2/wiki/TitleIndex -* `ManualPages` -* `Plugins/Ohai` * `Plugins/Snapshots` * `PrecompiledPackages` * `Publications` @@ -23,10 +21,8 @@ list below. * `SchemaEvolution` * `SecurityDevPlan` * `ServerSideOverview` -* `TOC` * `Troubleshooting` * `UpgradeTesting` -* `UsingRcache` * `VimSnippetSupport` .. toctree:: -- cgit v1.2.3-1-g7c22