-
Notifications
You must be signed in to change notification settings - Fork 1
/
rnode1.yml
90 lines (79 loc) · 3.33 KB
/
rnode1.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
---
- name: Explore
hosts: rnodes
become: yes
vars_files:
- priv/vault1.yml
tasks:
- name: ping
ping:
- name: Show hardware info
block:
- debug: msg="total RAM is {{ ansible_memory_mb.real.total }} MB"
- debug: var=ansible_mounts
- debug: var=ansible_processor_cores
- debug: var=ansible_processor
- name: Ensure sufficient RAM
fail: msg="not enough RAM - 32GB needed"
when: ansible_memory_mb.real.total < 32000
- name: Show OS info
block:
- debug: var=ansible_distribution
- debug: var=ansible_distribution_version
- name: Get packages
shell: dpkg-query -f '${binary:Package}\n' -W
register: packages
- name: Print packages
debug: var=packages.stdout_lines
# ack: https://github.com/do-community/ansible-playbooks/blob/master/docker_ubuntu1804/playbook.yml
# https://docs.docker.com/install/linux/docker-ce/debian/
- name: Update the apt package index
apt: update_cache=yes cache_valid_time=3600 upgrade=dist
- name: Install packages to allow apt to use a repository over HTTPS
apt: name={{ item }} state=latest update_cache=yes
with_items:
- apt-transport-https
- ca-certificates
- curl
- gnupg2
- software-properties-common
- python-pip
- name: "Add Docker’s official GPG key"
apt_key:
url: https://download.docker.com/linux/debian/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present
- name: Add Docker Repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
state: present
- name: Update apt and install docker-ce
apt: update_cache=yes name={{ item }} state=latest
with_items:
- docker-ce
- docker-ce-cli
- containerd.io
- name: Prune outdated Docker Module for Python
pip: name=docker-py state=absent
- name: Install Docker Module for Python
pip: name=docker
- name: Verify that Docker Engine - Community is installed correctly
block:
- docker_container: name=hello image="hello-world"
register: docker_hello
- debug: var=docker_hello.ansible_facts.docker_container.Created
- debug: var=docker_hello.ansible_facts.docker_container.Id
- debug: var=docker_hello.ansible_facts.docker_container.Image
- debug: var=docker_hello.ansible_facts.docker_container.State
# Feb 26 12:07 PM nuttzipper: the simplest way to start observer node using docker
# https://discordapp.com/channels/375365542359465989/682250097589092395/682287531756093460
- name: Start RChain rnode container
docker_container:
name: rnode
network_mode: host
volumes:
- /var/lib/rnode:/var/lib/rnode
image: "rchain/rnode:v0.9.22"
command: run --network mainnet --shard-id root --bootstrap "rnode://487e2c0c519b450b61253dea0a23b4d184a50089@node0.root-shard.mainnet.rchain.coop?protocol=40400&discovery=40404" --finalization-rate 1 --fault-tolerance-threshold -1 --synchrony-constraint-threshold 0 --fork-choice-stale-threshold 30minutes --fork-choice-check-if-stale-interval 30minutes --drop-peer-after-retries 0 --give-up-after-skipped 0
register: rnode_container
- debug: var=rnode_container