-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdeploy_partition.yaml
94 lines (88 loc) · 3.92 KB
/
deploy_partition.yaml
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
---
- name: Configure SONiC switches
hosts: leaves:&sonic
gather_facts: no
pre_tasks:
- name: Wait for system to become reachable
ansible.builtin.wait_for_connection:
delay: 10
timeout: 50
roles:
- name: ansible-common
tags: always
- name: metal-roles/partition/roles/sonic
tags: sonic
- name: sonic
tags: sonic
- name: Configure Cumulus switches
hosts: leaves:&cumulus
pre_tasks:
# the following task is not required as long as we do not install something from the cumulus repositories, for which all the keys are expired now
# the one from here has also expired on 9th Apr 2024: https://docs.nvidia.com/networking-ethernet-software/knowledge-base/Installing-and-Upgrading/Upgrading/Update-Expired-GPG-Keys/#package-upgrade-from-cumulus-linux-37x-to-3716
# - name: update cumulus repo key
# apt_key:
# url: http://repo3.cumulusnetworks.com/public-key/repo3-2023-key
# validate_certs: false
# state: present
- name: unpack jessie fixes
command: tar xf /root/jessie-apt-transport-fix.tar.gz
- name: install apt-transport
shell: dpkg -i /root/https-deps/*.deb && apt-get install -fy
- name: use own repo mirrors (old ones are 404)
copy:
dest: /etc/apt/sources.list
content: |
deb https://cumulus-3.apt.metal-stack.io/cumulus CumulusLinux-3 main
deb-src https://cumulus-3.apt.metal-stack.io/cumulus CumulusLinux-3 main
deb https://cumulus-3.apt.metal-stack.io/cumulus-updates CumulusLinux-3-updates main
deb-src https://cumulus-3.apt.metal-stack.io/cumulus-updates CumulusLinux-3-updates main
deb https://cumulus-3.apt.metal-stack.io/cumulus-security-updates CumulusLinux-3-security-updates main
deb-src https://cumulus-3.apt.metal-stack.io/cumulus-security-updates CumulusLinux-3-security-updates main
- name: set resolv.conf
shell: rm /etc/resolv.conf && echo 'nameserver 8.8.8.8' > /etc/resolv.conf
- name: use own repo key
shell: curl -fsSL https://cumulus-3.apt.metal-stack.io/cumulus-3-repo.gpg | apt-key add -
roles:
- name: cumulus
tags: cumulus
- name: metal-roles/partition/roles/docker-on-cumulus
tags: docker-on-cumulus
- name: Deploy dhcp server and pixiecore on leaf01
hosts: leaf01
roles:
- name: ansible-common
tags: always
- name: metal-roles/partition/roles/dhcp
tags: dhcp
- name: metal-roles/partition/roles/pixiecore
tags: pixiecore
- name: Deploy metal-core
hosts: leaves
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: no
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: 60
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