/test/integration/roles/test_apt_repository/tasks/cleanup.yml

https://github.com/ajanthanm/ansible · YAML · 18 lines · 12 code · 4 blank · 2 comment · 0 complexity · 60e40d37369f0ec1964887cff5028c86 MD5 · raw file

  1. ---
  2. # tasks to cleanup a repo and assert it is gone
  3. - name: remove existing ppa
  4. apt_repository: repo={{test_ppa_name}} state=absent
  5. ignore_errors: true
  6. - name: test that ppa does not exist (expect pass)
  7. shell: cat /etc/apt/sources.list /etc/apt/sources.list.d/* | grep "{{test_ppa_spec}}"
  8. register: command
  9. failed_when: command.rc == 0
  10. changed_when: false
  11. # Should this use apt-key, maybe?
  12. - name: remove ppa key
  13. apt_key: id={{test_ppa_key}} state=absent
  14. ignore_errors: true