init.pp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Module:: common
  2. # Manifest:: init.pp
  3. #
  4. # Lorraine Data Network http://ldn-fai.net/
  5. # Author:: Sebastien Badia (<seb@sebian.fr>)
  6. # Date:: 2013-12-07 15:28:58 +0100
  7. # Maintainer:: Sebastien Badia (<seb@sebian.fr>)
  8. #
  9. # Class:: common
  10. #
  11. #
  12. class common {
  13. class {'dnsclient':
  14. nameservers => hiera_array('nameservers', undef),
  15. options => 'UNSET',
  16. search => hiera("domain"),
  17. domain => hiera("domain"),
  18. }
  19. # TODO, apt-proxy
  20. # Remove apt-xapian-index (on low memory vm, xapian take a lot of RAM/CPU)
  21. # https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/363695
  22. package {'apt-xapian-index':
  23. ensure => purged,
  24. }
  25. # Setup timezone
  26. class {
  27. 'timezone':
  28. timezone => hiera("timezone"),
  29. autoupgrade => false;
  30. }
  31. class {'locales':
  32. default_locale => 'en_US.UTF-8',
  33. locales => hiera("locales")
  34. }
  35. ensure_packages(['tmux','screen','netcat','htop','rsync','host','dmraid',
  36. 'man-db','vim','zsh','bash','iputils-ping','dnsutils',
  37. 'python-apt','aptitude','debian-goodies','molly-guard'])
  38. # TODO, sudo / sudo-ldap
  39. # TODO, sudo %puppetdev
  40. # TODO, ssh_auth_sock
  41. # TODO, backup user
  42. file {
  43. '/usr/local/bin/cronic':
  44. ensure => file,
  45. source => 'puppet:///modules/common/cronic',
  46. owner => root,
  47. group => root,
  48. mode => '0755';
  49. }
  50. file {
  51. '/etc/alternatives/editor':
  52. ensure => link,
  53. target => '/usr/bin/vim',
  54. require => Package['vim'];
  55. '/bin/sh':
  56. ensure => link,
  57. target => '/bin/dash';
  58. }
  59. file {
  60. '/etc/hostname':
  61. ensure => file,
  62. content => $::fqdn,
  63. owner => root,
  64. group => root,
  65. mode => '0644',
  66. notify => Exec['reload hostname'];
  67. '/etc/mailname':
  68. ensure => file,
  69. content => $::fqdn,
  70. owner => root,
  71. group => root,
  72. mode => '0644';
  73. }
  74. exec {
  75. 'reload hostname':
  76. command => '/bin/sh /etc/init.d/hostname.sh start',
  77. user => root,
  78. refreshonly => true,
  79. logoutput => on_failure;
  80. }
  81. # TODO, setup sources
  82. # TODO, setup ssh
  83. class {'::motd': template => 'common/motd.erb'; }
  84. # Avoid a strange bug with facter
  85. # Could not retrieve fact='selinux', resolution='<anonymous>'': Invalid argument - /proc/self/attr/current
  86. if $::selinux == 'false' {
  87. file {'/selinux/enforce': ensure => absent }
  88. }
  89. } # Class:: common