{"record":{"id":"3af35d527e1e8cae","repo":"hashicorp/vagrant","slug":"config-option-does-not-exist-on-the-system","errorCode":null,"errorMessage":"`%{config_option}` does not exist on the %{system}: %{path}","messagePattern":"`%(.+?)` does not exist on the %(.+?): %(.+?)","errorType":"exception","errorClass":"VagrantPlugins::Ansible::Errors.AnsibleError","httpStatus":null,"severity":"error","filePath":"plugins/provisioners/ansible/provisioner/host.rb","lineNumber":333,"sourceCode":"          # Re-enable ControlPersist Ansible defaults,\n          # which are lost when ANSIBLE_SSH_ARGS is defined.\n          unless ssh_options.empty?\n            ssh_options << \"-o ControlMaster=auto\"\n            ssh_options << \"-o ControlPersist=60s\"\n            # Intentionally keep ControlPath undefined to let ansible-playbook\n            # automatically sets this option to Ansible default value\n          end\n\n          ssh_options.join(' ')\n        end\n\n        def check_path(path, path_test_method, option_name)\n          # Checks for the existence of given file (or directory) on the host system,\n          # and error if it doesn't exist.\n\n          expanded_path = Pathname.new(path).expand_path(@machine.env.root_path)\n          if !expanded_path.public_send(path_test_method)\n            raise Ansible::Errors::AnsibleError,\n                  _key: :config_file_not_found,\n                  config_option: option_name,\n                  path: expanded_path,\n                  system: @control_machine\n          end\n        end\n\n        def check_path_is_a_file(path, option_name)\n          check_path(path, \"file?\", option_name)\n        end\n\n        def check_path_exists(path, option_name)\n          check_path(path, \"exist?\", option_name)\n        end\n\n      end\n    end\n  end","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/provisioners/ansible/provisioner/host.rb#L315-L351","documentation":"Before provisioning, host-mode ansible validates configured paths (playbook, inventory_path, config_file, galaxy files) by expanding them relative to the Vagrantfile's root_path and applying a File test (file?/exist?). A failing check raises the localized AnsibleError 'config_file_not_found' naming the option and resolved absolute path. It is a plain path-existence validation on the host filesystem.","triggerScenarios":"check_path_is_a_file / check_path_exists (called from check_files_existence before `vagrant provision` runs ansible on the host) with a path that doesn't resolve — typo'd filename, path written relative to the project root when it's elsewhere, or files generated later by another provisioner that haven't been created yet.","commonSituations":"Typo in `ansible.playbook = \"playbok.yml\"`; playbook living outside the project while given as a relative path; inventory file created by an earlier step that was skipped; case-sensitivity differences between macOS (dev) and Linux (CI) paths.","solutions":["Compare the resolved absolute path in the error with the real file location and fix the Vagrantfile option","Use paths relative to the Vagrantfile root (they are expanded with root_path), or absolute paths for outside files","If the file is generated, ensure the generating provisioner/shell step runs first","On case-sensitive filesystems, verify filename casing exactly"],"exampleFix":"# Vagrantfile — before\nansible.playbook = \"playbok.yml\"\n# after\nansible.playbook = \"playbook.yml\"","handlingStrategy":"validation","validationCode":"expanded = File.expand_path(relative_path, project_root)\nraise \"#{option_name} not found: #{expanded}\" unless File.public_send(file_test, expanded) # file? or exist?","typeGuard":"def host_path_valid?(path, root_path, must_be_file: true)\n  p = Pathname.new(path.to_s).expand_path(root_path)\n  must_be_file ? p.file? : p.exist?\nend","tryCatchPattern":null,"preventionTips":["Keep playbooks/inventories inside the project root and reference them relatively","In CI, check paths case-sensitively even if developing on macOS","If files are generated, order provisioners so the generator runs before ansible"],"tags":["ansible","provisioner","host","path-validation","file-not-found"],"backgroundTag":"config-file-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}