From bd728b82b7433da4df29f6477751d658b81f36b0 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 7 Nov 2018 12:16:18 +0000 Subject: [PATCH] Update legacy neutron L3HA tool support This tool is still useful in some environments. In this patch we ensure that if it is enabled, the openrc file will be deployed on the host. We also remove the TODO for it's removal. Change-Id: I427765d0ff219b38bc3c86384e3807321db59dec --- defaults/main.yml | 5 ++- tasks/neutron_l3_ha.yml | 67 +++++++++++++++++++---------------------- 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index a13100ef..14aa1a42 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -385,7 +385,10 @@ neutron_local_ip: 127.0.0.1 ### # Set this option to "true" to enable legacy neutron L3HA tool support -# TODO(cloudnull): Remove this in the Ocata cycle +# This tool is useful to ensure any non-HA neutron entities +# are re-scheduled if the agent managing them goes down. +# It is also useful if the built-in HA capabilities cannot +# be used in the environment for whatever reason. neutron_legacy_ha_tool_enabled: false # L3HA configuration options diff --git a/tasks/neutron_l3_ha.yml b/tasks/neutron_l3_ha.yml index c1396159..b89580d5 100644 --- a/tasks/neutron_l3_ha.yml +++ b/tasks/neutron_l3_ha.yml @@ -13,45 +13,40 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This should be revised in Kilo -# kilo_revision: true - -- name: "Drop AT&T neutron ha tool" - template: - src: "neutron-ha-tool.py.j2" - dest: "/opt/neutron-ha-tool.py" - owner: "root" - group: "root" - mode: "0755" - tags: - - neutron-install +- name: Implement the legacy neutron L3HA tool scripts when: - neutron_legacy_ha_tool_enabled | bool + block: + - name: Implement the neutron HA tool script + template: + src: "neutron-ha-tool.py.j2" + dest: "/opt/neutron-ha-tool.py" + owner: "root" + group: "root" + mode: "0755" -- name: Convert the hostname to an int - name2int: - name: "{{ inventory_hostname }}" - register: hashed_name - when: - - neutron_legacy_ha_tool_enabled | bool + - name: Convert the hostname to an int + name2int: + name: "{{ inventory_hostname }}" + register: hashed_name -# These are used in the Neutron HA Cron job script, and processed in the template. -- name: Creating Job Facts - set_fact: - do_job: ". /root/openrc && /opt/neutron-ha-tool.py {% if keystone_service_internaluri_insecure | bool %}--insecure {% endif %}--l3-agent-migrate" - sleep_time: "{{ hashed_name.int_value }}" - when: - - neutron_legacy_ha_tool_enabled | bool + # These are used in the Neutron HA Cron job script, and processed in the template. + - name: Creating Job Facts + set_fact: + do_job: ". /root/openrc && /opt/neutron-ha-tool.py {% if keystone_service_internaluri_insecure | bool %}--insecure {% endif %}--l3-agent-migrate" + sleep_time: "{{ hashed_name.int_value }}" -- name: "Drop Neutron HA job script" - template: - src: "neutron_ha_tool.sh.j2" - dest: "/opt/neutron-ha-tool.sh" - owner: "root" - group: "root" - mode: "0755" - when: - - neutron_legacy_ha_tool_enabled | bool + - name: Implement openrc/clouds.yaml + include_role: + name: "openstack_openrc" + + - name: Implement the Neutron HA job script + template: + src: "neutron_ha_tool.sh.j2" + dest: "/opt/neutron-ha-tool.sh" + owner: "root" + group: "root" + mode: "0755" - name: Create Neutron HA cron: @@ -65,7 +60,7 @@ user: root cron_file: "neutron-ha-tool" -- name: "Remove AT&T neutron ha tool when disabled" +- name: Remove AT&T neutron ha tool when disabled file: path: "{{ item }}" state: "absent" @@ -73,4 +68,4 @@ - "/opt/neutron-ha-tool.py" - "/opt/neutron-ha-tool.sh" when: - - not neutron_legacy_ha_tool_enabled | bool \ No newline at end of file + - not neutron_legacy_ha_tool_enabled | bool