You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

  1. ---
  2. - name: Check ansible version
  3. import_playbook: ansible_version.yml
  4. - hosts: localhost
  5. strategy: linear
  6. vars:
  7. mitogen_version: 0.3.2
  8. mitogen_url: https://github.com/mitogen-hq/mitogen/archive/refs/tags/v{{ mitogen_version }}.tar.gz
  9. ansible_connection: local
  10. tasks:
  11. - name: Create mitogen plugin dir
  12. file:
  13. path: "{{ item }}"
  14. state: directory
  15. mode: 0755
  16. become: false
  17. loop:
  18. - "{{ playbook_dir }}/plugins/mitogen"
  19. - "{{ playbook_dir }}/dist"
  20. - name: download mitogen release
  21. get_url:
  22. url: "{{ mitogen_url }}"
  23. dest: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
  24. validate_certs: true
  25. - name: extract archive
  26. unarchive:
  27. src: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
  28. dest: "{{ playbook_dir }}/dist/"
  29. - name: copy plugin
  30. synchronize:
  31. src: "{{ playbook_dir }}/dist/mitogen-{{ mitogen_version }}/"
  32. dest: "{{ playbook_dir }}/plugins/mitogen"
  33. - name: add strategy to ansible.cfg
  34. ini_file:
  35. path: ansible.cfg
  36. mode: 0644
  37. section: "{{ item.section | d('defaults') }}"
  38. option: "{{ item.option }}"
  39. value: "{{ item.value }}"
  40. with_items:
  41. - option: strategy
  42. value: mitogen_linear
  43. - option: strategy_plugins
  44. value: plugins/mitogen/ansible_mitogen/plugins/strategy