From c073b2d897161792d098e4e52c229813ede43ca7 Mon Sep 17 00:00:00 2001
From: Christian Berendt <berendt@betacloud-solutions.de>
Date: Thu, 16 Jun 2016 12:16:07 +0200
Subject: [PATCH] Remove EC2 API related configurations and tasks

The Nova EC2 API is disabled by default, the default value
of the enabled_apis parameter in nova.conf is "osapi_compute, metadata"
The EC2 API is marked as deprecated and will be removed from Nova in
the future.

Change-Id: I6b9d66017e066cde5749be45b367194d2192ead3
Closes-bug: #1586605
---
 ansible/group_vars/all.yml                     |  1 -
 ansible/roles/haproxy/templates/haproxy.cfg.j2 | 15 ---------------
 ansible/roles/nova/templates/nova.conf.j2      |  3 ---
 ansible/roles/prechecks/tasks/port_checks.yml  | 16 ----------------
 4 files changed, 35 deletions(-)

diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 007919e9b3..d4bade7643 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -117,7 +117,6 @@ glance_api_port: "9292"
 glance_registry_port: "9191"
 
 nova_api_port: "8774"
-nova_api_ec2_port: "8773"
 nova_metadata_port: "8775"
 nova_novncproxy_port: "6080"
 nova_spicehtml5proxy_port: "6082"
diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2
index a6507ed20a..3bd8cc8fd1 100644
--- a/ansible/roles/haproxy/templates/haproxy.cfg.j2
+++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2
@@ -121,13 +121,6 @@ listen nova_api
   server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ nova_api_port }} check inter 2000 rise 2 fall 5
 {% endfor %}
 
-listen nova_api_ec2
-  bind {{ kolla_internal_vip_address }}:{{ nova_api_ec2_port }}
-  http-request del-header X-Forwarded-Proto
-{% for host in groups['nova-api'] %}
-  server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ nova_api_ec2_port }} check inter 2000 rise 2 fall 5
-{% endfor %}
-
 listen nova_metadata
   bind {{ kolla_internal_vip_address }}:{{ nova_metadata_port }}
   http-request del-header X-Forwarded-Proto
@@ -160,14 +153,6 @@ listen nova_api_external
   server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ nova_api_port }} check inter 2000 rise 2 fall 5
 {% endfor %}
 
-listen nova_api_ec2_external
-  bind {{ kolla_external_vip_address }}:{{ nova_api_ec2_port }} {{ tls_bind_info }}
-  http-request del-header X-Forwarded-Proto
-  http-request set-header X-Forwarded-Proto https if { ssl_fc }
-{% for host in groups['nova-api'] %}
-  server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ nova_api_ec2_port }} check inter 2000 rise 2 fall 5
-{% endfor %}
-
 listen nova_metadata_external
   bind {{ kolla_external_vip_address }}:{{ nova_metadata_port }} {{ tls_bind_info }}
   http-request del-header X-Forwarded-Proto
diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2
index 04a3b5439a..5425c9ac1f 100644
--- a/ansible/roles/nova/templates/nova.conf.j2
+++ b/ansible/roles/nova/templates/nova.conf.j2
@@ -18,9 +18,6 @@ osapi_compute_listen_port = {{ nova_api_port }}
 metadata_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
 metadata_listen_port = {{ nova_metadata_port }}
 
-ec2_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
-ec2_listen_port = {{ nova_api_ec2_port }}
-
 use_neutron = True
 firewall_driver = nova.virt.firewall.NoopFirewallDriver
 
diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml
index 73489c402f..994c2f7c2b 100644
--- a/ansible/roles/prechecks/tasks/port_checks.yml
+++ b/ansible/roles/prechecks/tasks/port_checks.yml
@@ -255,22 +255,6 @@
     state: stopped
   when: inventory_hostname in groups['haproxy']
 
-- name: Checking free port for Nova API EC2
-  wait_for:
-    host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
-    port: "{{ nova_api_ec2_port }}"
-    connect_timeout: 1
-    state: stopped
-  when: inventory_hostname in groups['nova-api']
-
-- name: Checking free port for Nova API EC2 HAProxy
-  wait_for:
-    host: "{{ kolla_internal_vip_address }}"
-    port: "{{ nova_api_ec2_port }}"
-    connect_timeout: 1
-    state: stopped
-  when: inventory_hostname in groups['haproxy']
-
 - name: Checking free port for Nova Metadata
   wait_for:
     host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
-- 
GitLab