-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflush-rsync.yml
100 lines (80 loc) · 2.45 KB
/
flush-rsync.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
---
- hosts: all
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
- hosts: all
serial: 1
tasks:
- name: Pause the worker
shell: ci3-admin pause --wait macos-{{ ansible_architecture }} {{ inventory_hostname_short }}
delegate_to: 127.0.0.1
- name: Stop the ocluster service
shell: launchctl unload {{ ansible_env.HOME}}/Library/LaunchAgents/com.tarides.ocluster.worker.plist
- name: Unmount {{ homebrew_prefix }} if it is mounted
become: yes
mount:
path: "{{ homebrew_prefix }}"
state: unmounted
- name: Remove state dir
become: yes
file:
state: absent
path: /var/lib/ocluster-worker
- name: Remove ocluster.log
file:
state: absent
path: "{{ ansible_env.HOME }}/ocluster.log"
- name: Remove ocluster
file:
state: absent
path: "{{ ansible_env.HOME }}/ocluster"
- name: Remove opam
file:
state: absent
path: "{{ ansible_env.HOME }}/.opam"
- name: Create empty folder
file:
state: directory
path: /tmp/obuilder-empty
- name: Use rsync to delete everything in /Volumes/rsync/
shell: rsync -aHq --delete /tmp/obuilder-empty/ /Volumes/rsync/
become: yes
- name: Install Opam
import_role:
name: ocaml
environment:
PATH: '{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
# - name: Create base image 4.14.1
# import_role:
# name: base-image
# vars:
# version: "4.14.1"
# user_name: "mac1000"
# environment:
# PATH: '{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
# - name: Create base image 5.0.0
# import_role:
# name: base-image
# vars:
# version: "5.0.0"
# user_name: "mac1000"
# environment:
# PATH: '{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
- name: Update OCluster
import_role:
name: ocluster
environment:
PATH: '{{ homebrew_prefix }}/bin:{{ ansible_env.PATH }}'
# the service is started above ocluster role
# - name: Start ocluster service
# shell: launchctl load {{ ansible_env.HOME}}/Library/LaunchAgents/com.tarides.ocluster.worker.plist
- name: Unpause the worker
shell: ci3-admin unpause macos-{{ ansible_architecture }} {{ inventory_hostname_short }}
delegate_to: 127.0.0.1