clean_image.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. - name: Reboot instance
  3. hosts: localhost
  4. connection: local
  5. gather_facts: no
  6. tasks:
  7. # After installing certain packages rebooting the instance is a must before all
  8. # changes (e.g. new Selinux rules) get properly applied and propagated.
  9. # Must be done before the cloud-init is cleaned.
  10. # Otherwise, the cloud-init will be run again.
  11. - name: Reboot instance
  12. import_role:
  13. name: openshift_aws
  14. tasks_from: reboot_instance.yml
  15. when: openshift_node_reboot_instance_before_cleanup | default(false)
  16. - name: Configure nodes
  17. hosts: oo_nodes_to_config
  18. tasks:
  19. - name: Set gquota for slash filesystem
  20. import_role:
  21. name: openshift_aws
  22. tasks_from: set_gquota_for_slashfs.yml
  23. when: openshift_aws_ami_build_set_gquota_on_slashfs | default(false)
  24. - name: Remove any ansible facts created during AMI creation
  25. file:
  26. path: "/etc/ansible/facts.d/{{ item }}"
  27. state: absent
  28. with_items:
  29. - openshift.fact
  30. - name: Clean cloud-init path
  31. file:
  32. state: absent
  33. path: "/var/lib/cloud/"