Bump dojo version and some minor cleanup.

This commit is contained in:
Brian Lee 2023-10-20 10:30:25 -07:00
parent 3c05eb1caa
commit 281c52363a
4 changed files with 11 additions and 12 deletions

View File

@ -1,5 +1,5 @@
--- ---
samourai_dojo_version: "1.20.0" samourai_dojo_version: "1.21.0"
samourai_dojo_onion_service: "{{ lookup('ansible.builtin.env', 'SAMOURAI_DOJO_ONION') | default('_') }}" samourai_dojo_onion_service: "{{ lookup('ansible.builtin.env', 'SAMOURAI_DOJO_ONION') | default('_') }}"
samourai_dojo_onion_port: 80 samourai_dojo_onion_port: 80
samourai_dojo_onion_path: data-tor samourai_dojo_onion_path: data-tor

View File

@ -5,7 +5,7 @@
- ansible_user_id != 'root' - ansible_user_id != 'root'
fail_msg: "Podman containers are rootless, so please do not run this role as root." fail_msg: "Podman containers are rootless, so please do not run this role as root."
- name: Dojo | Assert all secrets have been defined. - name: Assert all secrets have been defined.
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- item is defined - item is defined

View File

@ -1,6 +1,6 @@
--- ---
# https://code.samourai.io/dojo/samourai-dojo/-/blob/develop/docker/my-dojo/docker-compose.yaml # https://code.samourai.io/dojo/samourai-dojo/-/blob/develop/docker/my-dojo/docker-compose.yaml
- name: Dojo | Build image - name: Build image
register: podman_image_output register: podman_image_output
containers.podman.podman_image: containers.podman.podman_image:
name: samourai-dojo name: samourai-dojo
@ -10,21 +10,20 @@
pull: false pull: false
state: build state: build
build: build:
# format: oci
file: ~/src/samourai-dojo/docker/my-dojo/node/Dockerfile file: ~/src/samourai-dojo/docker/my-dojo/node/Dockerfile
extra_args: "--build-arg TOR_LINUX_GID=1107" extra_args: "--build-arg TOR_LINUX_GID=1107"
- ansible.builtin.debug: - ansible.builtin.debug:
var: podman_image_output var: podman_image_output
- name: Dojo | Create volumes - name: Create volumes
containers.podman.podman_volume: containers.podman.podman_volume:
state: present state: present
name: "{{ samourai_dojo_onion_path }}" name: "{{ samourai_dojo_onion_path }}"
recreate: no recreate: no
when: not samourai_dojo_onion_path.startswith('/') when: not samourai_dojo_onion_path.startswith('/')
- name: Dojo | Create container - name: Create container
register: podman_container_output register: podman_container_output
containers.podman.podman_container: containers.podman.podman_container:
debug: no debug: no

View File

@ -1,5 +1,5 @@
--- ---
- name: Dojo | Clone repository - name: Clone repository
ansible.builtin.git: ansible.builtin.git:
repo: 'https://code.samourai.io/dojo/samourai-dojo.git' repo: 'https://code.samourai.io/dojo/samourai-dojo.git'
dest: ~/src/samourai-dojo dest: ~/src/samourai-dojo
@ -8,7 +8,7 @@
tags: upgrade tags: upgrade
# install/install-scripts.sh # install/install-scripts.sh
- name: Dojo | Check whether the database has been initialized - name: Check whether the database has been initialized
community.mysql.mysql_info: community.mysql.mysql_info:
filter: filter:
- databases - databases
@ -17,7 +17,7 @@
login_password: "{{ samourai_dojo_config.MYSQL_PASSWORD }}" login_password: "{{ samourai_dojo_config.MYSQL_PASSWORD }}"
register: databases register: databases
- name: Dojo | Initialize database - name: Initialize database
community.mysql.mysql_db: community.mysql.mysql_db:
name: samourai name: samourai
state: import state: import
@ -26,20 +26,20 @@
login_password: "{{ samourai_dojo_config.MYSQL_PASSWORD }}" login_password: "{{ samourai_dojo_config.MYSQL_PASSWORD }}"
when: databases.databases.samourai.size == 0 when: databases.databases.samourai.size == 0
- name: Dojo | Initialize the maintenace tool - name: Initialize the maintenace tool
ansible.builtin.copy: ansible.builtin.copy:
remote_src: yes remote_src: yes
src: "~/src/samourai-dojo/static/admin/conf/index-{{ samourai_dojo_config.COMMON_BTC_NETWORK }}.js" src: "~/src/samourai-dojo/static/admin/conf/index-{{ samourai_dojo_config.COMMON_BTC_NETWORK }}.js"
dest: ~/src/samourai-dojo/static/admin/conf/index.js dest: ~/src/samourai-dojo/static/admin/conf/index.js
- block: - block:
- name: Dojo | Ensure onoion services directory exists - name: Ensure the onion services directory exists
ansible.builtin.file: ansible.builtin.file:
path: "{{ samourai_dojo_onion_path }}" path: "{{ samourai_dojo_onion_path }}"
state: directory state: directory
mode: '0755' mode: '0755'
- name: Dojo | Write the hostname to a file in the samourai_dojo_onion_path - name: Write the hostname to a file in the samourai_dojo_onion_path
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: "{{ samourai_dojo_onion_path }}/hostname" path: "{{ samourai_dojo_onion_path }}/hostname"
line: "{{ samourai_dojo_onion_service }}" line: "{{ samourai_dojo_onion_service }}"