From 405ccdada2d39da3dae93ea98da052b151e06689 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Mon, 1 Jul 2019 13:22:36 +0100
Subject: [PATCH] Adds support for Ansible 2.7, bump mimimum to 2.5

Updates the minimum version of Ansible from 2.4 to 2.5, and the maximum
supported version from 2.6 to 2.7.

Change-Id: If8071a9b5c85e5e69fbb333e91c84d10c20d80f3
Story: 2006143
Task: 35639
---
 ansible/kolla-ansible.yml                     | 31 ++++++++++---------
 .../templates/requirements.txt.j2             |  2 +-
 .../roles/kolla-ansible/tests/test-extras.yml |  1 -
 .../ansible-2.5-2.7-c06a682f4f07755d.yaml     |  6 ++++
 requirements.txt                              |  6 +---
 5 files changed, 24 insertions(+), 22 deletions(-)
 create mode 100644 releasenotes/notes/ansible-2.5-2.7-c06a682f4f07755d.yaml

diff --git a/ansible/kolla-ansible.yml b/ansible/kolla-ansible.yml
index ca9b85d7..7679887c 100644
--- a/ansible/kolla-ansible.yml
+++ b/ansible/kolla-ansible.yml
@@ -283,18 +283,19 @@
         - config
         - config-validation
 
-  roles:
-    - role: kolla-ansible
-      kolla_ansible_install_epel: "{{ yum_install_epel }}"
-      kolla_external_fqdn_cert: "{{ kolla_config_path }}/certificates/haproxy.pem"
-      kolla_ansible_passwords_path: "{{ kayobe_config_path }}/kolla/passwords.yml"
-      # NOTE: This differs from the default SELinux mode in kolla ansible,
-      # which is permissive. The justification for using this mode is twofold:
-      # 1. it avoids filling up the audit log
-      # 2. it avoids an issue seen when using diskimage-builder in the bifrost
-      # container.
-      # We could look at making the SELinux mode configurable in future.
-      kolla_selinux_state: disabled
-      kolla_inspector_dhcp_pool_start: "{{ inspection_net_name | net_inspection_allocation_pool_start }}"
-      kolla_inspector_dhcp_pool_end: "{{ inspection_net_name | net_inspection_allocation_pool_end }}"
-      kolla_inspector_default_gateway: "{{ inspection_net_name | net_inspection_gateway or inspection_net_name | net_gateway }}"
+    - import_role:
+        name: kolla-ansible
+      vars:
+        kolla_ansible_install_epel: "{{ yum_install_epel }}"
+        kolla_external_fqdn_cert: "{{ kolla_config_path }}/certificates/haproxy.pem"
+        kolla_ansible_passwords_path: "{{ kayobe_config_path }}/kolla/passwords.yml"
+        # NOTE: This differs from the default SELinux mode in kolla ansible,
+        # which is permissive. The justification for using this mode is twofold:
+        # 1. it avoids filling up the audit log
+        # 2. it avoids an issue seen when using diskimage-builder in the bifrost
+        # container.
+        # We could look at making the SELinux mode configurable in future.
+        kolla_selinux_state: disabled
+        kolla_inspector_dhcp_pool_start: "{{ inspection_net_name | net_inspection_allocation_pool_start }}"
+        kolla_inspector_dhcp_pool_end: "{{ inspection_net_name | net_inspection_allocation_pool_end }}"
+        kolla_inspector_default_gateway: "{{ inspection_net_name | net_inspection_gateway or inspection_net_name | net_gateway }}"
diff --git a/ansible/roles/kolla-ansible/templates/requirements.txt.j2 b/ansible/roles/kolla-ansible/templates/requirements.txt.j2
index d45bd839..2bb51239 100644
--- a/ansible/roles/kolla-ansible/templates/requirements.txt.j2
+++ b/ansible/roles/kolla-ansible/templates/requirements.txt.j2
@@ -7,7 +7,7 @@ kolla-ansible=={{ kolla_openstack_release }}
 {% endif %}
 # Limit the version of ansible used by kolla-ansible to avoid new releases from
 # breaking tested code. Changes to this limit should be tested.
-ansible<2.7
+ansible>=2.5,<2.8
 {% if kolla_ansible_venv_extra_requirements is defined %}
 {% for item in kolla_ansible_venv_extra_requirements %}
 {{ item }}
diff --git a/ansible/roles/kolla-ansible/tests/test-extras.yml b/ansible/roles/kolla-ansible/tests/test-extras.yml
index 815684e6..601096f6 100644
--- a/ansible/roles/kolla-ansible/tests/test-extras.yml
+++ b/ansible/roles/kolla-ansible/tests/test-extras.yml
@@ -53,7 +53,6 @@
         - name: Test the kolla-ansible role with default values
           include_role:
             name: ../../kolla-ansible
-          static: False
           vars:
             kolla_ansible_source_path: "{{ temp_path }}/src"
             kolla_ansible_ctl_install_type: "source"
diff --git a/releasenotes/notes/ansible-2.5-2.7-c06a682f4f07755d.yaml b/releasenotes/notes/ansible-2.5-2.7-c06a682f4f07755d.yaml
new file mode 100644
index 00000000..0e083dbf
--- /dev/null
+++ b/releasenotes/notes/ansible-2.5-2.7-c06a682f4f07755d.yaml
@@ -0,0 +1,6 @@
+---
+upgrade:
+  - |
+    Updates the minimum supported version of Ansible from 2.4 to 2.5, and the
+    maximum supported version from 2.6 to 2.7. This is true for both Kayobe and
+    Kolla Ansible.
diff --git a/requirements.txt b/requirements.txt
index d306f100..def58214 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,11 +3,7 @@
 # process, which may cause wedges in the gate later.
 
 pbr>=2.0 # Apache-2.0
-# Ansible 2.3 has a bug (#30350) in the Dell network modules. Pull in a version
-# with the fix backported. It can be installed by uncommenting the following
-# line and commenting the one after.
-# -e git+https://github.com/stackhpc/ansible@issue-30350-2.3#egg=ansible-issue-30350-2.3 # GPLv3
-ansible>=2.4.0,<2.7.0 # GPLv3
+ansible>=2.5.0,<2.8.0 # GPLv3
 cliff>=2.5.0,<2.15.0 # Apache
 netaddr!=0.7.16,>=0.7.13 # BSD
 # paramiko 2.5.0 makes the kayobe-tox-molecule job fail.
-- 
GitLab