Merge branch 'main' into 'main'

add ganache fixes to nodejs and yarn. update requirements.yml, add two install...

See merge request shopglue/ziion-tools!1
This commit is contained in:
Bryan Black 2022-10-28 11:13:18 +00:00
commit 09f71a15ae
25 changed files with 223 additions and 1 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
ansible/roles/geerlingguy.docker/

View file

@ -13,4 +13,4 @@ crowdfunding page:
*** ***
## 1st Round: Primary Sponsors (400,000 SATS or more): ## 1st Round: Primary Sponsors (400,000 SATS or more):
Bryan Black (Website: https://bringyourwallet.com) Bryan Black (Website: https://example.com)

12
ansible/ansible.cfg Normal file
View file

@ -0,0 +1,12 @@
[defaults]
# some basic default values...
interpreter_python = auto
inventory = ./inventory/
roles_path = ./roles/
stdout_callback = default
#[ssh_connection]
#ssh_args=-o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r -o ForwardAgent=yes

5
ansible/inventory/hosts Normal file
View file

@ -0,0 +1,5 @@
[localhost]
127.0.0.1 ansible_connection=local
[vagrant]
10.0.0.159:3322 ansible_user=ziion

View file

@ -0,0 +1,20 @@
---
- hosts: vagrant
vars:
ziionos_user: ziion
bash_line: "export PATH=$PATH:$HOME/.local/bin" # pipx support for user install
bash_line_state: present
docker_users:
- ziion
become: true
roles:
- common
- geerlingguy.docker
- truffle
- solc
- solc-select
- brownie
- manticore
- mythril
- ganache
- remix

View file

@ -0,0 +1,9 @@
- name: Install python3-venv
become_user: root
become: true
apt:
state: present
update_cache: yes
cache_valid_time: 604800
pkg:
- python3-venv

View file

@ -0,0 +1,16 @@
- name: Install pipx package for brownie
become_user: "{{ ziionos_user }}"
ansible.builtin.pip:
name: pipx
extra_args: --user
- import_tasks: install-python3venv.yml
tags:
- install-python3venv
- name: pipx install eth-brownie
become_user: "{{ ziionos_user }}"
become: true
ansible.builtin.shell: "/home/{{ ziionos_user }}/.local/bin/pipx install eth-brownie==1.18.2"
args:
executable: /bin/bash

View file

@ -0,0 +1,6 @@
- name: Configure bashrc lines
lineinfile:
path: "/home/{{ ziionos_user }}/.bashrc"
line: "{{ bash_line }}"
state: "{{ bash_line_state |default('present') }}"
backup: yes

View file

@ -0,0 +1,40 @@
- name: Install curl
become_user: root
become: true
apt:
state: present
update_cache: yes
cache_valid_time: 604800
pkg:
- curl
- name: Remove nodejs
become_user: root
become: true
apt:
state: absent
update_cache: yes
cache_valid_time: 604800
pkg:
- nodejs
- name: add nodejs apt repository
become_user: root
become: true
ansible.builtin.shell: "curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - "
- name: Install nodejs
become_user: root
become: true
apt:
state: present
update_cache: yes
cache_valid_time: 604800
pkg:
- nodejs
- name:
become_user: root
become: true
ansible.builtin.shell: "corepack enable"

View file

@ -0,0 +1,9 @@
- name: Install pip3
become_user: root
become: true
apt:
state: present
update_cache: yes
cache_valid_time: 604800
pkg:
- python3-pip

View file

@ -0,0 +1,12 @@
---
- import_tasks: install-node.yml
tags:
- install-node
- import_tasks: install-pip.yml
tags:
- install-pip
- import_tasks: install-bashrc.yml
tags:
- install-bashrc

View file

@ -0,0 +1,8 @@
- name: Create ganache
community.docker.docker_container:
name: ganache
image: trufflesuite/ganache:v7.1.0
state: started
restart: true
ports:
- "127.0.0.1:8545:8545" # discuss if this should be bind all gitlab.com/reel/ziion-tools/-/issues/4

View file

@ -0,0 +1,7 @@
- name: Install ganache
community.general.npm:
name: ganache
version: '7.1.0'
path: /usr/local/ganache
global: true
state: present

View file

@ -0,0 +1,7 @@
---
#- import_tasks: install-via-npm.yml
# tags: install-via-npm
- import_tasks: install-via-docker.yml
tags: install-via-docker

View file

@ -0,0 +1,6 @@
- name: Create manticore
community.docker.docker_container:
name: manticore
image: trailofbits/manticore:0.3.7
state: started
restart: true

View file

@ -0,0 +1,4 @@
- name: Install manticore python package
ansible.builtin.pip:
name: manticore==0.3.7
state: present

View file

@ -0,0 +1,6 @@
---
#- import_tasks: install-via-pip.yml
# tags: install-via-pip
- import_tasks: install-via-docker.yml
tags: install-via-docker

View file

@ -0,0 +1,6 @@
- name: Create mythril
community.docker.docker_container:
name: manticore
image: mythril/myth:0.23.1
state: started
restart: true

View file

@ -0,0 +1,4 @@
- name: Install mythril python package
ansible.builtin.pip:
name: mythril==0.23.1
state: present

View file

@ -0,0 +1,9 @@
---
#- import_tasks: install-via-pip.yml
# tags: install-via-pip
# UNTESTED
- import_tasks: install-via-docker.yml
tags: install-via-docker

View file

@ -0,0 +1,9 @@
- name: Create remix-ide
community.docker.docker_container:
name: remix-ide
image: remixproject/remix-ide
state: started
restart: true
ports:
# Publish container port 80 as host port 8080
- "127.0.0.1:8080:80"

View file

@ -0,0 +1,8 @@
---
# ansible-galaxy install -r roles/requirements.yml
collections:
- community.docker
- src: geerlingguy.docker
name: geerlingguy.docker

View file

@ -0,0 +1,4 @@
- name: Install solc-select python package
ansible.builtin.pip:
name: solc-select
# name: solc-select==1.0.1

View file

@ -0,0 +1,7 @@
- name: Install solc-js
community.general.npm:
name: solc
version: '0.8.14-fixed'
path: /usr/local/solc
global: true
state: present

View file

@ -0,0 +1,7 @@
- name: Install truffle
community.general.npm:
name: truffle
version: '5.5.14'
path: /usr/local/truffle
global: true
state: present