2019-04-01 17:38:33 +08:00
|
|
|
---
|
2020-04-23 04:33:44 +08:00
|
|
|
- name: Check ansible version
|
2023-06-26 18:15:45 +08:00
|
|
|
import_playbook: kubernetes_sigs.kubespray.ansible_version
|
2020-04-23 04:33:44 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Install mitogen
|
|
|
|
hosts: localhost
|
2018-10-31 18:52:47 +08:00
|
|
|
strategy: linear
|
|
|
|
vars:
|
2022-01-28 00:36:59 +08:00
|
|
|
mitogen_version: 0.3.2
|
|
|
|
mitogen_url: https://github.com/mitogen-hq/mitogen/archive/refs/tags/v{{ mitogen_version }}.tar.gz
|
2020-04-23 04:33:44 +08:00
|
|
|
ansible_connection: local
|
2018-10-31 18:52:47 +08:00
|
|
|
tasks:
|
|
|
|
- name: Create mitogen plugin dir
|
|
|
|
file:
|
2019-05-03 05:24:21 +08:00
|
|
|
path: "{{ item }}"
|
2018-10-31 18:52:47 +08:00
|
|
|
state: directory
|
2021-07-12 15:00:47 +08:00
|
|
|
mode: 0755
|
2018-10-31 18:52:47 +08:00
|
|
|
become: false
|
|
|
|
loop:
|
2019-05-03 05:24:21 +08:00
|
|
|
- "{{ playbook_dir }}/plugins/mitogen"
|
|
|
|
- "{{ playbook_dir }}/dist"
|
2018-10-31 18:52:47 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Download mitogen release
|
2018-10-31 18:52:47 +08:00
|
|
|
get_url:
|
2019-05-03 05:24:21 +08:00
|
|
|
url: "{{ mitogen_url }}"
|
2020-04-24 20:20:07 +08:00
|
|
|
dest: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
|
2018-10-31 18:52:47 +08:00
|
|
|
validate_certs: true
|
2023-06-26 18:15:45 +08:00
|
|
|
mode: 0644
|
2018-10-31 18:52:47 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Extract archive
|
2018-10-31 18:52:47 +08:00
|
|
|
unarchive:
|
2020-04-24 20:20:07 +08:00
|
|
|
src: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
|
2019-05-03 05:24:21 +08:00
|
|
|
dest: "{{ playbook_dir }}/dist/"
|
2018-10-31 18:52:47 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Copy plugin
|
2023-06-26 18:15:45 +08:00
|
|
|
ansible.posix.synchronize:
|
2019-05-03 05:24:21 +08:00
|
|
|
src: "{{ playbook_dir }}/dist/mitogen-{{ mitogen_version }}/"
|
|
|
|
dest: "{{ playbook_dir }}/plugins/mitogen"
|
2020-04-24 20:20:07 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Add strategy to ansible.cfg
|
2023-06-26 18:15:45 +08:00
|
|
|
community.general.ini_file:
|
2020-04-24 20:20:07 +08:00
|
|
|
path: ansible.cfg
|
2021-07-12 15:00:47 +08:00
|
|
|
mode: 0644
|
2022-01-28 00:36:59 +08:00
|
|
|
section: "{{ item.section | d('defaults') }}"
|
2022-02-07 17:39:43 +08:00
|
|
|
option: "{{ item.option }}"
|
2022-01-28 00:36:59 +08:00
|
|
|
value: "{{ item.value }}"
|
|
|
|
with_items:
|
|
|
|
- option: strategy
|
|
|
|
value: mitogen_linear
|
|
|
|
- option: strategy_plugins
|
|
|
|
value: plugins/mitogen/ansible_mitogen/plugins/strategy
|