Interview Prep/Ansible/Testing, CI/CD and Quality

When do you use `skip_list`, `warn_list` and `# noqa`?

IntermediateProductionTesting, CI/CD and Quality
Answer
  • skip_list: a rule the team has agreed does not apply to this repo at all. Rare, and documented in the PR that added it.
  • warn_list: a rule we intend to enforce but cannot yet; it reports without failing CI. Used during migrations.
  • # noqa: <rule>: a single justified exception on one task, with the reason next to it.
- name: Read current kernel version
  ansible.builtin.command: uname -r
  register: kernel
  changed_when: false

- name: Run vendor installer (no module exists)
  ansible.builtin.shell: ./install.sh --silent  # noqa: command-instead-of-shell  vendor script needs shell env
  args:
    chdir: /opt/vendor
    creates: /opt/vendor/.installed

Always name the rule in noqa. A bare # noqa hides future problems on that line too.

All Ansible questions Roadmap: Ansible

More on Testing, CI/CD and Quality