# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. --- - 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