Class: Inspec::Resources::Mysql
- Inherits:
-
Object
- Object
- Inspec::Resources::Mysql
- Defined in:
- lib/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.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/resources/mysql.rb', line 12 def initialize # set OS-dependent filenames and paths case inspec.os[:family] when 'ubuntu', '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.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def conf_dir @conf_dir end |
#conf_path ⇒ Object (readonly)
Returns the value of attribute conf_path.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def conf_path @conf_path end |
#data_dir ⇒ Object (readonly)
Returns the value of attribute data_dir.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def data_dir @data_dir end |
#log_dir ⇒ Object (readonly)
Returns the value of attribute log_dir.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def log_dir @log_dir end |
#log_dir_group ⇒ Object (readonly)
Returns the value of attribute log_dir_group.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def log_dir_group @log_dir_group end |
#log_group ⇒ Object (readonly)
Returns the value of attribute log_group.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def log_group @log_group end |
#log_path ⇒ Object (readonly)
Returns the value of attribute log_path.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def log_path @log_path end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def package @package end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
11 12 13 |
# File 'lib/resources/mysql.rb', line 11 def service @service end |
Instance Method Details
#init_arch ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/resources/mysql.rb', line 56 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
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/resources/mysql.rb', line 68 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
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/resources/mysql.rb', line 44 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
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/resources/mysql.rb', line 27 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 os[:release] when '14.04' @log_dir_group = 'syslog' else @log_dir_group = 'root' end end |
#to_s ⇒ Object
79 80 81 |
# File 'lib/resources/mysql.rb', line 79 def to_s 'MySQL' end |