Skip to content

Commit

Permalink
Add fstrim command to reduce AMI size during deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Szpadel committed May 24, 2024
1 parent dc64a0f commit faebc56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ aws_ami_force_clean_build: no
# Whether to terminate the builder instance after AMI is created
aws_ami_build_terminate_builder: yes

mageops_fstrim_enable: yes

# -------------------------------
# -------- AWS Network --------
# -------------------------------
Expand Down
6 changes: 6 additions & 0 deletions site.step-45-app-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
build_nr: "{{ mageops_artifact_build_nr | default(none) }}"
delegate_to: localhost

# This speeds up ami creation and starting new instance with asg
# This should be last step in on builder node
- name: Run fstrim to reduce ami size)
command: fstrim -av
when: mageops_fstrim_enable

vars:
deploy_install_new_release: "{{ not deploy_keep_current_release }}"
deploy_keep_current_releases: 2
Expand Down

0 comments on commit faebc56

Please sign in to comment.