Changes between Version 2 and Version 3 of AnnotatedExamples


Ignore:
Timestamp:
10/06/06 06:26:52 (17 years ago)
Author:
dclark
Comment:

Added mysql example from recent mailing list email

Legend:

Unmodified
Added
Removed
Modified
  • AnnotatedExamples

    v2 v3  
     1= Annotated Examples = 
     2 
    13== ntp example == 
     4 
     5Author: Jason Pepas  
    26 
    37Here is a series of example configurations for bcfg2, each introducing another layer of functionality.   
     
    115119nothing else), the bcfg2 client can be run with a -b <bundle name> 
    116120option that will only update entries in the specified bundle. 
     121 
     122== mysql example == 
     123 
     124Author: Patrick Ruckstuhl 
     125 
     126I had some time ago to continue with putting my configuration into 
     127bcfg2 and maybe this helps someone else. 
     128 
     129I added a new bundle: 
     130{{{ 
     131<Bundle name="mysql-server" version="3.0"> 
     132   <ConfigFile name="/root/bcfg2-install/mysql/users.sh"/> 
     133   <ConfigFile name="/root/bcfg2-install/mysql/users.sql"/> 
     134   <PostInstall name="/root/bcfg2-install/mysql/users.sh"/> 
     135   <Package name="mysql-server-4.1"/> 
     136   <Service name="mysql"/> 
     137</Bundle> 
     138}}} 
     139 
     140The `users.sh` script looks like this: 
     141{{{ 
     142#!/bin/sh 
     143 
     144mysql --defaults-extra-file=/etc/mysql/debian.cnf mysql \ 
     145    < /root/bcfg2-install/mysql/users.sql 
     146}}} 
     147 
     148On debian there is a user account in `/etc/mysql/debian.cnf` automatically created, but you could also create such a file yourself, with contents like: 
     149{{{ 
     150[client] 
     151host     = localhost 
     152user     = debian-sys-maint 
     153password = XXXXXXXXXX 
     154}}} 
     155 
     156The `users.sql` looks like this: 
     157{{{ 
     158DELETE FROM db; 
     159INSERT INTO db VALUES ('localhost', 'phpmyadmin', 'pma', 'Y', 'Y', 
     160'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'); 
     161 
     162DELETE FROM user WHERE User <> 'debian-sys-maint'; 
     163INSERT INTO user VALUES ('localhost', 'root', 'XXXXXXXXXXX', 'Y', 'Y', 
     164'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 
     165'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', 0, 0, 0); 
     166INSERT INTO user VALUES ('localhost', 'pma', '', 'N', 'N', 'N', 'N', 
     167'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 
     168'N', 'N', 'N', '', '', '', '', 0, 0, 0); 
     169 
     170FLUSH PRIVILEGES; 
     171}}}