Skip to content

Commit c98f035

Browse files
v1
1 parent f0341ef commit c98f035

File tree

19 files changed

+388
-1
lines changed

19 files changed

+388
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inventory.yaml
2+
inventory_testnet.yaml

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
# aptos-operator
1+
# Aptos Node Operator Ansible Scripts
2+
3+
## Design Philosophy
4+
5+
1. Cover scenarios with multiple playbooks (initial setup, node upgrade, validator migration, etc)
6+
2. Support both testnet and mainnet
7+
3. Support both validator and validator fullnode
8+
4. Will support public fullnode at a later date
9+
10+
## TL/DR
11+
12+
Once all set, you run one playbook to do a task, such as:
13+
14+
```bash
15+
ansible-playbook main.yml -e "target=validator_mainnet"
16+
```
17+
18+
The target can be:
19+
20+
- validator_mainnet
21+
- fullnode_mainnet
22+
- validator_testnet
23+
- fullnode_testnet
24+
25+
## Set up your own inventory file
26+
27+
First create your own inventory file by copying the sample one. Then you customize the file with your own.
28+
29+
```bash
30+
cp inventory.sample.yaml inventory.yaml
31+
```
32+
33+
## Playbooks
34+
35+
| Playbook | Description |
36+
| ------------------ | -------------------------------------------- |
37+
| `main.yml` | Set up a new node |
38+
| `main_upgrade.yml` | Upgrade the node version and restart service |
39+
40+
## Limitation
41+
42+
These playbooks do not touch any key files. We already do it manually. We think you should too.

ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[defaults]
2+
inventory=inventory.yaml

group_vars/all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
aptos_repo: https://github.com/aptos-labs/aptos-core
2+
prometheus_port: 9101

group_vars/fullnode.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
p2p_port: '6182'

group_vars/mainnet.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
aptos_version: 'a059b3d6965c63d124da09db83eed4f1221c6896'
2+
waypoint: https://raw.githubusercontent.com/aptos-labs/aptos-genesis-waypoint/main/premainnet/waypoint.txt
3+
genesis: https://github.com/aptos-labs/aptos-genesis-waypoint/blob/main/premainnet/genesis.blob?raw=true

group_vars/testnet.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aptos_version: 'a059b3d6965c63d124da09db83eed4f1221c6896'

group_vars/validator.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
p2p_port: '6180'

inventory.sample.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
all:
3+
hosts:
4+
validator_mainnet:
5+
ansible_host: 10.0.0.1
6+
node_type: validator
7+
network: mainnet
8+
fullnode_ip: 10.0.0.2
9+
fullnode_mainnet:
10+
ansible_host: 10.0.0.2
11+
node_type: fullnode
12+
network: mainnet
13+
validator_ip: 10.0.0.1
14+
validator_testnet:
15+
ansible_host: 10.0.0.3
16+
node_type: validator
17+
network: testnet
18+
fullnode_ip: 10.0.0.4
19+
fullnode_testnet:
20+
ansible_host: 10.0.0.4
21+
node_type: fullnode
22+
network: testnet
23+
validator_ip: 10.0.0.3
24+
vars:
25+
ansible_user: ubuntu
26+
ansible_port: 22
27+
ansible_ssh_private_key_file: '~/.ssh/id_rsa'
28+
user_dir: "/home/{{ ansible_user }}"
29+
path: "/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/go/bin:{{ user_dir }}/.cargo/bin"
30+
aptos_directory: "{{ user_dir }}/aptos"
31+
config_directory: "{{ user_dir }}/{{ network }}"
32+
network_varfile: "group_vars/{{ network }}.yml"
33+
node_type_varfile: "group_vars/{{ node_type }}.yml"
34+
monitor_ip: "10.0.0.100"

main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: Install
3+
hosts: '{{ target }}'
4+
gather_facts: false
5+
vars_files:
6+
- "{{ network_varfile }}"
7+
- "{{ node_type_varfile }}"
8+
roles:
9+
# - aptos_install
10+
# - aptos_configure
11+
- aptos_launch

0 commit comments

Comments
 (0)