[Spacewalk-list] Kickstart post install

Lachlan Musicman datakid at gmail.com
Wed Mar 30 05:55:20 UTC 2016


In one particular profile, I'll be installing MariaDB.

I'd like to create a db, user, and then secure MariaDB during the
post-install stage.

My post install script looks like this:

%post --log /root/ks-post.log.5
#!/bin/bash
/usr/bin/mysql -e "create database slurmdb; grant all privileges on
slurmdb.* to slurm at localhost identified by 'slurmdb_password';"
/usr/bin/mysql <<-EOF
UPDATE mysql.user SET Password=PASSWORD('mysqlpassword') WHERE User='root';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost',
'127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%';
FLUSH PRIVILEGES;
EOF
%end

But it's not working - neither the database being created or mysql
being secured.

Is my syntax wrong, am I over reaching?

L.




------
The most dangerous phrase in the language is, "We've always done it this
way."

- Grace Hopper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20160330/66a9803c/attachment.htm>


More information about the Spacewalk-list mailing list