kickstart.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Initial cobbler setup
  16. hosts: localhost
  17. connection: local
  18. gather_facts: false
  19. vars:
  20. name_iso: CentOS8
  21. distro_name: CentOS8-x86_64
  22. kernel_path: /var/www/cobbler/ks_mirror/CentOS8-x86_64/isolinux/vmlinuz
  23. tasks:
  24. - name: Inside cobbler container
  25. debug:
  26. msg: "Hiii! I am cobbler"
  27. - name: Start services
  28. service:
  29. name: "{{ item }}"
  30. state: started
  31. loop:
  32. - cobblerd
  33. - httpd
  34. - rsyncd
  35. - xinetd
  36. - tftp
  37. - name: Cobbler get-loaders
  38. command: cobbler get-loaders
  39. changed_when: false
  40. - name: Run import command
  41. command: cobbler import --arch=x86_64 --path=/mnt --name="{{ name_iso }}"
  42. changed_when: false
  43. - name: Distro list
  44. command: >-
  45. cobbler distro edit --name="{{ distro_name }}" --kernel="{{ kernel_path }}" --initrd=/var/www/cobbler/ks_mirror/CentOS8-x86_64/isolinux/initrd.img
  46. changed_when: false
  47. - name: Kickstart profile
  48. command: cobbler profile edit --name="{{ distro_name }}" --kickstart=/var/lib/cobbler/kickstarts/centos8.ks
  49. changed_when: false
  50. - name: Syncing of cobbler
  51. command: cobbler sync
  52. changed_when: false
  53. - name: Start xinetd
  54. service:
  55. name: xinetd
  56. state: restarted
  57. - name: Start dhcp
  58. service:
  59. name: dhcpd
  60. state: restarted