-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathmovement-full-follower.yml
105 lines (87 loc) · 3.15 KB
/
movement-full-follower.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
---
- name: Install requirements and the Movement Node
hosts: all
become: true
remote_user: "{{ user }}"
gather_facts: false
vars:
repo_url: "https://github.com/movementlabsxyz/movement"
destination_path: "/home/{{ user }}/movement"
movement_sync: "follower::mtnet-l-sync-bucket-sync<=>{maptos,maptos-storage,movement-da-db}/**"
chain_id: "250"
movement_da_light_node_connection_protocol: "https"
movement_da_light_node_connection_hostname: "movement-celestia-da-light-node.testnet.bardock.movementlabs.xyz"
movement_da_light_node_connection_port: "443"
aws_region: "us-west-1"
rev: "{{ movement_container_version }}"
tasks:
- debug:
msg: "MOVEMENT_SYNC: {{ movement_sync }}"
- name: Install required packages
ansible.builtin.apt:
name:
- curl
- xz-utils
- git
- nginx
- python3-pip
state: present
update_cache: yes
- name: Clone the appropriate application version
git:
repo: "{{ repo_url }}"
dest: "{{ destination_path }}"
version: "{{ movement_container_version }}"
clone: yes
update: yes
force: true
become: no # Run git clone as the ansible user or specify a different user
- name: Install Docker
shell: curl -fsSL https://get.docker.com | bash
- name: Enable Docker service
ansible.builtin.systemd:
name: docker
enabled: yes
state: started
- name: Add user to Docker group
ansible.builtin.user:
name: "{{ user }}"
groups: docker
append: yes
- name: Install Docker Compose
ansible.builtin.shell: curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
- name: Install OpenSSL and CA certificates
ansible.builtin.package:
name:
- openssl
- ca-certificates
state: present
- name: Update CA certificates
ansible.builtin.shell: update-ca-certificates
- name: Create movement env file and add the container version
ansible.builtin.lineinfile:
path: "/home/{{ user }}/movement/.env"
line: "REV={{ movement_container_version }}"
create: yes
- name: Make sure that the movement config dir exists
ansible.builtin.file:
path: "/home/{{ user }}/.movement"
state: directory
owner: "{{ user }}"
group: "{{ user }}"
- name: Create movement-full-node systemd service
ansible.builtin.template:
src: "./movement-full-follower.service.j2"
dest: /etc/systemd/system/movement-full-follower.service
- name: Stop the movement-full-node service if running
ansible.builtin.systemd:
name: movement-full-follower
state: stopped
enabled: no
- name: Reload systemd to apply changes
ansible.builtin.command: systemctl daemon-reload
- name: Enable and start the movement-full-node service
ansible.builtin.systemd:
name: movement-full-follower
enabled: yes
state: started