2 # file: roles/vexx_hosts/tasks/main.yaml
4 - name: Ensure the system exists in Cobbler
6 host: "{{ cobbler_hostname }}"
10 ipaddress: "{{ ansible_default_ipv4.address }}"
11 macaddress: "{{ ansible_default_ipv4.macaddress }}"
12 name: "{{ hostname }}"
13 password: "{{ cobbler_password }}"
15 hostname: "{{ hostname }}"
16 gateway: "{{ ansible_default_ipv4.gateway }}"
17 profile: "{{ cobbler_profile }}"
18 name_servers: "{{ name_servers }}"
19 kickstart: "/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed"
20 kernel_options: '"interface={{ ansible_default_ipv4.interface }}"'
22 username: "{{ cobbler_username }}"
25 when: provision_enabled
26 delegate_to: localhost
30 - name: Commit Cobbler changes
32 host: "{{ cobbler_hostname }}"
34 password: "{{ cobbler_password }}"
35 username: "{{ cobbler_username }}"
39 when: provision_enabled
40 delegate_to: localhost
41 register: __included_in_cobbler
48 - meta: flush_handlers