summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2018-09-27 15:45:52 -0400
committerDan Radez <dradez@redhat.com>2018-09-27 15:47:25 -0400
commitb68bb4c6dfad74e9640e511a226457126dbc459d (patch)
tree2225439853c7a49e104093e1c551d306088df654
parent8362fa3ebd7da716523ac6be8727c7b5cce1feeb (diff)
Updating the eos role
- force connection type network_cli - force become via enable Change-Id: I4ed240fae8e5271f5fc5c61f8d55047060ab6cf6
Notes
Notes (review): Code-Review+2: Dan Radez <dradez@redhat.com> Workflow+1: Dan Radez <dradez@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 05 Oct 2018 14:45:47 +0000 Reviewed-on: https://review.openstack.org/605853 Project: openstack/networking-ansible Branch: refs/heads/master
-rw-r--r--etc/ansible/roles/openstack-ml2/providers/eos/create_network.yaml3
-rw-r--r--etc/ansible/roles/openstack-ml2/providers/eos/delete_network.yaml3
-rw-r--r--etc/ansible/roles/openstack-ml2/providers/eos/delete_port.yaml9
-rw-r--r--etc/ansible/roles/openstack-ml2/providers/eos/update_port.yaml9
4 files changed, 22 insertions, 2 deletions
diff --git a/etc/ansible/roles/openstack-ml2/providers/eos/create_network.yaml b/etc/ansible/roles/openstack-ml2/providers/eos/create_network.yaml
index 959fcde..54bf1fd 100644
--- a/etc/ansible/roles/openstack-ml2/providers/eos/create_network.yaml
+++ b/etc/ansible/roles/openstack-ml2/providers/eos/create_network.yaml
@@ -6,4 +6,5 @@
6 parents: 6 parents:
7 - "vlan {{ ml2_segmentation_id }}" 7 - "vlan {{ ml2_segmentation_id }}"
8 connection: network_cli 8 connection: network_cli
9 9 become: True
10 become_method: 'enable'
diff --git a/etc/ansible/roles/openstack-ml2/providers/eos/delete_network.yaml b/etc/ansible/roles/openstack-ml2/providers/eos/delete_network.yaml
index f23f948..516ccae 100644
--- a/etc/ansible/roles/openstack-ml2/providers/eos/delete_network.yaml
+++ b/etc/ansible/roles/openstack-ml2/providers/eos/delete_network.yaml
@@ -3,4 +3,5 @@
3 eos_config: 3 eos_config:
4 lines: "no vlan {{ ml2_segmentation_id }}" 4 lines: "no vlan {{ ml2_segmentation_id }}"
5 connection: network_cli 5 connection: network_cli
6 6 become: True
7 become_method: 'enable'
diff --git a/etc/ansible/roles/openstack-ml2/providers/eos/delete_port.yaml b/etc/ansible/roles/openstack-ml2/providers/eos/delete_port.yaml
index fab5c1a..d87052e 100644
--- a/etc/ansible/roles/openstack-ml2/providers/eos/delete_port.yaml
+++ b/etc/ansible/roles/openstack-ml2/providers/eos/delete_port.yaml
@@ -3,6 +3,9 @@
3 eos_command: 3 eos_command:
4 commands: "show interfaces | json" 4 commands: "show interfaces | json"
5 register: output 5 register: output
6 connection: network_cli
7 become: True
8 become_method: 'enable'
6 9
7- name: "eos: verify port exists" 10- name: "eos: verify port exists"
8 fail: 11 fail:
@@ -12,8 +15,14 @@
12- name: "eos: remove port configuration" 15- name: "eos: remove port configuration"
13 eos_config: 16 eos_config:
14 lines: "default interface {{ ml2_port_name }}" 17 lines: "default interface {{ ml2_port_name }}"
18 connection: network_cli
19 become: True
20 become_method: 'enable'
15 21
16- name: "eos: administratively disable the port" 22- name: "eos: administratively disable the port"
17 eos_config: 23 eos_config:
18 lines: "shutdown" 24 lines: "shutdown"
19 parents: ["interface {{ ml2_port_name }}"] 25 parents: ["interface {{ ml2_port_name }}"]
26 connection: network_cli
27 become: True
28 become_method: 'enable'
diff --git a/etc/ansible/roles/openstack-ml2/providers/eos/update_port.yaml b/etc/ansible/roles/openstack-ml2/providers/eos/update_port.yaml
index 546c349..604b2f9 100644
--- a/etc/ansible/roles/openstack-ml2/providers/eos/update_port.yaml
+++ b/etc/ansible/roles/openstack-ml2/providers/eos/update_port.yaml
@@ -6,6 +6,9 @@
6 - "show interface {{ ml2_port_name }} | json" 6 - "show interface {{ ml2_port_name }} | json"
7 - "show running-config" 7 - "show running-config"
8 register: output 8 register: output
9 connection: network_cli
10 become: True
11 become_method: 'enable'
9 12
10- name: "eos: set port facts" 13- name: "eos: set port facts"
11 set_fact: 14 set_fact:
@@ -29,6 +32,9 @@
29 - "interface {{ ml2_port_name }}" 32 - "interface {{ ml2_port_name }}"
30 running_config: "{{ output.stdout[2] }}" 33 running_config: "{{ output.stdout[2] }}"
31 when: not switchport.enabled 34 when: not switchport.enabled
35 connection: network_cli
36 become: True
37 become_method: 'enable'
32 38
33- name: "eos: port is configured as switchport" 39- name: "eos: port is configured as switchport"
34 block: 40 block:
@@ -52,3 +58,6 @@
52 parents: ["interface {{ ml2_port_name }}"] 58 parents: ["interface {{ ml2_port_name }}"]
53 when: interface.interfaceStatus == 'disabled' 59 when: interface.interfaceStatus == 'disabled'
54 when: switchport.enabled 60 when: switchport.enabled
61 connection: network_cli
62 become: True
63 become_method: 'enable'