12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- ---
- - name: Initial cobbler setup
- hosts: localhost
- connection: local
- gather_facts: false
- vars:
- name_iso: CentOS8
- distro_name: CentOS8-x86_64
- kernel_path: /var/www/cobbler/ks_mirror/CentOS8-x86_64/isolinux/vmlinuz
- tasks:
- - name: Inside cobbler container
- debug:
- msg: "Hiii! I am cobbler"
- - name: Start services
- service:
- name: "{{ item }}"
- state: started
- loop:
- - cobblerd
- - httpd
- - rsyncd
- - xinetd
- - tftp
- - name: Cobbler get-loaders
- command: cobbler get-loaders
- changed_when: false
- - name: Run import command
- command: cobbler import --arch=x86_64 --path=/mnt --name="{{ name_iso }}"
- changed_when: false
- - name: Distro list
- command: >-
- cobbler distro edit --name="{{ distro_name }}" --kernel="{{ kernel_path }}" --initrd=/var/www/cobbler/ks_mirror/CentOS8-x86_64/isolinux/initrd.img
- changed_when: false
- - name: Kickstart profile
- command: cobbler profile edit --name="{{ distro_name }}" --kickstart=/var/lib/cobbler/kickstarts/centos8.ks
- changed_when: false
- - name: Syncing of cobbler
- command: cobbler sync
- changed_when: false
- - name: Start xinetd
- service:
- name: xinetd
- state: restarted
- - name: Start dhcp
- service:
- name: dhcpd
- state: restarted
|