Fix: Ansible minor bugs
[csit.git] / resources / tools / testbed-setup / ansible / roles / vexx_hosts / tasks / main.yaml
1 ---
2 # file: roles/vexx_hosts/tasks/main.yaml
3
4 - name: Ensure the system exists in Cobbler
5   cobbler_system:
6     host: "{{ cobbler_hostname }}"
7     port: 60080
8     interfaces:
9       br1:
10         ipaddress: "{{ ansible_default_ipv4.address }}"
11         macaddress: "{{ ansible_default_ipv4.macaddress }}"
12     name: "{{ hostname }}"
13     password: "{{ cobbler_password }}"
14     properties:
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 }}"'
21       netboot_enabled: yes
22     username: "{{ cobbler_username }}"
23     use_ssl: no
24     validate_certs: no
25   when: provision_enabled
26   delegate_to: localhost
27   tags:
28     - cobbler-include
29
30 - name: Commit Cobbler changes
31   cobbler_sync:
32     host: "{{ cobbler_hostname }}"
33     port: 60080
34     password: "{{ cobbler_password }}"
35     username: "{{ cobbler_username }}"
36     use_ssl: no
37     validate_certs: no
38   run_once: yes
39   when: provision_enabled
40   delegate_to: localhost
41   register: __included_in_cobbler
42   notify:
43     - "Boot from network"
44     - "Reboot server"
45   tags:
46     - cobbler-include
47
48 - meta: flush_handlers