Browse Source

Updating the eos role

- force connection type network_cli
- force become via enable

Change-Id: I4ed240fae8e5271f5fc5c61f8d55047060ab6cf6
changes/53/605853/1
Dan Radez 8 months ago
parent
commit
b68bb4c6df

+ 2
- 1
etc/ansible/roles/openstack-ml2/providers/eos/create_network.yaml View File

@@ -6,4 +6,5 @@
6 6
     parents:
7 7
       - "vlan {{ ml2_segmentation_id }}"
8 8
   connection: network_cli
9
-
9
+  become: True
10
+  become_method: 'enable'

+ 2
- 1
etc/ansible/roles/openstack-ml2/providers/eos/delete_network.yaml View File

@@ -3,4 +3,5 @@
3 3
   eos_config:
4 4
     lines: "no vlan {{ ml2_segmentation_id }}"
5 5
   connection: network_cli
6
-
6
+  become: True
7
+  become_method: 'enable'

+ 9
- 0
etc/ansible/roles/openstack-ml2/providers/eos/delete_port.yaml View File

@@ -3,6 +3,9 @@
3 3
   eos_command:
4 4
     commands: "show interfaces | json"
5 5
   register: output
6
+  connection: network_cli
7
+  become: True
8
+  become_method: 'enable'
6 9
 
7 10
 - name: "eos: verify port exists"
8 11
   fail:
@@ -12,8 +15,14 @@
12 15
 - name: "eos: remove port configuration"
13 16
   eos_config:
14 17
     lines: "default interface {{ ml2_port_name }}"
18
+  connection: network_cli
19
+  become: True
20
+  become_method: 'enable'
15 21
 
16 22
 - name: "eos: administratively disable the port"
17 23
   eos_config:
18 24
     lines: "shutdown"
19 25
     parents: ["interface {{ ml2_port_name }}"]
26
+  connection: network_cli
27
+  become: True
28
+  become_method: 'enable'

+ 9
- 0
etc/ansible/roles/openstack-ml2/providers/eos/update_port.yaml View File

@@ -6,6 +6,9 @@
6 6
       - "show interface {{ ml2_port_name }} | json"
7 7
       - "show running-config"
8 8
   register: output
9
+  connection: network_cli
10
+  become: True
11
+  become_method: 'enable'
9 12
 
10 13
 - name: "eos: set port facts"
11 14
   set_fact:
@@ -29,6 +32,9 @@
29 32
           - "interface {{ ml2_port_name }}"
30 33
         running_config: "{{ output.stdout[2] }}"
31 34
   when: not switchport.enabled
35
+  connection: network_cli
36
+  become: True
37
+  become_method: 'enable'
32 38
 
33 39
 - name: "eos: port is configured as switchport"
34 40
   block:
@@ -52,3 +58,6 @@
52 58
         parents: ["interface {{ ml2_port_name }}"]
53 59
       when: interface.interfaceStatus == 'disabled'
54 60
   when: switchport.enabled
61
+  connection: network_cli
62
+  become: True
63
+  become_method: 'enable'

Loading…
Cancel
Save