class Confer::Configurators::Tzdata
Public: Configures the timezone on the remote host.
Attributes
timezone - The desired time zone in the format expected by the file
`/etc/timezone` on a Linux machine. E.g. London, UK would be `Europe/London`.
Attributes
timezone[RW]
Public: The desired time zone.
Public Instance Methods
apply(connection)
click to toggle source
See ‘Confer::Configurator#apply`
# File lib/confer/configurators/tzdata.rb, line 41 def apply(connection) # sh "echo '#{params[:timezone]}' > /etc/timezone" # sh "dpkg-reconfigure -f noninteractive tzdata" end
query(connection)
click to toggle source
See ‘Confer::Configurator#query`
# File lib/confer/configurators/tzdata.rb, line 25 def query(connection) connection.exec! 'cat /etc/timezone' end
verify(connection)
click to toggle source
See ‘Confer::Configurator#verify`
# File lib/confer/configurators/tzdata.rb, line 32 def verify(connection) expected = query.strip return true if expected == timezone Diffy::Diff.new(expected, timezone).to_s(:color) end