ansible.rb 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. module Docs
  2. class Ansible < UrlScraper
  3. self.name = 'Ansible'
  4. self.type = 'sphinx'
  5. self.links = {
  6. home: 'https://www.ansible.com/',
  7. code: 'https://github.com/ansible/ansible'
  8. }
  9. html_filters.push 'ansible/entries', 'sphinx/clean_html', 'ansible/clean_html'
  10. options[:attribution] = <<-HTML
  11. &copy; 2012&ndash;2018 Michael DeHaan<br>
  12. &copy; 2018&ndash;2025 Red Hat, Inc.<br>
  13. Licensed under the GNU General Public License version 3.
  14. HTML
  15. options[:skip] = %w(
  16. installation_guide/index.html
  17. reference_appendices/glossary.html
  18. reference_appendices/faq.html
  19. reference_appendices/tower.html
  20. user_guide/quickstart.html
  21. modules/modules_by_category.html
  22. modules/list_of_all_modules.html
  23. collections/all_plugins.html
  24. collections/index_vars.html)
  25. options[:skip_patterns] = [
  26. /\Acommunity.*/i,
  27. /\Adev_guide.*/i,
  28. /\Aroadmap.*/i,
  29. ]
  30. version do
  31. # 2025-08-14
  32. self.base_url = "https://docs.ansible.com/ansible/latest/"
  33. end
  34. version '2.11' do
  35. self.release = '2.11.0'
  36. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  37. end
  38. version '2.10' do
  39. self.release = '2.10.5'
  40. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  41. end
  42. version '2.9' do
  43. self.release = '2.9.15'
  44. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  45. end
  46. version '2.8' do
  47. self.release = '2.8.16'
  48. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  49. end
  50. version '2.7' do
  51. self.release = '2.7.17'
  52. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  53. end
  54. version '2.6' do
  55. self.release = '2.6.20'
  56. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  57. end
  58. version '2.5' do
  59. self.release = '2.5.15'
  60. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  61. end
  62. version '2.4' do
  63. self.release = '2.4.6'
  64. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  65. options[:skip] = %w(
  66. glossary.html
  67. faq.html
  68. community.html
  69. tower.html
  70. quickstart.html
  71. list_of_all_modules.html)
  72. options[:skip_patterns] = []
  73. end
  74. def get_latest_version(opts)
  75. tags = get_github_tags('ansible', 'ansible', opts)
  76. tags[0]['name'][1..-1]
  77. end
  78. end
  79. end