Created
July 25, 2015 16:49
-
-
Save cchurch/305a2eafad8f78116755 to your computer and use it in GitHub Desktop.
Proof of concept to run Python ping module on Windows with Ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: windows | |
gather_facts: false | |
vars: | |
ansible_python_interpreter: python | |
tasks: | |
- win_chocolatey: | |
name: python2 | |
state: present | |
- raw: python --version | |
- raw: python -m easy_install --version | |
register: check_easy_install | |
ignore_errors: true | |
- raw: (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python - | |
when: check_easy_install|failed | |
- raw: python -m pip --version | |
register: check_pip | |
ignore_errors: true | |
- raw: python -m easy_install pip | |
when: check_pip|failed | |
- raw: python -c "import ansible_windows_compat" | |
register: check_ansible_windows_compat | |
ignore_errors: true | |
- raw: python -m pip install https://github.com/cchurch/ansible-windows-compat/archive/master.zip | |
when: check_ansible_windows_compat|failed | |
- action: ping.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment