main.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ---
  2. # Deploying:
  3. # - PXE config
  4. # - install-config.yaml
  5. # - network customization
  6. #
  7. # REQUIRES:
  8. # - variable "node" according to vms structure
  9. #
  10. # Publish PXE config stuff
  11. - name: Deploy PXE config file
  12. template:
  13. src: templates/pxe-sno.j2
  14. dest: /var/lib/tftpboot/pxelinux.cfg/{{ node.cluster }}-{{ node.name }}
  15. - name: Create symbolic link to PXE boot entry
  16. file:
  17. path: /var/lib/tftpboot/pxelinux.cfg/{{ node.mac }}
  18. src: "{{ node.cluster }}-{{ node.name }}"
  19. state: link
  20. # Create the OCP installation directory and populate it
  21. - name: Make sure workdir exists
  22. become: no
  23. file:
  24. path: /home/lab/{{ node.cluster }}
  25. state: directory
  26. mode: 0755
  27. owner: lab
  28. group: lab
  29. - name: Place the install config to workdir
  30. become: no
  31. template:
  32. src: templates/install-config-sno.yaml.j2
  33. dest: /home/lab/{{ node.cluster }}/install-config.yaml
  34. mode: 0644
  35. owner: lab
  36. group: lab
  37. - name: Create a backup copy of install config
  38. become: no
  39. copy:
  40. src: /home/lab/{{ node.cluster }}/install-config.yaml
  41. dest: /home/lab/install-config-{{ node.cluster }}.yaml
  42. remote_src: yes
  43. mode: 0644
  44. owner: lab
  45. group: lab
  46. - name: Create installation manifests
  47. become: no
  48. shell: openshift-install create manifests
  49. args:
  50. chdir: /home/lab/{{ node.cluster }}
  51. - name: Deploy the network config customization
  52. become: no
  53. template:
  54. src: templates/netcfg.bu.j2
  55. dest: /home/lab/netcfg.bu
  56. mode: 0644
  57. owner: lab
  58. group: lab
  59. - name: Process network config with butane
  60. become: no
  61. shell: butane netcfg.bu -o {{ node.cluster }}/openshift/01-master-network.yaml
  62. args:
  63. chdir: /home/lab
  64. - name: Create the ignition file
  65. become: no
  66. shell: openshift-install create single-node-ignition-config
  67. args:
  68. chdir: /home/lab/{{ node.cluster }}
  69. - name: Publish ignition configs
  70. copy:
  71. src: /home/lab/{{ node.cluster }}/bootstrap-in-place-for-live-iso.ign
  72. dest: "{{ ignitions_directory }}/{{ node.cluster }}-{{ node.name }}.ign"
  73. remote_src: yes
  74. mode: 0644
  75. owner: root
  76. group: root
  77. ...