2019-04-01 09:38:33 +00:00
|
|
|
---
|
2020-04-22 20:33:44 +00:00
|
|
|
- name: Check ansible version
|
|
|
|
import_playbook: ansible_version.yml
|
|
|
|
|
2018-10-31 10:52:47 +00:00
|
|
|
- hosts: localhost
|
|
|
|
strategy: linear
|
|
|
|
vars:
|
2022-01-27 16:36:59 +00:00
|
|
|
mitogen_version: 0.3.2
|
|
|
|
mitogen_url: https://github.com/mitogen-hq/mitogen/archive/refs/tags/v{{ mitogen_version }}.tar.gz
|
2020-04-22 20:33:44 +00:00
|
|
|
ansible_connection: local
|
2018-10-31 10:52:47 +00:00
|
|
|
tasks:
|
|
|
|
- name: Create mitogen plugin dir
|
|
|
|
file:
|
2019-05-02 21:24:21 +00:00
|
|
|
path: "{{ item }}"
|
2018-10-31 10:52:47 +00:00
|
|
|
state: directory
|
2021-07-12 07:00:47 +00:00
|
|
|
mode: 0755
|
2018-10-31 10:52:47 +00:00
|
|
|
become: false
|
|
|
|
loop:
|
2019-05-02 21:24:21 +00:00
|
|
|
- "{{ playbook_dir }}/plugins/mitogen"
|
|
|
|
- "{{ playbook_dir }}/dist"
|
2018-10-31 10:52:47 +00:00
|
|
|
|
|
|
|
- name: download mitogen release
|
|
|
|
get_url:
|
2019-05-02 21:24:21 +00:00
|
|
|
url: "{{ mitogen_url }}"
|
2020-04-24 12:20:07 +00:00
|
|
|
dest: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
|
2018-10-31 10:52:47 +00:00
|
|
|
validate_certs: true
|
|
|
|
|
2020-04-24 12:20:07 +00:00
|
|
|
- name: extract archive
|
2018-10-31 10:52:47 +00:00
|
|
|
unarchive:
|
2020-04-24 12:20:07 +00:00
|
|
|
src: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
|
2019-05-02 21:24:21 +00:00
|
|
|
dest: "{{ playbook_dir }}/dist/"
|
2018-10-31 10:52:47 +00:00
|
|
|
|
|
|
|
- name: copy plugin
|
|
|
|
synchronize:
|
2019-05-02 21:24:21 +00:00
|
|
|
src: "{{ playbook_dir }}/dist/mitogen-{{ mitogen_version }}/"
|
|
|
|
dest: "{{ playbook_dir }}/plugins/mitogen"
|
2020-04-24 12:20:07 +00:00
|
|
|
|
|
|
|
- name: add strategy to ansible.cfg
|
|
|
|
ini_file:
|
|
|
|
path: ansible.cfg
|
2021-07-12 07:00:47 +00:00
|
|
|
mode: 0644
|
2022-01-27 16:36:59 +00:00
|
|
|
section: "{{ item.section | d('defaults') }}"
|
|
|
|
option: "{{ item.section }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
with_items:
|
|
|
|
- option: strategy
|
|
|
|
value: mitogen_linear
|
|
|
|
- option: strategy_plugins
|
|
|
|
value: plugins/mitogen/ansible_mitogen/plugins/strategy
|