Puppet Class: homeassistant::install

Inherits:
homeassistant
Defined in:
manifests/install.pp

Overview

Parameters:

  • home (Any) (defaults to: $homeassistant::home)
  • confdir (Any) (defaults to: $homeassistant::confdir)


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
# File 'manifests/install.pp', line 1

class homeassistant::install (
  $home    = $homeassistant::home,
  $confdir = $homeassistant::confdir,
) inherits homeassistant {
  group { 'homeassistant':
    ensure => present,
    system => true,
  }

  user { 'homeassistant':
    ensure => present,
    home   => $home,
    system => true,
    gid    => 'homeassistant',
  }

  file { $confdir:
    ensure => directory,
    owner  => 'homeassistant',
    group  => 'homeassistant',
  }
  file { "${confdir}/components":
    ensure  => directory,
    owner   => 'homeassistant',
    group   => 'homeassistant',
    purge   => true,
    recurse => true,
  }

  class { 'python':
    ensure     => present,
    version    => 'system',
    pip        => 'present',
    virtualenv => 'present',
    dev        => 'present',
  }

  python::pyvenv { $home:
    ensure => present,
    owner  => 'homeassistant',
    group  => 'homeassistant',
  }

  python::pip { 'homeassistant':
    ensure     => present,
    virtualenv => $home,
    owner      => 'homeassistant',
    group      => 'homeassistant',
  }
  systemd::unit_file { 'homeassistant.service':
    content => template("${module_name}/homeassistant.service.erb"),
  }
}