-
Notifications
You must be signed in to change notification settings - Fork 19
Fasten Ansible build progress #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fasten Ansible build progress #118
Conversation
Encounter failures during manual verification. (Ubuntu 24.04, x64, Python 3.11, Ansible 2.15)
|
|
||
- name: orchestrate {{ node.name }} - {{ node.group }} - mkdir | ||
- name: orchestrate {{ node.name }} - remove all j2 templates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the idea of copying j2 templates to the destination first and deleting them eventually, why is it faster than in-place rendering?
path: "{{ node.name }}/{{ item.path }}" | ||
state: directory | ||
with_community.general.filetree: "templates/hadoop-common" | ||
when: item.state == "directory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is definitely the most costly step, in my experiment, it costs 15.94s, so collecting and dedup the dirs first and only creating the unique dirs should be a good idea
Fasten Ansible build using ansible.builtin.shell instead of ansible.builtin.file in node-template.yml, and add .j2 prefix of all template file.
With test, the time cost of
ansible-playbook build.yaml
reduce from about 59s to about 22s