Last active
September 16, 2022 14:22
-
-
Save cdot65/cc7058a8a2e0585aa7bd5c1d7d550b6a to your computer and use it in GitHub Desktop.
Ansible playbook to print installed Python packages
This file contains 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
--- | |
#------------------------------------------------------------------------ | |
# Print out installed packages within virtual environment | |
#------------------------------------------------------------------------ | |
- hosts: localhost | |
connection: local | |
tasks: | |
- name: create list of Python packages installed | |
ansible.builtin.shell: pip freeze | |
register: results | |
- name: Print Installed Python Packages | |
debug: | |
msg: "{{ results }}" | |
- name: create output of Ansible configuration | |
ansible.builtin.shell: ansible --version | |
register: results | |
- name: Print Ansible configuration | |
debug: | |
msg: "{{ results }}" | |
- name: create output of Ansible Galaxy configuration | |
ansible.builtin.shell: ansible-galaxy --version | |
register: results | |
- name: Print Galaxy configuration | |
debug: | |
msg: "{{ results }}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment