-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdeploy_partition.yaml
More file actions
174 lines (161 loc) · 6.03 KB
/
Copy pathdeploy_partition.yaml
File metadata and controls
174 lines (161 loc) · 6.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
- name: Configure leaves (Community SONiC)
hosts: leaves:!dell_sonic
any_errors_fatal: true
gather_facts: false
pre_tasks:
- name: Wait for system to become reachable
ansible.builtin.wait_for_connection:
delay: 10
timeout: 50
roles:
- name: ansible-common
- name: metal-roles/partition/roles/sonic-config
- name: sonic
post_tasks:
- name: Temporary workaround for EOL debian bullseye backports repository (using archive.debian.org)
lineinfile:
path: /etc/apt/sources.list
search_string: deb [arch=amd64] http://deb.debian.org/debian/ bullseye-backports main contrib non-free
line: deb [arch=amd64] http://archive.debian.org/debian/ bullseye-backports main contrib non-free
- name: Configure leaves (Enterprise SONiC)
hosts: dell_sonic
any_errors_fatal: true
handlers:
- name: reload systemd daemon
systemd:
daemon_reload: true
roles:
- name: dell-sonic
- name: Deploy dhcp server on leaf01 (Community SONiC)
hosts: leaf01:!dell_sonic
roles:
- name: ansible-common
tags: always
- name: metal-roles/partition/roles/dhcp
tags: dhcp
- name: Install python client and generate deployment token
hosts: localhost
connection: local
gather_facts: false
pre_tasks:
- name: Wait until the metal-apiserver is running
kubernetes.core.k8s_info:
kind: Deployment
name: metal-apiserver
namespace: "{{ metal_control_plane_namespace }}"
wait: true
wait_sleep: 1
wait_timeout: 600
- name: Wait until the admin_editor_token secret exists
kubernetes.core.k8s_info:
kind: Secret
name: "{{ metal_deployment_token_secret_name }}"
namespace: "{{ metal_deployment_token_secret_namespace }}"
wait: true
wait_sleep: 1
wait_timeout: 600
roles:
- name: ansible-common
- name: metal-roles/common/roles/metal-v2-client
- name: metal-roles/common/roles/metal-deployment-token
- name: Set deployment token for leaves
hosts: leaves
tasks:
- name: Set deployment token into leaf hostvars
set_fact:
metal_deployment_admin_token: "{{ hostvars['localhost']['metal_deployment_admin_token'] }}"
- name: Deploy mgmt-server components on leaf01
hosts: leaf01
roles:
- name: ansible-common
- name: metal-roles/partition/roles/pixiecore
- name: metal-roles/partition/roles/image-cache
when: deploy_partition_image_cache
- name: Deploy partition monitoring
import_playbook: deploy_partition_monitoring.yaml
# So, route propagation was broken in community sonic for a while now. Turns out
# during a change in upstream sonic some time in the end of 2024 sonic switched
# the module used for FRR->fpmsyncd communication, which does not provide a
# default connection endpoint. We just needed to add `fpm address 127.0.0.1`
# to the frr.conf template and could remove all route-propagation related
# workarounds
- name: Deploy metal-core (SONiC with dplane_fpm_sonic)
hosts: leaves:!dell_sonic
any_errors_fatal: true
become: true
pre_tasks:
- name: copy custom sonic_frr.tpl with fpm configured
ansible.builtin.copy:
dest: /sonic_frr.tpl
src: /mini-lab/files/sonic_frr_with_fpm.tpl
roles:
- name: ansible-common
tags: always
- name: metal-roles/partition/roles/metal-core
tags: metal-core
vars:
metal_core_frr_tpl_file: /sonic_frr.tpl
metal_core_additional_volume_mounts:
- /sonic_frr.tpl:/sonic_frr.tpl
- name: Deploy metal-core (Dell SONiC without dplane_fpm_sonic)
hosts: dell_sonic
any_errors_fatal: true
become: true
pre_tasks:
- name: Wait some time
pause:
seconds: 120
roles:
- name: ansible-common
tags: always
- name: metal-roles/partition/roles/metal-core
tags: metal-core
- name: Wait for switches
hosts: localhost
connection: local
gather_facts: false
roles:
- name: ansible-common
tags: always
- name: metal-roles
tags: always
- name: metal-ansible-modules
tags: always
- name: metal-roles/control-plane/roles/metal-python
tags: metal-python
post_tasks:
- name: Wait for switches to register
command: echo
changed_when: false
retries: 100
delay: 3
until:
- lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key) | length == 2
- lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key)[0]["last_sync"] != None
- lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key)[1]["last_sync"] != None
- name: Wait for underlay (Community SONiC)
hosts: leaves:!dell_sonic
any_errors_fatal: true
gather_facts: false
pre_tasks:
- name: Wait until no route entries have "queued"
include_tasks: tasks/check_queued.yaml
- name: Configure IPv6 and LLDP ports (Enterprise SONiC)
hosts: dell_sonic
any_errors_fatal: true
become: true
tasks:
- name: Enable IPv6 to also have LLA at VLAN interfaces
sysctl:
name: net.ipv6.conf.default.disable_ipv6
value: "0"
state: present
sysctl_file: /etc/sysctl.conf
- name: Configure LLDP port IDs and descriptions
ansible.builtin.command: "{{ item }}"
with_items:
- lldpcli configure ports Ethernet0 lldp portidsubtype local Eth1/1
- lldpcli configure ports Ethernet1 lldp portidsubtype local Eth1/2
- lldpcli configure ports Ethernet2 lldp portidsubtype local Eth1/3
- lldpcli configure ports Ethernet3 lldp portidsubtype local Eth1/4