Class: OsCtl::ExportFS::Operations::Server::Configure
- Includes:
- Lib::Utils::Log, Lib::Utils::System
- Defined in:
- lib/osctl/exportfs/operations/server/configure.rb
Overview
Change the server configuration
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
protected
Returns the value of attribute opts.
-
#server ⇒ Object
readonly
protected
Returns the value of attribute server.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(server, opts) ⇒ Configure
constructor
A new instance of Configure.
Methods inherited from Base
Constructor Details
#initialize(server, opts) ⇒ Configure
Returns a new instance of Configure.
19 20 21 22 23 |
# File 'lib/osctl/exportfs/operations/server/configure.rb', line 19 def initialize(server, opts) super() @server = server @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly, protected)
Returns the value of attribute opts.
45 46 47 |
# File 'lib/osctl/exportfs/operations/server/configure.rb', line 45 def opts @opts end |
#server ⇒ Object (readonly, protected)
Returns the value of attribute server.
45 46 47 |
# File 'lib/osctl/exportfs/operations/server/configure.rb', line 45 def server @server end |
Instance Method Details
#execute ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/osctl/exportfs/operations/server/configure.rb', line 25 def execute server.synchronize do cfg = server.open_config %i[address netif mountd_port lockd_port statd_port].each do |v| cfg.send(:"#{v}=", opts[v]) unless opts[v].nil? end if opts[:nfsd] %i[port nproc tcp udp versions syslog].each do |v| cfg.nfsd.send(:"#{v}=", opts[:nfsd][v]) unless opts[:nfsd][v].nil? end end cfg.save end end |