Puppet Class: alkivi_base::config

Defined in:
manifests/config.pp

Overview



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'manifests/config.pp', line 1

class alkivi_base::config () {
  # make sur ssh directory is here
  file {  '/root/.ssh/':
    ensure  => directory,
    owner   => 'root',
    group   => 'root',
    mode    => '0700',
  }

  file {  '/etc/alkivi.conf.d/':
    ensure => directory,
    mode   => '0751',
  }

  # alkivi keys for root
  file {  '/root/.ssh/authorized_keys':
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('alkivi_base/root_authorized_keys.erb'),
    require => [ File['/root/.ssh'], ],
  }

  # make sur ssh directory is here
  file {  '/home/alkivi/.ssh/':
    ensure  => directory,
    owner   => 'alkivi',
    group   => 'alkivi',
    mode    => '0700',
  }

  # alkivi keys for alkivi
  file {  '/home/alkivi/.ssh/authorized_keys':
    ensure  => present,
    owner   => 'alkivi',
    group   => 'alkivi',
    mode    => '0644',
    content => template('alkivi_base/alkivi_authorized_keys.erb'),
    require => [ File['/home/alkivi/.ssh/'] ],
  }


  # Alkivi configuration for alkivi
  file { '/home/alkivi/.alkivi-conf':
    ensure  => directory,
    source  => 'puppet:///modules/alkivi_base/linux-conf',
    recurse => true,
    ignore  => ['.git*', '.netrwhist' ],
  }

  file { '/home/alkivi/.vim':
    ensure  => link,
    target  => '/home/alkivi/.alkivi-conf/vim/.vim',
    force   => true,
    require => File['/home/alkivi/.alkivi-conf'],
    owner   => 'alkivi',
    group   => 'alkivi',
  }

  file { '/home/alkivi/.vimrc':
    ensure  => link,
    target  => '/home/alkivi/.alkivi-conf/vim/.vimrc',
    require => File['/home/alkivi/.alkivi-conf'],
    owner   => 'alkivi',
    group   => 'alkivi',
  }

  file { '/home/alkivi/.screenrc':
    ensure  => link,
    target  => '/home/alkivi/.alkivi-conf/screen/.screenrc',
    require => File['/home/alkivi/.alkivi-conf'],
    owner   => 'alkivi',
    group   => 'alkivi',
  }

  file { '/home/alkivi/.gitconfig':
    ensure  => link,
    target  => '/home/alkivi/.alkivi-conf/git/.gitconfig',
    require => File['/home/alkivi/.alkivi-conf'],
    owner   => 'alkivi',
    group   => 'alkivi',
  }

  file { '/home/alkivi/.bash_aliases':
    ensure  => link,
    target  => '/home/alkivi/.alkivi-conf/bash/.bash_aliases',
    require => File['/home/alkivi/.alkivi-conf'],
    owner   => 'alkivi',
    group   => 'alkivi',
  }

  # Alkivi configuration for root
  file { '/root/.alkivi-conf':
    ensure => link,
    target => '/home/alkivi/.alkivi-conf',
  }

  file { '/root/.vim':
    ensure  => link,
    force   => true,
    target  => '/root/.alkivi-conf/vim/.vim',
    require => File['/root/.alkivi-conf'],
  }

  file { '/root/.vimrc':
    ensure  => link,
    target  => '/root/.alkivi-conf/vim/.vimrc',
    require => File['/root/.alkivi-conf'],
  }

  file { '/root/.screenrc':
    ensure  => link,
    target  => '/root/.alkivi-conf/screen/.screenrc',
    require => File['/root/.alkivi-conf'],
  }

  file { '/root/.gitconfig':
    ensure  => link,
    target  => '/root/.alkivi-conf/git/.gitconfig',
    require => File['/root/.alkivi-conf'],
  }

  file { '/root/.bash_aliases':
    ensure  => link,
    target  => '/root/.alkivi-conf/bash/.bash_aliases',
    require => File['/root/.alkivi-conf'],
  }

  # Some alternative
  alternatives { 'editor':
    path => '/usr/bin/vim.basic'
  }

  # Tzdata
  file { "/etc/localtime":
    ensure  => link,
    require => Package["tzdata"],
    source  => "file://${alkivi_base::localtime_file}",
  }

  exec { 'reconfigure_tzdata':
    command  => 'dpkg-reconfigure -f noninteractive tzdata && touch /etc/localtime.updated',
    provider => 'shell',
    creates  => '/etc/localtime.updated',
    path     => ['/bin', '/sbin', '/usr/bin', '/root/alkivi-scripts/', '/usr/sbin/'],
    require  => File['/etc/localtime'],
  }


  # Locales
  class { locales:
      default_value => "en_US.UTF-8",
      available     => ["en_US.UTF-8 UTF-8" ],
  }

  # Console data
  class { console_data: }

  # NTP ntp.ovh.net
  class { '::ntp':
      servers  => $alkivi_base::ntp_servers,
  }
}