Last active
May 25, 2019 13:38
-
-
Save sshnaidm/092ead17ea4b5204586ad3e16a2f3bc3 to your computer and use it in GitHub Desktop.
for medium
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: 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 |
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
[defaults] | |
strategy = mitogen_linear | |
strategy_plugins = /usr/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy |
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
export ANSIBLE_STRATEGY_PLUGINS=/usr/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy | |
export ANSIBLE_STRATEGY=mitogen_linear |
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
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' |
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
test1 |
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
pip install mitogen |
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: 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 }} |
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
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 |
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment