Puppet Class: homeassistant::config

Inherits:
homeassistant
Defined in:
manifests/config.pp

Overview

Parameters:

  • location_name (Any) (defaults to: $homeassistant::location_name)
  • latitute (Any) (defaults to: $homeassistant::latitude)
  • longitude (Any) (defaults to: $homeassistant::longitude)
  • unit_system (Any) (defaults to: $homeassistant::unit_system)
  • time_zone (Any) (defaults to: $homeassistant::time_zone)
  • confdir (Any) (defaults to: $homeassistant::confdir)
  • known_devices (Any) (defaults to: $homeassistant::known_devices)
  • known_devices_replace (Any) (defaults to: $homeassistant::known_devices_replace)


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

class homeassistant::config (
  $location_name = $homeassistant::location_name,
  $latitute      = $homeassistant::latitude,
  $longitude     = $homeassistant::longitude,
  $unit_system   = $homeassistant::unit_system,
  $time_zone     = $homeassistant::time_zone,
  $confdir       = $homeassistant::confdir,
  $known_devices = $homeassistant::known_devices,
  $known_devices_replace = $homeassistant::known_devices_replace,
) inherits homeassistant {
  concat { 'configuration.yaml':
    path   => "${confdir}/configuration.yaml",
    owner  => 'homeassistant',
    group  => 'homeassistant',
    notify => Service['homeassistant'],
  }
  concat::fragment { 'homeassistant':
    target  => 'configuration.yaml',
    order   => '00',
    content => template('homeassistant/homeassistant.yaml.erb'),
  }

  concat { 'known_devices.yaml':
    path    => "${confdir}/known_devices.yaml",
    owner   => homeassistant,
    group   => homeassistant,
    replace => $known_devices_replace,
    mode    => '0640',
    notify  => Service['homeassistant'],
  }

  if $known_devices {
    create_resources('homeassistant::known_device',$known_devices)
  }
}