diff --git a/ansible/deploy.yml b/ansible/deploy.yml index 4bad2b1..41ddb6b 100644 --- a/ansible/deploy.yml +++ b/ansible/deploy.yml @@ -3,7 +3,7 @@ tasks: - include_tasks: host_setup.yml -- hosts: controllers +- hosts: localhost tasks: - include_tasks: schedule.yml @@ -19,11 +19,10 @@ vm_name: "{{ item.0.name }}" physnet: "{{ item.1 }}" # Loop over each physical network for each VM allocated to this host. - # Allocations are stored in the controller node's vars. + # Allocations are stored in localhost's vars. loop: >- - {{ hostvars[groups.controllers.0].allocations.result[ - inventory_hostname] | default([]) - | subelements('physical_networks') }} + {{ hostvars['localhost'].allocations.result[inventory_hostname] + | default([]) | subelements('physical_networks') }} - hosts: libvirt tasks: @@ -42,7 +41,7 @@ - include_tasks: libvirt_create_vms.yml vars: - # Allocations are stored in the controller node's vars. + # Allocations are stored in the localhost's vars. vms: >- - {{ hostvars[groups.controllers.0].allocations.result[ - inventory_hostname] | default([]) }} + {{ hostvars['localhost'].allocations.result[inventory_hostname] + | default([]) }} diff --git a/ansible/group_vars/controllers b/ansible/host_vars/localhost similarity index 100% rename from ansible/group_vars/controllers rename to ansible/host_vars/localhost diff --git a/ansible/inventory/groups b/ansible/inventory/groups index ddff47f..14f8600 100644 --- a/ansible/inventory/groups +++ b/ansible/inventory/groups @@ -1,6 +1,3 @@ -[controllers] -# Empty group to provide delaration of controllers group. - [hypervisors:children] libvirt diff --git a/ansible/inventory/hosts b/ansible/inventory/hosts index 0d9f08f..7f3c0b7 100644 --- a/ansible/inventory/hosts +++ b/ansible/inventory/hosts @@ -1,5 +1,2 @@ -[controllers] -localhost ansible_connection=local - [libvirt] localhost ansible_connection=local diff --git a/ansible/physical_network.yml b/ansible/physical_network.yml index 5b5e013..788fc89 100644 --- a/ansible/physical_network.yml +++ b/ansible/physical_network.yml @@ -10,7 +10,7 @@ # Start off by assuming the source interface is direct, unless proven # otherwise. - set_fact: - source_type: 'direct' + source_type: direct - name: Get source interface details command: ip -details link show {{ source_interface }} @@ -79,8 +79,6 @@ options:peer={{ veth_prefix + tenks_bridge + veth_bridge_ovs_suffix }} - when: if_details.stdout_lines[-1].split()[0] == 'openvswitch' - - name: Plug source interface into Tenks bridge when: source_type == 'direct' openvswitch_port: diff --git a/ansible/schedule.yml b/ansible/schedule.yml index 34345d7..2258334 100644 --- a/ansible/schedule.yml +++ b/ansible/schedule.yml @@ -12,7 +12,7 @@ set_fact: hypervisor_vars: >- {{ hypervisor_vars | default({}) | combine({item: hostvars[item]}) }} - loop: "{{ groups['controllers'] }}" + loop: "{{ groups['hypervisors'] }}" - name: Schedule VMs to hypervisors tenks_schedule: