Class: Inspec::Resources::Mysql
- Inherits:
-
Object
- Object
- Inspec::Resources::Mysql
- Defined in:
- lib/inspec/resources/mysql.rb
Instance Attribute Summary collapse
-
#conf_dir ⇒ Object
readonly
Returns the value of attribute conf_dir.
-
#conf_path ⇒ Object
readonly
Returns the value of attribute conf_path.
-
#data_dir ⇒ Object
readonly
Returns the value of attribute data_dir.
-
#log_dir ⇒ Object
readonly
Returns the value of attribute log_dir.
-
#log_dir_group ⇒ Object
readonly
Returns the value of attribute log_dir_group.
-
#log_group ⇒ Object
readonly
Returns the value of attribute log_group.
-
#log_path ⇒ Object
readonly
Returns the value of attribute log_path.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #init_arch ⇒ Object
- #init_default ⇒ Object
- #init_redhat ⇒ Object
- #init_ubuntu ⇒ Object
-
#initialize ⇒ Mysql
constructor
A new instance of Mysql.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Mysql
Returns a new instance of Mysql.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/inspec/resources/mysql.rb', line 10 def initialize # set OS-dependent filenames and paths case inspec.os[:family] when "debian" init_ubuntu when "redhat", "fedora" init_redhat when "arch" init_arch else # TODO: could not detect init_default end end |
Instance Attribute Details
#conf_dir ⇒ Object (readonly)
Returns the value of attribute conf_dir.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def conf_dir @conf_dir end |
#conf_path ⇒ Object (readonly)
Returns the value of attribute conf_path.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def conf_path @conf_path end |
#data_dir ⇒ Object (readonly)
Returns the value of attribute data_dir.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def data_dir @data_dir end |
#log_dir ⇒ Object (readonly)
Returns the value of attribute log_dir.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def log_dir @log_dir end |
#log_dir_group ⇒ Object (readonly)
Returns the value of attribute log_dir_group.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def log_dir_group @log_dir_group end |
#log_group ⇒ Object (readonly)
Returns the value of attribute log_group.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def log_group @log_group end |
#log_path ⇒ Object (readonly)
Returns the value of attribute log_path.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def log_path @log_path end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def package @package end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
9 10 11 |
# File 'lib/inspec/resources/mysql.rb', line 9 def service @service end |
Instance Method Details
#init_arch ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/inspec/resources/mysql.rb', line 54 def init_arch @package = "mariadb" @service = "mysql" @conf_path = "/etc/mysql/my.cnf" @conf_dir = "/etc/mysql/" @data_dir = "/var/lib/mysql/" @log_dir = "/var/log/" @log_path = "/var/log/mysql.log" @log_group = "mysql" @log_dir_group = "root" end |
#init_default ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/inspec/resources/mysql.rb', line 66 def init_default @service = "mysqld" @conf_path = "/etc/my.cnf" @conf_dir = "/etc/" @data_dir = "/var/lib/mysql/" @log_dir = "/var/log/" @log_path = "/var/log/mysqld.log" @log_group = "mysql" @log_dir_group = "root" end |
#init_redhat ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/inspec/resources/mysql.rb', line 42 def init_redhat @package = "mysql-server" @service = "mysqld" @conf_path = "/etc/my.cnf" @conf_dir = "/etc/" @data_dir = "/var/lib/mysql/" @log_dir = "/var/log/" @log_path = "/var/log/mysqld.log" @log_group = "mysql" @log_dir_group = "root" end |
#init_ubuntu ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/inspec/resources/mysql.rb', line 25 def init_ubuntu @package = "mysql-server" @service = "mysql" @conf_path = "/etc/mysql/my.cnf" @conf_dir = "/etc/mysql/" @data_dir = "/var/lib/mysql/" @log_dir = "/var/log/" @log_path = "/var/log/mysql.log" @log_group = "adm" case inspec.os[:release] when "14.04" @log_dir_group = "syslog" else @log_dir_group = "root" end end |
#to_s ⇒ Object
77 78 79 |
# File 'lib/inspec/resources/mysql.rb', line 77 def to_s "MySQL" end |