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.
| 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # File 'lib/resources/mysql.rb', line 11 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.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def conf_dir @conf_dir end | 
#conf_path ⇒ Object (readonly)
Returns the value of attribute conf_path.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def conf_path @conf_path end | 
#data_dir ⇒ Object (readonly)
Returns the value of attribute data_dir.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def data_dir @data_dir end | 
#log_dir ⇒ Object (readonly)
Returns the value of attribute log_dir.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def log_dir @log_dir end | 
#log_dir_group ⇒ Object (readonly)
Returns the value of attribute log_dir_group.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def log_dir_group @log_dir_group end | 
#log_group ⇒ Object (readonly)
Returns the value of attribute log_group.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def log_group @log_group end | 
#log_path ⇒ Object (readonly)
Returns the value of attribute log_path.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def log_path @log_path end | 
#package ⇒ Object (readonly)
Returns the value of attribute package.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def package @package end | 
#service ⇒ Object (readonly)
Returns the value of attribute service.
| 10 11 12 | # File 'lib/resources/mysql.rb', line 10 def service @service end | 
Instance Method Details
#init_arch ⇒ Object
| 55 56 57 58 59 60 61 62 63 64 65 | # File 'lib/resources/mysql.rb', line 55 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
| 67 68 69 70 71 72 73 74 75 76 | # File 'lib/resources/mysql.rb', line 67 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
| 43 44 45 46 47 48 49 50 51 52 53 | # File 'lib/resources/mysql.rb', line 43 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
| 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # File 'lib/resources/mysql.rb', line 26 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
| 78 79 80 | # File 'lib/resources/mysql.rb', line 78 def to_s 'MySQL' end |