title: Ansible Error reading config file: File contains no section headers
body: <h3>SUMMARY</h3>
  <p><strong>As per documentation for <a href="https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-configuration-settings" rel="nofollow noreferrer">Ansible Configuration Settings</a>, we can place <code>ansible.cfg</code> in current directory of the project we are working on and Ansible will search for a config file in the order specified in link above.</strong></p>
  <p>However, it appears that ansible is unable to correctly parse <code>ansible.cfg</code> file within my project directory.  I am not sure but I think it has to be with the Ini ConfigParser</p>
  <h5>ANSIBLE VERSION</h5>
  <pre><code>  ansible 2.6.3
    config file = /Users/pnotes/Code/Terraform/Blog/ansible/ansible.cfg
    configured module search path = ['/Users/pnotes/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /Users/pnotes/.pyenv/versions/3.6.4/lib/python3.6/site-packages/ansible
    executable location = /Users/pnotes/.pyenv/versions/3.6.4/bin/ansible
    python version = 3.6.4 (default, Feb 26 2018, 21:07:35) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
  </code></pre>
  <h3>CONFIGURATION</h3>
  <p>output of &quot;ansible-config dump --only-changed&quot;</p>
  <pre><code>Error reading config file (/Users/pnotes/Code/Terraform/Blog/terraform/ansible.cfg): File contains no section headers.
  file: '/Users/pnotes/Code/Terraform/Blog/terraform/ansible.cfg', line: 3
  'vault_password_file = ~/.vault_pass.txt\n'
  </code></pre>
  <h3>OS / ENVIRONMENT</h3>
  <p>macOS High Sierra</p>
  <ul>
  <li><p>contents of <code>terraform/ansible.cfg</code>:</p>
  <pre><code>  # If set, configures the path to the Vault password file as an 
    # alternative to specifying --vault-password-file on the command
    # line.
    vault_password_file = ~/.vault_pass.txt
    n
  </code></pre>
  </li>
  </ul>
  <p><strong>Note</strong>: when <code>project_directory/terraform/ansible.cfg</code> is commented out, ansible uses <code>~/.ansible.cfg</code> and is able to decrypt encrypted files.</p>
  <h5>EXPECTED RESULTS</h5>
  <p>I expect playbook to decrypt all encrypted vars using the ansible vault password saved in the path provide in the configuration file (ansible.cfg) provided in the project directory.</p>
  <h5>ACTUAL RESULTS</h5>
  <p>I get the error below:</p>
  <pre><code>Error: Error applying plan:
  
  1 error(s) occurred:
  
  * linode_linode.base: Error running command 'sleep 30; ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u root --ask-pass -i '172.104.29.185,' ../ansible/provision.yml --extra-vars 'ip=000.111.22.185' -vvvv': exit status 5. Output: Error reading config file (/Users/pnotes/Code/Terraform/Test/terraform/ansible.cfg): File contains no section headers.
  file: '/Users/pnotes/Code/Terraform/Test/terraform/ansible.cfg', line: 3
  'vault_password_file = ~/.vault_pass.txt\n'
  </code></pre>
  <p>Can someone please explain why I keep getting the error **<code>exit status 5. Output: Error reading config file (/Users/pnotes/Code/Terraform/Test/terraform/ansible.cfg): File contains no section headers.</code></p>
  <ul>
  <li>I also tried looking for info on how ansible generates the default <code>/etc/ansible.cfg</code> file but can't seem to track it down (I use python in a limited capacity so this might be why I am having a hard time with this)</li>
  </ul>
  <p>Would really appreciate it.</p>