Guest User

Untitled

a guest
Apr 23rd, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. NICE but not working:
  2.  
  3. site-mysql/init.pp
  4. class site-mysql inherits mysql {
  5. # operations user
  6. mysql_user{'operations@10.2.111.%':
  7. password_hash => "*DEE65258DA0F2513DE84AD4C1E15557C65602548"
  8. }
  9. mysql_grant{'operations@10.2.111.%':
  10. privileges => 'all',
  11. require => [ Mysql_user['operations@10.2.111.%'] ],
  12. }
  13. }
  14.  
  15. site-mysql/kyushu.pp
  16. class site-mysql::kyushu inherits site-mysql {
  17. $mysql_rootpw = 'eu7shae2ahf5theibohS9ri5'
  18.  
  19. mysql_user{'mgroner@10.2.111.%':
  20. password_hash => "*3ADE0F8B147F85334D5444D01C04918AC6A1B4B0",
  21. }
  22. mysql_grant{'mgroner@10.2.111.%':
  23. privileges => 'all',
  24. require => [ Mysql_user['mgroner@10.2.111.%'] ],
  25. }
  26. mysql::default_database{
  27. 'pitc_swissflirt_test':
  28. username => 'pitc_swissflirt',
  29. password => '*65B3F53CF360764B6B8851FEF58D66DFAE22E809';
  30. }
  31. }
  32.  
  33.  
  34. working alternative:
  35. site-mysql/init.pp
  36. class site-mysql {
  37. # empty
  38. }
  39.  
  40. class site-mysql::kyushu {
  41. $mysql_rootpw = 'eu7shae2ahf5theibohS9ri5'
  42. include mysql
  43. include mysql::default_user
  44.  
  45. mysql_user{'mgroner@10.2.111.%':
  46. password_hash => "*3ADE0F8B147F85334D5444D01C04918AC6A1B4B0",
  47. }
  48. mysql_grant{'mgroner@10.2.111.%':
  49. privileges => 'all',
  50. require => [ Mysql_user['mgroner@10.2.111.%'] ],
  51. }
  52. mysql::default_database{
  53. 'pitc_swissflirt_test':
  54. username => 'pitc_swissflirt',
  55. password => '*65B3F53CF360764B6B8851FEF58D66DFAE22E809';
  56. }
  57. }
  58.  
  59. _why not that way:
  60.  
  61. site-mysql/init.pp
  62. class site-mysql inherits mysql {
  63. # operations user
  64. mysql_user{'operations@10.2.111.%':
  65. password_hash => "*DEE65258DA0F2513DE84AD4C1E15557C65602548"
  66. }
  67. mysql_grant{'operations@10.2.111.%':
  68. privileges => 'all',
  69. require => [ Mysql_user['operations@10.2.111.%'] ],
  70. }
  71. }
  72.  
  73. site-mysql/kyushu.pp
  74. class site-mysql::kyushu {
  75. $mysql_rootpw = 'eu7shae2ahf5theibohS9ri5'
  76. include site-mysql
  77.  
  78. mysql_user{'mgroner@10.2.111.%':
  79. password_hash => "*3ADE0F8B147F85334D5444D01C04918AC6A1B4B0",
  80. }
  81. mysql_grant{'mgroner@10.2.111.%':
  82. privileges => 'all',
  83. require => [ Mysql_user['mgroner@10.2.111.%'] ],
  84. }
  85. mysql::default_database{
  86. 'pitc_swissflirt_test':
  87. username => 'pitc_swissflirt',
  88. password => '*65B3F53CF360764B6B8851FEF58D66DFAE22E809';
  89. }
  90. }
Add Comment
Please, Sign In to add comment