Changes between Version 8 and Version 9 of TracNav
- Timestamp:
- 04/27/10 04:57:34 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracNav
v8 v9 6 6 machines and diverse architectures. The ultimate goal of 7 7 configuration management is to make machines as consistent, easily 8 manageable, and up to date as possible. This document describes a typical installation of bcfg2. 8 manageable, and up to date as possible. This document describes a 9 typical installation of Bcfg2. 9 10 10 11 == Bcfg2 Server == 11 12 12 13 Each deployment will have a central bcfg2 server. 13 This machine runs 14 the Bcfg2 server daemon as well as keeps the Bcfg2 configuration 14 This machine runs the Bcfg2 server daemon as well as keeps the Bcfg2 configuration 15 15 repository as well as serving package data when needed. The server uses XML-RPC 16 16 for its communications and this channel is encrypted using SSL. The 17 Bcfg2 server and client get the connection information from the /etc/18 bcfg2.conf configuration file. An example /etc/bcfg2.conflooks like:17 Bcfg2 server and client get the connection information from the `/etc/ 18 bcfg2.conf` configuration file. An example `/etc/bcfg2.conf` looks like: 19 19 20 20 {{{ 21 21 [server] 22 repository = /var/ db/bcfg22 repository = /var/lib/bcfg2 23 23 structures = Bundler,Base 24 generators = SSHbase,Cfg,Pkgmgr,Svcmgr,TCheetah 25 metadata = /var/db/bcfg/etc 24 generators = SSHbase,Cfg,Pkgmgr,Rules 25 # Uncomment to use the DBStats plugin (0.9.6pre2 and later) 26 plugins = DBStats 26 27 27 28 [statistics] 28 sendmailpath = /usr/sbin/sendmail 29 sendmailpath = /usr/lib/sendmail 30 database_engine = sqlite3 31 # 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'. 32 database_name = 33 # Or path to database file if using sqlite3. 34 #<repository>/etc/brpt.sqlite is default path if left empty 35 database_user = 36 # Not used with sqlite3. 37 database_password = 38 # Not used with sqlite3. 39 database_host = 40 # Not used with sqlite3. 41 database_port = 42 # Set to empty string for default. Not used with sqlite3. 43 web_debug = True 29 44 30 45 [communication] 31 46 protocol = xmlrpc/ssl 32 password = verysecret 33 key = /usr/share/ssl/bcfg2/server-key.pem 47 password = PASSWORD 48 key = /etc/bcfg2.key 49 # fingerprint of server (from bcfg2-admin fingerprint) 50 #fingerprint = [server fingerprint] 34 51 35 52 [components] … … 53 70 A config file 54 71 Service 55 A service to start or stop on boot (usually kept in /etc/init.d)72 A service to start or stop on boot (usually kept in `/etc/init.d/`) 56 73 Directory 57 74 A directory that should be present … … 76 93 77 94 Here we can see that for the Group rhel, the syslog Bundle contains a 78 !ConfigFile element /etc/syslog.conf, a Package element sysklogd, and95 !ConfigFile element `/etc/syslog.conf`, a Package element sysklogd, and 79 96 a Service element syslog. This defines a relationship between all 80 97 these elements, so that if one of these changes, examination of all 81 98 the elements should be taken more closely. For example, say you 82 update the /etc/syslog.conffile. Once it's been updated the syslog99 update the `/etc/syslog.conf` file. Once it's been updated the syslog 83 100 service should be restarted. Bcfg2 takes care of this automatically 84 101 for you. … … 86 103 Bundles should be fairly discrete and simple and their relationship 87 104 should be tight. We wouldn't want to put the sshd service in the 88 syslog Bundle even though sshd does use syslog. Restarting sshd when /89 etc/syslog.conf changes or when a new sysklogd package comes out105 syslog Bundle even though sshd does use syslog. Restarting sshd when `/ 106 etc/syslog.conf` changes or when a new sysklogd package comes out 90 107 doesn't make sense. 91 108 … … 150 167 file, but it could easily be automated. Enter Generators. 151 168 With a Generator you can have it so the it takes care of the 152 management of the particular !ConfigFile elements such as /etc/ssh/153 known_hosts and the host keys. What would happen is when a client169 management of the particular !ConfigFile elements such as `/etc/ssh/ 170 known_hosts` and the host keys. What would happen is when a client 154 171 contacts the Bcfg2 server and requests those !ConfigFile elements 155 172 handled by the Generator, the Generator will take care of auto- … … 173 190 The Bcfg2 repository is just a collection of directories and files 174 191 that direct the Bcfg2 server how to build configurations for hosts. 175 The majority of the repository is kept in /var/db/bcfgon ci-192 The majority of the repository is kept in `/var/db/bcfg` on ci- 176 193 www.uchicago.edu but the package repository is kept on ci- 177 194 nfs.uchicago.edu and NFS exported. The package repository is 178 automounted at /autonfs/media, for the original installation media,179 and /autonfs/updates, for updated packages. Within the central Bcfg2195 automounted at `/autonfs/media`, for the original installation media, 196 and `/autonfs/updates`, for updated packages. Within the central Bcfg2 180 197 repository there are several directories that contain configuration 181 parameters for establishing a pa prticular configuration for a host.198 parameters for establishing a particular configuration for a host. 182 199 183 200 ==== Metadata/ Directory ==== 184 201 185 The Metadata/directory contains several configuration files that202 The `Metadata/` directory contains several configuration files that 186 203 dictate how to start generating a configuration for a host. 187 204 188 205 ===== Metadata/groups.xml ===== 189 206 190 The groups.xmlcontains Group and Profile definitions. Here's a very191 basic Metadata/groups.xml:207 The `groups.xml` contains Group and Profile definitions. Here's a very 208 basic `Metadata/groups.xml`: 192 209 193 210 {{{ … … 208 225 ===== Metadata/clients.xml ===== 209 226 210 The Metadata/clients.xmlfile contains the mappings of Profiles to227 The `Metadata/clients.xml` file contains the mappings of Profiles to 211 228 clients. A sample from this file is: 212 229 … … 226 243 ==== Bundler/ Directory ==== 227 244 228 The Bundler/directory is where all the Bcfg2 bundle XML files are245 The `Bundler/` directory is where all the Bcfg2 bundle XML files are 229 246 kept. These are the files described above. 230 247 231 248 ==== Pkgmgr/ Directory ==== 232 249 233 The Pkgmgr/directory keeps the XML files that define what packages250 The `Pkgmgr/` directory keeps the XML files that define what packages 234 251 are available for a host or image and where to find those packages. 235 252 Here's an example of the files: … … 298 315 ==== Svcmgr/ Directory ==== 299 316 300 The Svcmgrdirectory is responsible for defining the state of301 Services. Like the Pkgmgr directory, the Svcmgrdirectory can contain317 The `Svcmgr` directory is responsible for defining the state of 318 Services. Like the `Pkgmgr` directory, the `Svcmgr` directory can contain 302 319 multiple files to allow the administrator to divide the definitions 303 320 of services up. Here's a simple example: … … 336 353 }}} 337 354 338 Like the Pkgmgr directory and the Svcmgrdirectory, the Base355 Like the `Pkgmgr` directory and the `Svcmgr` directory, the Base 339 356 directory can contain multiple files and the appropriate file is 340 357 chosen based on the Group membership: … … 354 371 !ConfigFile element listed in a Bundle you need to provide Bcfg with 355 372 the actual configuration file to give to the host. The directory 356 structure under the Cfg/directory defines where the configuration373 structure under the `Cfg/` directory defines where the configuration 357 374 file should be placed on the host machine relative to the / 358 directory. For example, if you want to manage /etc/motdyou would359 create the directory Cfg/etc/motd/ and then place the /etc/motdfile375 directory. For example, if you want to manage `/etc/motd` you would 376 create the directory `Cfg/etc/motd/` and then place the `/etc/motd` file 360 377 in that directory. 361 378 362 379 ===== Specialized Configuration Files ===== 363 380 364 Some hosts or Groups might need a different version of /etc/motdor381 Some hosts or Groups might need a different version of `/etc/motd` or 365 382 might just need to add or remove lines from it. You can create 366 383 specialized versions for a particular host by appending .H_ to the … … 413 430 Bcfg2 has finer grained control over how to deliver configuration 414 431 files to a host. Let's say we have a Group named file-server. Members 415 of this group need the exact same /etc/motdas all other hosts except432 of this group need the exact same `/etc/motd` as all other hosts except 416 433 they need one line added. We could copy motd to motd.G01_file-server, 417 434 add the one line to the Group specific version and be done with it, … … 428 445 429 446 Continuing our example for cat files, we would first create a file 430 named motd.G01_file-server.cat. The .cat suffix designates that the447 named `motd.G01_file-server.cat`. The .cat suffix designates that the 431 448 file is a diff. We would then edit that file and add the following 432 449 line: … … 456 473 If our machine isn't foo.example.com then here's what would happen: 457 474 458 Bcfg2 would choose motd.G01_web-serveras the base file. It is the475 Bcfg2 would choose `motd.G01_web-server` as the base file. It is the 459 476 most specific base file for this host. 460 Bcfg2 would apply the motd.G01_mail-server.catdelta to the461 motd.G01_web-serverbase file. It is the least specific delta.462 Bcfg2 would then apply the motd.G02_file-server.catdelta to the477 Bcfg2 would apply the `motd.G01_mail-server.cat` delta to the 478 `motd.G01_web-server` base file. It is the least specific delta. 479 Bcfg2 would then apply the `motd.G02_file-server.cat` delta to the 463 480 result of the delta before it. 464 481 If our machine is foo.example.com then here's what would happen: 465 482 466 Bcfg2 would choose motd.G01_web-serveras the base file. It is the483 Bcfg2 would choose `motd.G01_web-server` as the base file. It is the 467 484 most specific base file for this host. 468 Bcfg2 would apply the motd.H_foo.example.com.catdelta to the469 motd.G01_web-serverbase file.485 Bcfg2 would apply the `motd.H_foo.example.com.cat` delta to the 486 `motd.G01_web-server` base file. 470 487 The reason the other deltas aren't applied to foo.example.com is 471 488 because a .H_ delta is more specific than a .G##_ delta. Bcfg2 … … 480 497 === Report Configuration === 481 498 482 Report generation requires the etc/report-configuration.xmland looks499 Report generation requires the `etc/report-configuration.xml` and looks 483 500 something like: 484 501 … … 515 532 === Report Scripts === 516 533 517 Reports are generated by the /usr/sbin/StatReportsscript.534 Reports are generated by the `/usr/sbin/StatReports` script. 518 535 !GenerateHostInfo 519 gathers the data about the given hosts and writes out etc/hostinfo.xml.520 !StatReports reads the etc/hostinfo.xmland generates521 the reports based on etc/report-configuration.xml. !StatReports will536 gathers the data about the given hosts and writes out `etc/hostinfo.xml`. 537 !StatReports reads the `etc/hostinfo.xml` and generates 538 the reports based on `etc/report-configuration.xml`. !StatReports will 522 539 automatically run !GenerateHostInfo if it has not run within 24 hours. 523 540 !StatReports is usually run nightly from cron. … … 526 543 527 544 For the www and rss mechanisms, you need to define a way to get to 528 the reports generated. The CI reports are stored in /var/db/bcfg/www529 and we need to define an Apache Alias to access it. /etc/httpd/conf.d/530 bcfg2.conf defines the Apache configuration:545 the reports generated. The CI reports are stored in `/var/db/bcfg/www` 546 and we need to define an Apache Alias to access it. `/etc/httpd/conf.d/ 547 bcfg2.conf` defines the Apache configuration: 531 548 532 549 {{{