diff --git a/playbook.yml b/playbook.yml index c3f4b49b..8387172b 100644 --- a/playbook.yml +++ b/playbook.yml @@ -3,3 +3,4 @@ become: yes roles: - { role: lxd } + - { role: opennebula } diff --git a/roles/opennebula/defaults/main.yml b/roles/opennebula/defaults/main.yml new file mode 100644 index 00000000..0101245d --- /dev/null +++ b/roles/opennebula/defaults/main.yml @@ -0,0 +1,6 @@ +--- +opennebula_packages: + - opennebula + - opennebula-sunstone + - opennebula-gate + - opennebula-flow diff --git a/roles/opennebula/tasks/main.yml b/roles/opennebula/tasks/main.yml new file mode 100644 index 00000000..ee29ab19 --- /dev/null +++ b/roles/opennebula/tasks/main.yml @@ -0,0 +1,26 @@ +--- +- name: Add OpenNebula key + apt_key: + url: https://downloads.opennebula.io/repo/repo.key + state: present + +- name: Add OpenNebula repository + apt_repository: + repo: deb https://downloads.opennebula.io/repo/5.12/Ubuntu/18.04 stable opennebula + filename: opennebula + update_cache: yes + state: present + +- name: Install OpenNebula + package: + name: "{{ opennebula_packages }}" + state: present + +- name: Enable OpenNebula services + service: + name: "{{ item }}" + enabled: yes + state: started + with_items: + - opennebula + - opennebula-sunstone