You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
757 B

  1. ---
  2. # Running growpart seems to be only required on Azure, as other Cloud Providers do this at boot time
  3. - name: install growpart
  4. package:
  5. name: cloud-utils-growpart
  6. state: present
  7. - name: check if growpart needs to be run
  8. command: growpart -N /dev/sda 1
  9. failed_when: False
  10. changed_when: "'NOCHANGE:' not in growpart_needed.stdout"
  11. register: growpart_needed
  12. environment:
  13. LC_ALL: C
  14. - name: check fs type
  15. command: file -Ls /dev/sda1
  16. changed_when: False
  17. register: fs_type
  18. - name: run growpart # noqa 503
  19. command: growpart /dev/sda 1
  20. when: growpart_needed.changed
  21. environment:
  22. LC_ALL: C
  23. - name: run xfs_growfs # noqa 503
  24. command: xfs_growfs /dev/sda1
  25. when: growpart_needed.changed and 'XFS' in fs_type.stdout