diff --git a/README.md b/README.md index f3f115e..d33d907 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ installed inside it, Tenks' role dependencies can be installed by Currently, Tenks does not have a CLI or wrapper. A virtual cluster can be deployed by configuring the variables defined in `group_vars/*` as necessary, -then calling `ansible-playbook --inventory ansible/inventory deploy.yml`. +then calling `ansible-playbook --inventory ansible/inventory ansible/deploy.yml`. diff --git a/ansible/deploy_hosts.yml b/ansible/deploy_hosts.yml index 59939c1..a8cbbdf 100644 --- a/ansible/deploy_hosts.yml +++ b/ansible/deploy_hosts.yml @@ -5,7 +5,8 @@ - hosts: libvirt tasks: - - include_role: + - name: Configure host for Libvirt + include_role: name: stackhpc.libvirt-host vars: libvirt_host_pools: diff --git a/ansible/host_setup.yml b/ansible/host_setup.yml index ca38567..f3a99f7 100644 --- a/ansible/host_setup.yml +++ b/ansible/host_setup.yml @@ -28,10 +28,10 @@ state: running enabled: true become: true - # Return code 127 means the command does not exist. Do this check to avoid - # installing Open vSwitch system-wide if the command already exists as a link - # to a containerised version of OVS. - when: ovs_vsctl_check.rc == 127 + # Assume a non-zero return code means the command does not exist. Do this + # check to avoid installing Open vSwitch system-wide if the command already + # exists as a link to a containerised version of OVS. + when: ovs_vsctl_check.rc != 0 - name: Configure physical networks include_tasks: physical_network.yml diff --git a/ansible/physical_network.yml b/ansible/physical_network.yml index 788fc89..f806a55 100644 --- a/ansible/physical_network.yml +++ b/ansible/physical_network.yml @@ -40,6 +40,7 @@ - name: Ensure Open vSwitch bridge exists openvswitch_bridge: bridge: "{{ tenks_bridge }}" + become: true - name: Connect to existing Linux bridge when: source_type == 'linux_bridge' diff --git a/ansible/roles/virtualbmc-daemon/defaults/main.yml b/ansible/roles/virtualbmc-daemon/defaults/main.yml index 1bca599..e31f6d9 100644 --- a/ansible/roles/virtualbmc-daemon/defaults/main.yml +++ b/ansible/roles/virtualbmc-daemon/defaults/main.yml @@ -1,4 +1,9 @@ --- +# List of package dependencies to install. +# TODO: Make platform-independent. +vbmcd_packages: + - gcc + - libvirt-devel # The path to the virtualenv in which to install Virtual BMC. vbmcd_virtualenv_path: # The URL of the upper constraints file to pass to pip when installing Python diff --git a/ansible/roles/virtualbmc-daemon/tasks/main.yml b/ansible/roles/virtualbmc-daemon/tasks/main.yml index 6f57966..c850a50 100644 --- a/ansible/roles/virtualbmc-daemon/tasks/main.yml +++ b/ansible/roles/virtualbmc-daemon/tasks/main.yml @@ -1,7 +1,10 @@ --- -- name: Set service name - set_fact: - service: vbmcd +- name: Ensure package dependencies are installed + package: + name: "{{ item }}" + state: installed + loop: "{{ vbmcd_packages }}" + become: true - name: Ensure Python requirements are installed pip: diff --git a/ansible/roles/virtualbmc-daemon/vars/main.yml b/ansible/roles/virtualbmc-daemon/vars/main.yml new file mode 100644 index 0000000..176ea55 --- /dev/null +++ b/ansible/roles/virtualbmc-daemon/vars/main.yml @@ -0,0 +1,3 @@ +--- +# The name of the Virtual BMC daemon systemd service. +service: vbmcd