Skip to content

Commit

Permalink
nova: refactor common playbook to use role instead of include_role
Browse files Browse the repository at this point in the history
Since introducing distro. installs, we have two different role
inclusions, one for distro and one for source.  It seems that this
was done to send a different set of variables to each run.

With the recent build changes, all the branch variables are already
included using from openstack_services.yml so there's no need to
redefine them.

This means we can bring the two includes back to a normal role
reference, which resolves a few issues around using import_role and
brings back the ability to use tags only with this playbook.

Change-Id: I6c6651ce923530b1d2395cd387faf6e74c9b17d8
  • Loading branch information
mnaser committed Mar 28, 2019
1 parent fbe9084 commit 1f1cca4
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions playbooks/common-playbooks/nova.yml
Expand Up @@ -25,7 +25,7 @@
- "../defaults/{{ install_method }}_install.yml"
tags:
- nova
tasks:
pre_tasks:
# Enable execution of ceph_client on the nova compute hosts if cinder RBD
# backends are used. This is necessary to ensure that volume-backed Nova
# instances can function when RBD is the volume backend.
Expand Down Expand Up @@ -139,32 +139,16 @@
tags:
- always

- name: Installing the Nova service (source)
include_role:
name: "os_nova"
vars:
nova_novncproxy_git_repo: "{{ openstack_repo_git_url }}/novnc"
nova_novncproxy_git_install_branch: "{{ novncproxy_git_install_branch }}"
nova_spicehtml5_git_repo: "{{ openstack_repo_git_url }}/spice-html5"
nova_spicehtml5_git_install_branch: "{{ spicehtml5_git_install_branch }}"
nova_management_address: "{{ management_address }}"
nova_cinder_rbd_inuse: "{{ hostvars['localhost']['nova_cinder_rbd_inuse'] }}"
when: install_method == "source"

- name: Installing the Nova service (distro)
include_role:
name: "os_nova"
vars:
nova_management_address: "{{ management_address }}"
nova_cinder_rbd_inuse: "{{ hostvars['localhost']['nova_cinder_rbd_inuse'] }}"
when: install_method == "distro"
roles:
- role: "os_nova"
nova_management_address: "{{ management_address }}"
nova_cinder_rbd_inuse: "{{ hostvars['localhost']['nova_cinder_rbd_inuse'] }}"

- name: Configuring system crontab
include_role:
name: "system_crontab_coordination"
- role: "system_crontab_coordination"
tags:
- crontab

post_tasks:
- include_tasks: "../common-tasks/rsyslog-client.yml"
vars:
rsyslog_client_log_rotate_file: nova_log_rotate
Expand Down

0 comments on commit 1f1cca4

Please sign in to comment.