diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/post-osa')
6 files changed, 119 insertions, 12 deletions
diff --git a/deploy/adapters/ansible/roles/post-osa/handlers/main.yml b/deploy/adapters/ansible/roles/post-osa/handlers/main.yml index 3d979e6a..d685edca 100755 --- a/deploy/adapters/ansible/roles/post-osa/handlers/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/handlers/main.yml @@ -9,3 +9,17 @@ - name: restart network service shell: "/sbin/ifconfig eth0 0 &&/sbin/ifdown -a && \ /sbin/ifup --ignore-errors -a" + +- name: Restart ceilometer services + service: + name: "{{ item.0.service_name }}" + enabled: "yes" + state: "restarted" + with_subelements: + - "{{ ceilometer_services }}" + - group + when: inventory_hostname in groups[item.1] + register: _restart + until: _restart | success + retries: 5 + delay: 2 diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml b/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml new file mode 100755 index 00000000..3d991b74 --- /dev/null +++ b/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml @@ -0,0 +1,28 @@ +############################################################################# +# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +- name: check for gnocchi resource file + stat: + path: "/etc/ceilometer/gnocchi_resources.yaml" + register: gnocchi_resource_file + +- name: get the path of ceilometer-upgrade + shell: "find / -name ceilometer-upgrade 2>/dev/null || true" + register: ceilometer_upgrade_path + +- name: Initialize Gnocchi database by creating ceilometer resources + command: "{{ ceilometer_upgrade_path.stdout }} --skip-metering-database" + become: "yes" + when: gnocchi_resource_file.stat.exists + register: _upgrade + until: _upgrade | success + retries: 10 + delay: 2 + notify: + - Restart ceilometer services diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml index fbed5815..d5a04e78 100644 --- a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml +++ b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml @@ -3,7 +3,7 @@ - name: install networking-sfc pip: name: networking-sfc - virtualenv: /openstack/venvs/neutron-15.1.4 + virtualenv: /openstack/venvs/neutron-{{ os_ver }} when: - inventory_hostname in groups['neutron_server'] @@ -11,14 +11,12 @@ package: name: crudini state: latest - when: - - inventory_hostname in groups['neutron_server'] - name: Install networking-sfc for CLI pip: name: networking-sfc when: - - inventory_hostname in groups['utility'] + - inventory_hostname not in groups['neutron_server'] - name: turn off neutron-server on control node service: name=neutron-server state=stopped @@ -35,13 +33,18 @@ shell: crudini --merge /etc/neutron/neutron.conf < /opt/sfc.conf when: inventory_hostname in groups['neutron_server'] +- name: Configure SFC extension on compute nodes + shell: crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini \ + agent extensions sfc; + when: inventory_hostname in groups['compute'] + - name: delete sfc.conf shell: rm -rf {{ sfc_plugins.dst }} when: inventory_hostname in groups['neutron_server'] - name: Perform a Neutron DB online upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --expand @@ -51,7 +54,7 @@ - name: Perform a Neutron DB offline upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --contract @@ -61,7 +64,7 @@ - name: SFC DB upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --subproject networking-sfc upgrade head become: "yes" diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml index bd83b50f..fed3842f 100644 --- a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml @@ -13,13 +13,19 @@ - ansible_distribution == 'Ubuntu' # install networking-sfc for non odl scenarios -# - include: install_networking_sfc.yml -# when: -# - odl_sfc is not defined or odl_sfc == "Disable" -# - inventory_hostname not in groups['compute'] -# when: ansible_distribution == 'Ubuntu' +- include: install_networking_sfc.yml + when: + - opendaylight is not defined or opendaylight == "Disable" + - inventory_hostname not in groups['horizon_all'] - include: "{{ ansible_os_family }}.yml" when: - ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' - inventory_hostname in groups['compute'] + +- include: ceilometer-upgrade.yml + when: + - inventory_hostname in groups['ceilometer_all'] + +- include: tacker_horizon.yml + when: inventory_hostname in groups['horizon_all'] diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml new file mode 100644 index 00000000..2c1d2d87 --- /dev/null +++ b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml @@ -0,0 +1,33 @@ +--- + +- name: remove tacker-horizon directory + file: + path: "{{ tacker_horizon_dir }}" + state: absent + +- name: get tacker horizon (online) + git: + repo: "{{ tacker_horizon_repo }}" + dest: "{{ tacker_horizon_dir }}" + version: "{{ tacker_horizon_branch }}" + when: offline_deployment is defined and offline_deployment == "Disable" + +- name: copy installation script (offline) + get_url: + url: "http://{{ offline_repo_ip }}:{{ offline_repo_port }}/tacker-horizon.tar.gz" + dest: "/opt/" + when: offline_deployment is defined and offline_deployment == "Enable" + +- name: untar tacker-horizon tarball + command: su -s /bin/sh -c "tar xzf /opt/tacker-horizon.tar.gz -C /opt/" + when: offline_deployment is defined and offline_deployment == "Enable" + +- name: install tacker-horizon + shell: | + cd /opt/tacker-horizon/; + pip install -r requirements.txt; + sleep 30; + python setup.py install; + cp tacker_horizon/enabled/* \ + {{ tacker_horizon_enable_path }}/; + service apache2 restart diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml index da886028..95f51530 100644 --- a/deploy/adapters/ansible/roles/post-osa/vars/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml @@ -1,5 +1,17 @@ --- +os_ver: 16.0.5 +os_name: pike + +# yamllint disable rule:line-length +tacker_horizon_repo: https://github.com/openstack/tacker-horizon.git +tacker_horizon_dir: /opt/tacker-horizon +tacker_horizon_branch: "stable/{{ os_name }}" +openstack_release: "{{ os_ver }}" +tacker_horizon_venv: "/openstack/venvs/horizon-{{ openstack_release }}" +tacker_horizon_enable_path: "{{ tacker_horizon_venv }}/lib/python2.7/site-packages/openstack_dashboard/enabled" +# yamllint enable rule:line-length + sfc_plugins: src: sfc.conf dst: /opt/sfc.conf @@ -24,3 +36,14 @@ intf_storage: |- {%- set intf_storage = intf_storage + '.' + compu_sys_mappings["storage"]["vlan_tag"]|string %} {%- endif %} {{- intf_storage }} + +ceilometer_services: + ceilometer-agent-notification: + group: + - ceilometer_agent_notification + service_name: ceilometer-agent-notification + ceilometer-polling: + group: + - ceilometer_agent_central + - ceilometer_agent_compute + service_name: ceilometer-polling |