<p>According to <a href="https://yamllint.readthedocs.io/en/stable/disable_with_comments.html#disabling-checks-for-a-specific-line" rel="nofollow noreferrer">the yamllint documentation</a> you need to add a special comment to the line -- <code>&lt;string-to-be-excluded&gt;  # yamllint disable-line rule:line-length</code></p>

<pre><code>---
#defaults/main
firefox_checksum: sha512:49d776cfb5f42c6e5ea1a55a80d9f6bad223080b16baa0d39de63534c25e68340091b4e16be5355d565f81291cb94fb996f03ae7e3e4c7a28021b0a0929daf58 #yamllint disable-line rule:line-length
</code></pre>

CC BY-SA 4.0
2018-11-12T11:44:11.120Z
Note that there should be two spaces after the the string to be excluded and that a space should reside in front of the yamllint in order to exclude yaml lint length testing for a certain line number (see [this](https://github.com/030/ansible-firefox/blob/a6ce5325a790293b895606c203afe254ab2b4d6f/defaults/main.yml#L2))
030
CC BY-SA 4.0
2018-11-11T14:42:32.477Z
2018-11-16T16:51:26.693Z
2018-11-16T16:51:26.693Z
Bruce Becker
<p>The aim is to exclude a certain line that contains a checksum and cannot be smaller than 80 characters.</p>

<pre><code>--&gt; Scenario: 'default'
--&gt; Action: 'lint'
--&gt; Executing Yamllint on files found in /tmp/ansible-firefox/...
    /tmp/ansible-firefox/defaults/main.yml
      2:81      error    line too long (153 &gt; 80 characters)  (line-length)
</code></pre>

<p>defaults/main.yml</p>

<pre><code>firefox_checksum: sha512:49d776cfb5f42c6e5ea1a55a80d9f6bad223080b16baa0d39de63534c25e68340091b4e16be5355d565f81291cb94fb996f03ae7e3e4c7a28021b0a0929daf58
</code></pre>

<ansible><yaml><molecule><linting>
How to exclude a certain linenumber of an Ansible playbook when testing it using Molecule?
030
# How to exclude a certain linenumber of an Ansible playbook when testing it using Molecule?

(Asked by: username_0 on 2018-11-09)

The aim is to exclude a certain line that contains a checksum and cannot be smaller than 80 characters.
--> Scenario: 'default'
--> Action: 'lint'
--> Executing Yamllint on files found in /tmp/ansible-firefox/...
    /tmp/ansible-firefox/defaults/main.yml
      2:81      error    line too long (153 > 80 characters)  (line-length)

defaults/main.yml
firefox_checksum: sha512:49d776cfb5f42c6e5ea1a55a80d9f6bad223080b16baa0d39de63534c25e68340091b4e16be5355d565f81291cb94fb996f03ae7e3e4c7a28021b0a0929daf58

**Tags:** ansible, yaml, molecule, linting


---

## 1 answers

### Answer by username_1 on 2018-11-11. Score: 3 | Accepted answer

According to the yamllint documentation you need to add a special comment to the line --   # yamllint disable-line rule:line-length
---
#defaults/main
firefox_checksum: sha512:49d776cfb5f42c6e5ea1a55a80d9f6bad223080b16baa0d39de63534c25e68340091b4e16be5355d565f81291cb94fb996f03ae7e3e4c7a28021b0a0929daf58 #yamllint disable-line rule:line-length

> **Comments:**
> **username_0**: Note that there should be two spaces after the the string to be excluded and that a space should reside in front of the yamllint in order to exclude yaml lint length testing for a certain line number (see [this](https://github.com/username_0/ansible-firefox/blob/a6ce5325a790293b895606c203afe254ab2b4d6f/defaults/main.yml#L2))  

---

