Ansible: installieren mehrerer Python-Pakete auf einer einzigen Sitzung

Einer meiner playbooks enthält eine Aufgabe, die installiert basic-Python-Pakete:

---
  -
    name: "Install Python packages: {{ python_packages_to_install }}"
    sudo: true
    pip: name={{ item }}
    with_items: python_packages_to_install

Mit der folgenden Liste der Pakete:

-
  include: python_basics.yaml
  vars:
     python_packages_to_install:
       - virtualenv
       - pss
       - requests
       - comment-builder
       - boto
       - ansible
       - uwsgitop
       - gitpull
       - ipython

Die Aufgabe korrekt funktioniert und installiert die Pakete:

TASK: [common | Install Python packages: ['virtualenv', 'pss', 'requests', 'comment-builder', 'boto', 'ansible', 'uwsgitop', 'gitpull', 'ipython']] ***
ok: [push-prod-01] => (item=virtualenv)
ok: [push-prod-01] => (item=pss)
ok: [push-prod-01] => (item=requests)
ok: [push-prod-01] => (item=comment-builder)
ok: [push-prod-01] => (item=boto)
ok: [push-prod-01] => (item=ansible)
ok: [push-prod-01] => (item=uwsgitop)
ok: [push-prod-01] => (item=gitpull)
changed: [push-prod-01] => (item=ipython)

Das problem ist, dass jede Zeile ausgeführt wird, mit einer aufeinander folgenden SSH-Befehl, anstelle der Installation alle Pakete in einem einzigen Aufruf.

Gibt es eine Möglichkeit zum installieren mehrerer Python-Paketen auf einem Ansible pip Befehl?

InformationsquelleAutor Adam Matan | 2015-07-14
Schreibe einen Kommentar