| 14 | == Design == |
| 15 | |
| 16 | The start will be with the bundles (perhaps the new part can be called `bcfg2-admin bundle browse`). Bundles are a bit different than the other XML files like client.xml or group.xml because every bundle has its own XML file. |
| 17 | |
| 18 | All bundles are store in the `/var/lib/bcfg2/Bundler/` directory. |
| 19 | |
| 20 | * XML files : `/var/lib/bcfg2/Bundler/*.xml` |
| 21 | * gensh files: `/var/lib/bcfg2/Bundler/*.genshi` |
| 22 | |
| 23 | A simple bundle file can look like this : |
| 24 | {{{ |
| 25 | #!text/xml |
| 26 | <Bundle name='motd' version='2.0'> |
| 27 | <ConfigFile name='/etc/motd' /> |
| 28 | </Bundle> |
| 29 | }}} |
| 30 | |
| 31 | There are other [wiki:WritingSpecification#ConfigurationEntityTypes configuration entries] available. |
| 32 | |
| 33 | == Implementation == |
| 34 | |
| 35 | Basically a FUSE file system needs of have three functions. |
| 36 | |
| 37 | * '''init''' - Starts the file system and grabs the file in the `Bundler/` directory |
| 38 | * '''getattr''' - Passes back the attributes of a file (at the moment not needed) |
| 39 | * '''readdir''' - Is needed to use `ls` |
| 40 | |
| 41 | == Usage == |
| 42 | |
| 43 | You need to make a directory with `mkdir [mountpoint]` first. |
| 44 | |
| 45 | {{{ |
| 46 | $ python bcfg2fs.py [mountpoint] |
| 47 | }}} |
| 48 | |
| 49 | Now you can change to the FUSE file system. |
| 50 | |
| 51 | {{{ |
| 52 | $ cd [mountpoint] |
| 53 | }}} |
| 54 | |
| 55 | Use `ls` to browse the directory. |
| 56 | |
| 57 | {{{ |
| 58 | $ ls |
| 59 | }}} |
| 60 | |
| 61 | When you are done, unmount the FUSE directory. |
| 62 | |
| 63 | {{{ |
| 64 | fusemount -u [mountpoint] |
| 65 | }}} |
| 66 | |
| 67 | |