Skip to content

Instantly share code, notes, and snippets.

@sshnaidm
Last active May 25, 2019 13:38
Show Gist options
  • Save sshnaidm/092ead17ea4b5204586ad3e16a2f3bc3 to your computer and use it in GitHub Desktop.
Save sshnaidm/092ead17ea4b5204586ad3e16a2f3bc3 to your computer and use it in GitHub Desktop.
for medium
- hosts: all
gather_facts: false
tasks:
- name: Install packages
become: true
package:
name:
- samba
- httpd
- nano
- ruby
state: present
- name: Install pip modules
become: true
pip:
name:
- pytest-split-tests
- bottle
- pep8
- flask
state: present
[defaults]
strategy = mitogen_linear
strategy_plugins = /usr/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy
export ANSIBLE_STRATEGY_PLUGINS=/usr/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy
export ANSIBLE_STRATEGY=mitogen_linear
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
alias pure-ansible-playbook='$(pwd)/pure_ansible/bin/ansible-playbook'
alias mitogen-ansible-playbook='ANSIBLE_STRATEGY_PLUGINS=/usr/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy:$(pwd)/mitogen_ansible/lib/python3.7/site-packages/ansible_mitogen/plugins/strategy ANSIBLE_STRATEGY=mitogen_linear $(pwd)/mitogen_ansible/bin/ansible-playbook'
pip install mitogen
- hosts: all
gather_facts: false
tasks:
- name: Create files with copy content module
copy:
content: |
test file {{ item }}
dest: ~/file_{{item}}
with_sequence: start=1 end={{ n }}
time mitogen-ansible-playbook file_creation.yml -i hosts -e n=10 &>/dev/null
real 0m2.603s
user 0m1.152s
sys 0m0.096s
time pure-ansible-playbook file_creation.yml -i hosts -e n=10 &>/dev/null
real 0m5.908s
user 0m1.745s
sys 0m0.643s
time pure-ansible-playbook file_creation.yml -i hosts -e n=100 &>/dev/null
real 0m51.775s
user 0m8.039s
sys 0m6.305s
time mitogen-ansible-playbook file_creation.yml -i hosts -e n=100 &>/dev/null
real 0m4.331s
user 0m1.903s
sys 0m0.197s
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment