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 name_servers_search: "{{ name_servers_search }}"
20 kickstart: "/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed"
21 kernel_options: '"interface={{ ansible_default_ipv4.interface }}"'
23 username: "{{ cobbler_username }}"
26 when: provision_enabled
27 delegate_to: localhost
31 - name: Commit Cobbler changes
33 host: "{{ cobbler_hostname }}"
35 password: "{{ cobbler_password }}"
36 username: "{{ cobbler_username }}"
40 when: provision_enabled
41 delegate_to: localhost
42 register: __included_in_cobbler
49 - meta: flush_handlers
51 - name: Copy netplan network config file
53 src: "files/netplan_config"
54 dest: "/etc/netplan/01-netcfg.yaml"
61 - meta: flush_handlers