Module: ForemanMaintain::Concerns::Firewall::IptablesMaintenanceMode
- Defined in:
- lib/foreman_maintain/concerns/firewall/iptables_maintenance_mode.rb
Instance Method Summary collapse
- #disable_maintenance_mode ⇒ Object
- #enable_maintenance_mode ⇒ Object
- #maintenance_mode_status? ⇒ Boolean
- #status_for_maintenance_mode ⇒ Object
Instance Method Details
#disable_maintenance_mode ⇒ Object
5 6 7 |
# File 'lib/foreman_maintain/concerns/firewall/iptables_maintenance_mode.rb', line 5 def disable_maintenance_mode remove_chain(custom_chain_name) end |
#enable_maintenance_mode ⇒ Object
9 10 11 12 |
# File 'lib/foreman_maintain/concerns/firewall/iptables_maintenance_mode.rb', line 9 def enable_maintenance_mode add_chain(custom_chain_name, ['-i lo -j ACCEPT', '-p tcp --dport 443 -j REJECT']) end |
#maintenance_mode_status? ⇒ Boolean
14 15 16 |
# File 'lib/foreman_maintain/concerns/firewall/iptables_maintenance_mode.rb', line 14 def maintenance_mode_status? chain_exist?(custom_chain_name) end |
#status_for_maintenance_mode ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/foreman_maintain/concerns/firewall/iptables_maintenance_mode.rb', line 18 def status_for_maintenance_mode if maintenance_mode_status? ['Iptables chain: present', []] else ['Iptables chain: absent', []] end end |