Skip to content

Fix only_if on backup_path

This fixes the following error...

================================================================================
    Error executing action `create` on resource 'directory[/var/opt/gitlab/backups]'
    ================================================================================

    ArgumentError
    -------------
    Invalid only_if/not_if command, expected a string: true (TrueClass)

    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb

     54: directory node['gitlab']['gitlab-rails']['backup_path'] do
     55:   owner gitlab_user
     56:   mode '0700'
     57:   recursive true
     58:   only_if node['gitlab']['gitlab-rails']['manage_backup_path']
     59: end
     60:

    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:54:in `from_file'

    directory("/var/opt/gitlab/backups") do
      action [:create]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      path "/var/opt/gitlab/backups"
      recursive true
      declared_type :directory
      cookbook_name "gitlab"
      recipe_name "gitlab-rails"
      owner "git"
      mode "0700"
      only_if "true"
    end

Merge request reports