test_tablespace.pp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # puppet-postgresql
  2. # For all details and documentation:
  3. # http://github.com/inkling/puppet-postgresql
  4. #
  5. # Copyright 2012- Inkling Systems, Inc.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. class postgresql_tests::system_default::test_tablespace {
  19. include postgresql::server
  20. file { '/tmp':
  21. ensure => 'directory',
  22. }
  23. file { '/tmp/pg_tablespaces':
  24. ensure => 'directory',
  25. owner => 'postgres',
  26. group => 'postgres',
  27. mode => '0700',
  28. require => File['/tmp'],
  29. }
  30. postgresql::tablespace{ 'tablespace1':
  31. location => '/tmp/pg_tablespaces/space1',
  32. require => [Class['postgresql::server'], File['/tmp/pg_tablespaces']],
  33. }
  34. postgresql::database{ 'tablespacedb1':
  35. charset => 'utf8',
  36. tablespace => 'tablespace1',
  37. require => Postgresql::Tablespace['tablespace1'],
  38. }
  39. postgresql::db{ 'tablespacedb2':
  40. user => 'dbuser2',
  41. password => 'dbuser2',
  42. tablespace => 'tablespace1',
  43. require => Postgresql::Tablespace['tablespace1'],
  44. }
  45. postgresql::database_user{ 'spcuser':
  46. password_hash => postgresql_password('spcuser', 'spcuser'),
  47. require => Class['postgresql::server'],
  48. }
  49. postgresql::tablespace{ 'tablespace2':
  50. location => '/tmp/pg_tablespaces/space2',
  51. owner => 'spcuser',
  52. require => [Postgresql::Database_user['spcuser'], File['/tmp/pg_tablespaces']],
  53. }
  54. postgresql::database{ 'tablespacedb3':
  55. charset => 'utf8',
  56. tablespace => 'tablespace2',
  57. require => Postgresql::Tablespace['tablespace2'],
  58. }
  59. }