Cygwin - Wie zu installieren ansible?
Wie man /install ansible Verwendung von Cygwin?
Ich habe versucht, die folgenden Schritte, aber es hat nicht funktioniert, während der Gegner 5 (while running "python setup.py installieren"). Schritte entnommen aus: Entnommen aus https://servercheck.in/blog/running-ansible-within-windows
1) Downloaden und installieren Sie Cygwin, mit der mindestens die folgenden Pakete ausgewählt (Sie können wählen Sie die Pakete während der Installation):
libyaml
libyaml-devel
curl
python (2.7.x)
python-crypto
python-openssl
python-paramiko
python-setuptools
git (2.1.x)
vim
openssh
openssl
openssl-devel
2) Herunterladen und installieren PyYAML und Jinja2 ist, da Sie nicht über die Cygwin - installer:
1. Open Cygwin
2. Download PyYAML:
curl -O https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz
3. Download Jinja2:
curl -O https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz
4. Untar both downloads:
tar -xvf PyYAML-3.10.tar.gz && tar -xvf Jinja2-2.6.tar.gz
5. Change directory into each of the expanded folders and run python "python setup.py install" to install each package.
6. Clone ansible from its repository on GitHub:
git clone https://github.com/ansible/ansible /opt/ansible
This was tested with Ansible version v1.6.6, change directory into /opt/ansible and checkout the correct tag: git checkout v1.6.6.
7. Add the following lines into your Cygwin .bash_profile:
# Ansible settings
ANSIBLE=/opt/ansible
export PATH=$PATH:$ANSIBLE/bin
export PYTHONPATH=$ANSIBLE/lib
export ANSIBLE_LIBRARY=$ANSIBLE/library
8. At this point, you should be able to run ansible commands via Cygwin (once you restart, or enter source ~/.bash_profile to pick up the settings you just added).
Try ansible --version to display Ansible's version.
9. Passwordless ssh will need to be set up between your Windows machine and the deployment host(s)
To enable passwordless ssh on Centos - ssh-copy-id root@node
To enable passwordless ssh on SuSE I followed the steps in this blog:
http://www.firedaemon.com/blog/passwordless-root-ssh-public-key-authentication-on-centos-6
install sshpass v1.05 on your Windows machine<br>
Den Fehler, dass ich beim Kugel 5 ist:
$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib.cygwin-2.2.1-x86_64-2.7
creating build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/composer.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/constructor.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/cyaml.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/dumper.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/emitter.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/error.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/events.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/loader.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/nodes.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/parser.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/reader.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/representer.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/resolver.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/scanner.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/serializer.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/tokens.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
copying lib/yaml/__init__.py -> build/lib.cygwin-2.2.1-x86_64-2.7/yaml
running build_ext
creating build/temp.cygwin-2.2.1-x86_64-2.7
checking if libyaml is compilable
gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/build=/usr/src/debug/python-2.7.10-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/src/Python-2.7.10=/usr/src/debug/python-2.7.10-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/cygdrive/c/cygwin/include/python2.7 -c build/temp.cygwin-2.2.1-x86_64-2.7/check_libyaml.c -o build/temp.cygwin-2.2.1-x86_64-2.7/check_libyaml.o
checking if libyaml is linkable
gcc build/temp.cygwin-2.2.1-x86_64-2.7/check_libyaml.o -L/cygdrive/c/cygwin/lib/python2.7/config -L/usr/lib -lyaml -o build/temp.cygwin-2.2.1-x86_64-2.7/check_libyaml.exe
skipping 'ext/_yaml.c' Cython extension (up-to-date)
building '_yaml' extension
creating build/temp.cygwin-2.2.1-x86_64-2.7/ext
gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/build=/usr/src/debug/python-2.7.10-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/src/Python-2.7.10=/usr/src/debug/python-2.7.10-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/cygdrive/c/cygwin/include/python2.7 -c ext/_yaml.c -o build/temp.cygwin-2.2.1-x86_64-2.7/ext/_yaml.o
ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
.
$ ansible --version
Traceback (most recent call last):
File "/opt/ansible/bin/ansible", line 40, in <module>
from ansible.utils.display import Display
File "/opt/ansible/lib/ansible/utils/display.py", line 35, in <module>
from ansible import constants as C
File "/opt/ansible/lib/ansible/constants.py", line 30, in <module>
from ansible.parsing.splitter import unquote
File "/opt/ansible/lib/ansible/parsing/__init__.py", line 32, in <module>
from ansible.parsing.vault import VaultLib
File "/opt/ansible/lib/ansible/parsing/vault/__init__.py", line 82, in <module>
from cryptography.hazmat.primitives.hashes import SHA256 as c_SHA256
File "/cygdrive/c/cygwin/lib/python2.7/site-packages/cryptography/hazmat/primitives/hashes.py", line 15, in <module>
from cryptography.hazmat.backends.interfaces import HashBackend
File "/cygdrive/c/cygwin/lib/python2.7/site-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module>
import pkg_resources
File "/cygdrive/c/cygwin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 84, in <module>
packaging = pkg_resources._vendor.packaging
AttributeError: 'module' object has no attribute '_vendor'
InformationsquelleAutor Arun Sangal | 2015-09-15
Du musst angemeldet sein, um einen Kommentar abzugeben.
Viel einfacher:
Ergebnis
Ich habe apt-cyg erfolgreich installiert. git clone ist fehlgeschlagen. Ich hatte, um zu zwicken, Ihr Skript, um es arbeiten bis zu dem Punkt zu bekommen, ansible Ordner. Nun, ich bin immer andere Fehler.
Dank Steve. Ich habe noch Fehler mit der Lösung oben. Aktualisiert Ihre Antwort, aber never mind.
Zwei Möglichkeiten, die Vergangenheit dieser... 1) stellen Sie Ihre cygwin-ssh-key zu Github, um die Verwendung des SSH-Verbindungs-URL. Oder 2) Umschalten auf HTTPS für diesen download, der link ist dann: github.com/ansible/ansible.git
InformationsquelleAutor Steven Penny
Vorausgesetzt, Cygwin installiert ist:
alias cyg-get="/path/to/cygwin/setup/package/setup-x86_64.exe -q -P"
cyg-get cygwin32-gcc-g++,gcc-core,gcc-g++,git,libffi-devel,nano,openssl,openssl-devel,python-crypto,python3,python3-devel,python3-openssl,python3-pip,python3-setuptools,python3-devel,tree,wget,zip,make
pip
überpip3 install --upgrade pip
pip install ansible
Hinweise:
Den
cyg-get
alias ermöglicht Ihnen die Installation aller Pakete über die Kommandozeile statt der Suche in die Cygwin-UI.Den ansible installation umfasst einen Schritt, bei dem "Läuft setup.py bdist_wheel für pynacl" ausgeführt wird - das dauert mindestens eine halbe Stunde, aber schließlich abgeschlossen.
InformationsquelleAutor Bonnie
Obwohl Ansible kann Cygwin, beachten Sie, dass es offiziell nicht unterstützt und es klingt nicht wie es sein wird in der nahen Zukunft.
Stammt aus der Ansible Dokumentation
Einer alternative zu betrachten, läuft eine Linux virtuelle Maschine auf Ihrem Windows-host und verwenden Sie diese als Ihre Ansible-controller.
InformationsquelleAutor Steve E.
1. laden Sie cygwin
2. auf der "Select-Pakete" - Seite, wählen Sie "Kategorie" aus der Ansicht (Links oben)
3. mark "Devel", "Installieren" (ändern Sie die "Default" auf "Installieren"
4. Marke "Python", "Installieren"
5. aus "Web", wählen Sie "wget"
6. aus "Net" wählen Sie "Openssh"
7. Fortschritt um die Pakete zu installieren mit "Weiter"
8. gehen Sie zum Zielordner, wo Sie installiert cygwin
9. rechts klicken Sie auf "Cygwin.Fledermaus" und als Administrator ausführen
10. schreiben "easy_install-2.7 pip"
11. schreiben "pip2 installieren ansible"
Sie müssen auch nach Stellungswechsel alle Pakete lösen das problem der Verzweigung, für diese schreiben Sie dann:
Nach, die Sie verwenden können, ansible, ohne irgendein problem (ich hoffe, so haben Sie die gleiche situation wie ich, wie es ist, für mich zu arbeiten)
Es hat mich viele Tage auf der Suche und versuchen zu lösen, installieren ansible auf
Windows 10 Home Edtion
InformationsquelleAutor Arkan
Versuchen, diese apt-get remove python-Kryptographie, auch müssen Sie möglicherweise installieren paramiko-1.10.0.tar.gz manuell.
➤ ansible --version
ansible 2.1.0
InformationsquelleAutor Deepak Tom
Hatte ich ein problem mit "beheben symbolische links" - also ich coudn ' T installieren Sie es von "pip install /path/absible.tar.gz"
Aber ich entpackt Sie (unter root = administrator), um den Ordner und installiert den Ordner nicht archivieren.
Und - oh, es funktioniert - ansible wurde installiert cygwin.
InformationsquelleAutor Antispam Antispam
Dieser arbeitete für mich:
~$ cat setup_ansible_cygwin.sh
InformationsquelleAutor tejot7
Schritte für Ansible 2.7.6 und Python ist3 und Cygwin 2.11.2(0.329/5/3)
Hinweis: wenn kein cygwin ssh verwendet wird (wie oben beschrieben) ändern env PATH-variable für cygwin oder ändern Ansible Inventar hosts-Datei posten mit Flagge
ansible_ssh_executable=/usr/bin/ssh
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography->ansible) Building wheels for collected packages: cryptography, pynacl, bcrypt Building wheel for cryptography (PEP 517) ... done Stored in directory: /home/r.cardenas.isla/.cache/pip/wheels/43/61/c8/0a4464601ce180d26e0a8dfdfa88c824e419dcc65bd43bda6e Building wheel for pynacl (PEP 517) ...
InformationsquelleAutor bedla.czech