added aliases for pmls / pmlsa

added basic rtl container (not configured yet)
This commit is contained in:
b0xxer 2024-02-15 07:56:39 -06:00
parent eb66313924
commit 36a67e91c0
10 changed files with 91 additions and 12 deletions

3
hosts
View File

@ -22,7 +22,7 @@ zerotier_network=
[n0xb0x:vars] [n0xb0x:vars]
hostname=n0xb0x hostname=n0xb0x
app_list=['bitcoin.yml','electrs.yml','clightning.yml','docs.yml'] app_list=['bitcoin.yml','electrs.yml','clightning.yml','rtl.yml', 'docs.yml']
ansible_user=n0xb0x ansible_user=n0xb0x
ansible_password=n0xb0x ansible_password=n0xb0x
#registry_url=git.boxxy.net/b0xxer/ #registry_url=git.boxxy.net/b0xxer/
@ -36,6 +36,7 @@ bitcoin_rpcuser=n0xb0x
bitcoin_rpcpassword=8BaOf-luoLM-5zA8V0ozLOtqzZZch2knK9gWIBfafDw bitcoin_rpcpassword=8BaOf-luoLM-5zA8V0ozLOtqzZZch2knK9gWIBfafDw
bitcoin_rpcauth=n0xb0x:413f1f82906117464e662853bce33577$80a039d800184a1cffd1de5468b5b2a7442ab1d368a13782e5283e575a9f57b2 bitcoin_rpcauth=n0xb0x:413f1f82906117464e662853bce33577$80a039d800184a1cffd1de5468b5b2a7442ab1d368a13782e5283e575a9f57b2
electrs_version=0.10.2 electrs_version=0.10.2
rtl_version=0.15.0
zerotier_network= zerotier_network=
#Update wariness - 1 = very reluctant to update, 0 = eager to update #Update wariness - 1 = very reluctant to update, 0 = eager to update
#timezone - which timezone update schedule is in #timezone - which timezone update schedule is in

View File

@ -22,6 +22,11 @@
chdir: ~/Containers/clightning chdir: ~/Containers/clightning
cmd: ./build.sh cmd: ./build.sh
- name: rebuild_rtl
ansible.builtin.shell:
chdir: ~/Containers/rtl
cmd: ./build.sh
- name: rebuild_docs - name: rebuild_docs
ansible.builtin.shell: ansible.builtin.shell:
chdir: ~/Containers/docs chdir: ~/Containers/docs

View File

@ -57,6 +57,7 @@
- "8333:8333" - "8333:8333"
- "9735:9735" - "9735:9735"
- "3010:3010" - "3010:3010"
- "3000:3000"
tags: [apps,bitcoin] tags: [apps,bitcoin]
- name: bitcoin - Create bitcoin data / conf directory - name: bitcoin - Create bitcoin data / conf directory

View File

@ -8,4 +8,5 @@
file: "{{ item }}" file: "{{ item }}"
with_items: with_items:
- "{{ app_list }}" - "{{ app_list }}"
tags: apps

31
roles/apps/tasks/rtl.yml Normal file
View File

@ -0,0 +1,31 @@
- name: rtl - Create Containers/rtl Dir
ansible.builtin.file:
path: ~/Containers/rtl
recurse: true
state: directory
notify: rebuild_rtl
tags: [apps,rtl]
- name: rtl - Copy Containerfile Template
ansible.builtin.template:
src: rtl/Containerfile.j2
dest: ~/Containers/rtl/Containerfile
notify: rebuild_rtl
tags: [apps,rtl]
- name: rtl - Copy Containerfile build.sh
ansible.builtin.template:
src: rtl/build.sh.j2
dest: ~/Containers/rtl/build.sh
mode: '0700'
notify: rebuild_rtl
tags: [apps,rtl]
- name: rtl - Copy rtl-node.container file
ansible.builtin.template:
src: rtl/rtl-node.container.j2
dest: /home/{{ ansible_user }}/.config/containers/systemd/rtl-node.container
notify: reload_systemctl
tags: [apps,rtl]

View File

@ -1,5 +1,6 @@
[Unit] [Unit]
Description=Bitcoin Node Description=Bitcoin Node
Before=electrs-node.service clightning-node.service rtl-node.service
[Container] [Container]
# Use the centos image # Use the centos image

View File

@ -2,19 +2,18 @@
# --------------- # ---------------
FROM docker.io/almalinux/9-base as builder FROM docker.io/almalinux/9-base as builder
RUN dnf update -y && dnf module -y enable nodejs:18 && dnf install -y nodejs
WORKDIR /RTL WORKDIR /RTL
COPY package.json /RTL/package.json RUN dnf update -y \
COPY package-lock.json /RTL/package-lock.json && dnf module -y enable nodejs:18 \
&& dnf install -y nodejs git \
RUN npm install && git clone https://github.com/Ride-The-Lightning/RTL.git . \
&& git checkout tags/v0.15.0 \
&& npm install
# --------------- # ---------------
# Build App # Build App
# --------------- # ---------------
COPY . .
# Build the Angular application # Build the Angular application
RUN npm run buildfrontend RUN npm run buildfrontend
@ -28,9 +27,13 @@ RUN npm prune --production
# --------------- # ---------------
# Release App # Release App
# --------------- # ---------------
FROM docker.io/almalinux/9-init as runner FROM docker.io/almalinux/9-init
RUN dnf update -y && dnf module -y enable nodejs:18 && dnf install -y nodejs && dnf clean all && rm -fr /tmp/* RUN dnf update -y \
&& dnf module -y enable nodejs:18 \
&& dnf install -y nodejs \
&& dnf clean all \
&& rm -fr /tmp/*
WORKDIR /RTL WORKDIR /RTL
@ -42,6 +45,4 @@ COPY --from=builder /RTL/node_modules/ ./node_modules
EXPOSE 3000 EXPOSE 3000
#ENTRYPOINT ["/sbin/init", "-g", "--"]
CMD ["node", "rtl"] CMD ["node", "rtl"]

View File

@ -0,0 +1,6 @@
#!/bin/sh
#Build command to make container
VER={{rtl_version}}
buildah build -t rtl:$VER -f Containerfile

View File

@ -0,0 +1,20 @@
[Unit]
Description=RTL Web App
[Container]
Image={{ registry_url }}/rtl:{{ rtl_version }}
PodmanArgs=--pod bitcoin-pod
# Use volume
[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900
# ExecStartPre flag and other systemd commands can go here, see systemd.unit(5) man page.
# ExecStartPre=/usr/share/mincontainer/setup.sh
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target

View File

@ -6,6 +6,8 @@
- name: Determine OS variant - name: Determine OS variant
register: variant register: variant
ansible.builtin.shell: grep VARIANT_ID /etc/os-release | sed 's/VARIANT_ID=//g' ansible.builtin.shell: grep VARIANT_ID /etc/os-release | sed 's/VARIANT_ID=//g'
tags: config
- name: Create /etc/sysusers.d directory - name: Create /etc/sysusers.d directory
become: true become: true
become_method: sudo become_method: sudo
@ -136,4 +138,14 @@
length_minutes = {{ update_schedule_length }} length_minutes = {{ update_schedule_length }}
tags: config tags: config
- name: Create pmls / pmlsa alias
ansible.builtin.blockinfile:
path: ~/.bashrc
block: |
alias pmls="podman ps --format {% raw %}'{{.Names}} \t{{.Status}}'{% endraw %}"
alias pmls="podman ps -a --format {% raw %}'{{.Names}} \t{{.Status}}'{% endraw %}"
state: present
create: true
tags: config