| 64 | |
| 65 | === create a bundle === |
| 66 | |
| 67 | The above configuration layout works fine for a single service, but |
| 68 | that method of organization would quickly become a nightmare as you |
| 69 | approach the number of packages, services, and config files required |
| 70 | to represent a fully configured host. Bundles allow the grouping of |
| 71 | related configuration entries that are used to provide a single |
| 72 | service. This is done for several reasons: |
| 73 | * Grouping related things in one place makes it easier to add those |
| 74 | entries for a multiple groups of clients |
| 75 | * Grouping entries into bundles makes their validation occur |
| 76 | collectively. This means that config files can override the |
| 77 | contents of packages. Also, config files are rechecked after |
| 78 | packages are upgraded, so that they can be repaired if the package |
| 79 | install clobbered them. |
| 80 | * Services associated with a bundle get restarted whenever any |
| 81 | entity in that bundle is modified. This ensures that new |
| 82 | configuration files and software are used after installation. |
| 83 | |
| 84 | The config file, package, and |
| 85 | service are really all related components describing the idea of an |
| 86 | ntp client, so they should be logically grouped together. We use a |
| 87 | bundle to accomplish this. |
| 88 | |
| 89 | {{{ |
| 90 | # cat Bundler/ntp.xml |
| 91 | <Bundle name='ntp' version='2.0'> |
| 92 | <Package name='ntp'/> |
| 93 | <Service name='ntpd'/> |
| 94 | <ConfigFile name='/etc/ntp.conf'/> |
| 95 | </Bundle> |
| 96 | }}} |
| 97 | |
| 98 | After this bundle is created, it must be associated with a group (or |
| 99 | groups). Add a bundle child element to the group(s) which should install this bundle. |
| 100 | |
| 101 | {{{ |
| 102 | # cat Metadata/groups.xml |
| 103 | <Groups> |
| 104 | ... |
| 105 | <Group name='fedora'> |
| 106 | <Bundle name='ntp'/> |
| 107 | </Group> |
| 108 | ... |
| 109 | </Groups> |
| 110 | }}} |
| 111 | |
| 112 | Once this bundle is created, a client reconfigure will install these |
| 113 | entries. If any are modified, then the ntpd service will be |
| 114 | restarted. If you only want ntp configurations to be updated (and |
| 115 | nothing else), the bcfg2 client can be run with a -b <bundle name> |
| 116 | option that will only update entries in the specified bundle. |