-
Notifications
You must be signed in to change notification settings - Fork 4
/
update-ocluster.yml
139 lines (119 loc) · 3.73 KB
/
update-ocluster.yml
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
---
- hosts: all
serial: 2
tasks:
- name: Check architecture intel
set_fact: homebrew_prefix="/usr/local"
when: ansible_architecture == "x86_64"
- name: Check architecture arm
set_fact: homebrew_prefix="/opt/homebrew"
when: ansible_architecture == "arm64"
- debug:
var: homebrew_prefix
- name: Pause the worker
shell: ci3-admin pause --wait macos-{{ ansible_architecture }} {{ inventory_hostname_short }}
delegate_to: 127.0.0.1
- name: Stop ocluster via launchctl
shell: launchctl unload /Library/LaunchDaemons/com.tarides.ocluster.worker.plist
become: yes
register: launchctl_check
failed_when: not ( launchctl_check.rc == 134 or launchctl_check.rc == 0 )
- name: Destroy ZFS pool
shell: "{{ ansible_env.HOME }}/zfs/bin/zpool destroy -f obuilder"
become: yes
- name: Create new pool
shell: "{{ ansible_env.HOME }}/zfs/bin/zpool create -f obuilder {{ zfs_partition }}"
become: yes
- name: Set defaults
shell: "{{ ansible_env.HOME }}/zfs/bin/zfs {{ item }}"
become: yes
with_items:
- set atime=off obuilder
- set checksum=off obuilder
- set compression=off obuilder
- name: Remove /var/lib/ocluster-worker
become: yes
file:
state: absent
path: /var/lib/ocluster-worker
- name: Install roles macos
import_role:
name: macos
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Install base-image for 4.14.2
import_role:
name: base-image
vars:
version: 4.14.2
user_name: mac1000
zfs_pool: obuilder
default: false
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Install base-image for 5.0.0
import_role:
name: base-image
vars:
version: 5.0.0
user_name: mac1000
zfs_pool: obuilder
default: false
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Install base-image for 5.1.1
import_role:
name: base-image
vars:
version: 5.1.1
user_name: mac1000
zfs_pool: obuilder
default: false
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Install base-image for 5.2.0
import_role:
name: base-image
vars:
version: 5.2.0
user_name: mac1000
zfs_pool: obuilder
default: true
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Install base-image for 5.3.0~alpha1
import_role:
name: base-image
vars:
version: 5.3.0~alpha1
user_name: mac1000
zfs_pool: obuilder
default: false
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Install base-image for 5.4.0
import_role:
name: base-image
vars:
version: 5.4.0+trunk
user_name: mac1000
zfs_pool: obuilder
default: false
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Install busybox
import_role:
name: busybox
vars:
user_name: mac1000
zfs_pool: obuilder
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Ocluster
import_role:
name: ocluster
environment:
PATH: '{{ ansible_env.HOME }}/zfs/bin:{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Unpause the worker
shell: ci3-admin unpause macos-{{ ansible_architecture }} {{ inventory_hostname_short }}
delegate_to: 127.0.0.1