Changes between Version 7 and Version 8 of AnnotatedExamples
- Timestamp:
- 06/01/10 05:44:38 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AnnotatedExamples
v7 v8 8 8 9 9 Here is a series of example configurations for bcfg2, each introducing another layer of functionality. 10 * After each change, run 'bcfg-repo-validate -v'.11 * Run the server with 'bcfg2-server -v'.12 * Update the client with 'bcfg2 -v -d -n'. (will not actually make client changes)10 * After each change, run `bcfg-repo-validate -v`. 11 * Run the server with `bcfg2-server -v`. 12 * Update the client with `bcfg2 -v -d -n`. (will not actually make client changes) 13 13 14 === package only ===14 === Package only === 15 15 16 16 Our example starts with the bare minimum configuration setup. We have a client, a profile group, a list of packages, and a base configuration. … … 19 19 # cat Metadata/clients.xml 20 20 <Clients version='3.0'> 21 <Client profile='fedora' pingable='N' pingtime='0' name='foo.bar.com'/>21 <Client profile='fedora' pingable='N' pingtime='0' name='foo.bar.com'/> 22 22 </Clients> 23 23 24 24 # cat Metadata/groups.xml 25 25 <Groups version='3.0'> 26 <Group profile='true' name='fedora' toolset='rh'/>26 <Group profile='true' name='fedora' toolset='rh'/> 27 27 </Groups> 28 28 … … 30 30 <Base> 31 31 <Group name='fedora'> 32 <Package name='ntp'/>32 <Package name='ntp'/> 33 33 </Group> 34 34 </Base> … … 36 36 # cat Pkgmgr/packages.xml 37 37 <PackageList type='rpm' priority='0'> 38 <Package name='ntp' version='4.2.0.a.20050816-11.FC5'/>38 <Package name='ntp' version='4.2.0.a.20050816-11.FC5'/> 39 39 </PackageList> 40 40 }}} 41 41 42 === add service ===42 === Add service === 43 43 44 44 Configure the service, and add it to the base. … … 46 46 # cat Svcmgr/services.xml 47 47 <Services priority='0'> 48 <Service name='ntpd' status='on'/>48 <Service name='ntpd' status='on'/> 49 49 </Services> 50 50 51 51 # cat Base/base.xml 52 52 <Base> 53 <Group name='fedora'>54 <Package name='ntp'/>55 <Service name='ntpd'/>56 </Group>53 <Group name='fedora'> 54 <Package name='ntp'/> 55 <Service name='ntpd'/> 56 </Group> 57 57 </Base> 58 58 }}} 59 59 60 === add config file ===60 === Add config file === 61 61 62 Setup an etcdirectory structure, and add it to the base.62 Setup an `etc/` directory structure, and add it to the base. 63 63 {{{ 64 64 # cat Cfg/etc/ntp.conf/ntp.conf … … 67 67 # cat Base/base.xml 68 68 <Base> 69 <Group name='fedora'>70 <Package name='ntp'/>71 <Service name='ntpd'/>72 <ConfigFile name='/etc/ntp.conf'/>73 </Group>69 <Group name='fedora'> 70 <Package name='ntp'/> 71 <Service name='ntpd'/> 72 <ConfigFile name='/etc/ntp.conf'/> 73 </Group> 74 74 </Base> 75 75 }}} 76 76 77 === create a bundle ===77 === Ccreate a bundle === 78 78 79 The above configuration layout works fine for a single service, but 80 that method of organization would quickly become a nightmare as you 81 approach the number of packages, services, and config files required 82 to represent a fully configured host. Bundles allow the grouping of 83 related configuration entries that are used to provide a single 84 service. This is done for several reasons: 85 * Grouping related things in one place makes it easier to add those 86 entries for a multiple groups of clients 87 * Grouping entries into bundles makes their validation occur 88 collectively. This means that config files can override the 89 contents of packages. Also, config files are rechecked after 90 packages are upgraded, so that they can be repaired if the package 91 install clobbered them. 92 * Services associated with a bundle get restarted whenever any 93 entity in that bundle is modified. This ensures that new 94 configuration files and software are used after installation. 79 The above configuration layout works fine for a single service, but that method of organization would quickly become a nightmare as you approach the number of packages, services, and config files required to represent a fully configured host. Bundles allow the grouping of related configuration entries that are used to provide a single service. This is done for several reasons: 95 80 96 The config file, package, and 97 service are really all related components describing the idea of an 98 ntp client, so they should be logically grouped together. We use a 99 bundle to accomplish this. 81 * Grouping related things in one place makes it easier to add those entries for a multiple groups of clients 82 * Grouping entries into bundles makes their validation occur collectively. This means that config files can override the contents of packages. Also, config files are rechecked after packages are upgraded, so that they can be repaired if the package install clobbered them. 83 * Services associated with a bundle get restarted whenever any entity in that bundle is modified. This ensures that new configuration files and software are used after installation. 84 85 The config file, package, and service are really all related components describing the idea of an ntp client, so they should be logically grouped together. We use a bundle to accomplish this. 100 86 101 87 {{{ 102 88 # cat Bundler/ntp.xml 103 89 <Bundle name='ntp' version='2.0'> 104 <Package name='ntp'/>105 <Service name='ntpd'/>106 <ConfigFile name='/etc/ntp.conf'/>90 <Package name='ntp'/> 91 <Service name='ntpd'/> 92 <ConfigFile name='/etc/ntp.conf'/> 107 93 </Bundle> 108 94 }}} 109 95 110 After this bundle is created, it must be associated with a group (or 111 groups). Add a bundle child element to the group(s) which should install this bundle. 96 After this bundle is created, it must be associated with a group (or groups). Add a bundle child element to the group(s) which should install this bundle. 112 97 113 98 {{{ … … 122 107 }}} 123 108 124 Once this bundle is created, a client reconfigure will install these 125 entries. If any are modified, then the ntpd service will be 126 restarted. If you only want ntp configurations to be updated (and 127 nothing else), the bcfg2 client can be run with a -b <bundle name> 128 option that will only update entries in the specified bundle. 109 Once this bundle is created, a client reconfigure will install these entries. If any are modified, then the ntpd service will be restarted. If you only want ntp configurations to be updated (and nothing else), the Bcfg2 client can be run with a `-b <bundle name>` option that will only update entries in the specified bundle. 129 110 130 == mysql example ==111 == Mysql example == 131 112 132 113 Author: Patrick Ruckstuhl 133 114 134 I had some time ago to continue with putting my configuration into 135 bcfg2 and maybe this helps someone else. 115 I had some time ago to continue with putting my configuration into Bcfg2 and maybe this helps someone else. 136 116 137 117 I added a new bundle: