build_base_image.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. - hosts: localhost
  3. gather_facts: no
  4. tasks:
  5. - name: provision resource group
  6. import_tasks: tasks/provision_instance.yml
  7. - hosts: nodes
  8. tasks:
  9. - name: calculate yum repositories
  10. set_fact:
  11. openshift_additional_repos: "{{ azure_base_repos[ansible_distribution] }}"
  12. - name: configure yum repositories
  13. import_tasks: tasks/yum_certs.yml
  14. - name: update rpms
  15. import_role:
  16. name: os_update_latest
  17. vars:
  18. os_update_latest_reboot: True
  19. - name: deconfigure yum repositories
  20. import_tasks: tasks/remove_yum.yml
  21. - name: run waagent deprovision
  22. command: waagent -deprovision+user -force
  23. args:
  24. chdir: /
  25. - hosts: localhost
  26. gather_facts: no
  27. tasks:
  28. - name: create image
  29. import_tasks: tasks/create_image_from_vm.yml
  30. vars:
  31. image_resource_group: "{{ openshift_azure_output_image_ns }}"
  32. image_name: "{{ openshift_azure_output_image_name }}"
  33. image_tags:
  34. root_image: "{{ openshift_azure_input_image_name }}"
  35. kernel: "{{ hostvars[groups['nodes'][0]]['ansible_kernel'] }}"
  36. valid: true
  37. - name: create blob
  38. import_tasks: tasks/create_blob_from_vm.yml
  39. when: openshift_azure_storage_account is defined and openshift_azure_storage_account