allow ccash ports to be set by vars

This commit is contained in:
Expand-sys 2022-12-25 10:01:34 +11:00
parent b74510a113
commit ad3bb2c13b
2 changed files with 9 additions and 5 deletions

View file

@ -70,6 +70,7 @@
chdir: '{{BUILD_DIR}}/CCash/build/' chdir: '{{BUILD_DIR}}/CCash/build/'
cmd: ./bank cmd: ./bank
creates: '{{ BUILD_DIR }}/CCash/config/users.dat' creates: '{{ BUILD_DIR }}/CCash/config/users.dat'
- name: chmod +x ssl.sh - name: chmod +x ssl.sh
ansible.builtin.file: ansible.builtin.file:
mode: u+x mode: u+x
@ -81,12 +82,12 @@
"listeners": [ "listeners": [
{ {
"address": "0.0.0.0", "address": "0.0.0.0",
"port": 80, "port": {{ CCASH_PORT }},
"https": false "https": false
}, },
{ {
"address": "0.0.0.0", "address": "0.0.0.0",
"port": 443, "port": {{ CCASH_PORT_S }},
"https": true, "https": true,
"cert": "{{ BUILD_DIR }}/CCash/config/cert.cert", "cert": "{{ BUILD_DIR }}/CCash/config/cert.cert",
"key": "{{ BUILD_DIR }}/CCash/config/key.key" "key": "{{ BUILD_DIR }}/CCash/config/key.key"
@ -119,6 +120,7 @@
ansible.builtin.command: ansible.builtin.command:
chdir: '{{ BUILD_DIR }}/CCash/build' chdir: '{{ BUILD_DIR }}/CCash/build'
cmd: './bank {{ ADMIN_A }} {{ SAVE_FREQ }} true' cmd: './bank {{ ADMIN_A }} {{ SAVE_FREQ }} true'
when: START_SERVICES == true
- name: Clone Web - name: Clone Web
git: git:
@ -186,6 +188,7 @@
cmd: | cmd: |
pm2 startup pm2 startup
when: START_ON_BOOT == true and START_SERVICES == true and WEB_ENABLED == true when: START_ON_BOOT == true and START_SERVICES == true and WEB_ENABLED == true
- name: enable ccash on boot - name: enable ccash on boot
ansible.builtin.cron: ansible.builtin.cron:
name: CCash enable on boot name: CCash enable on boot
@ -206,4 +209,3 @@
port: 3000/tcp port: 3000/tcp
state: enabled state: enabled
when: WEB_ENABLED == true when: WEB_ENABLED == true

View file

@ -5,6 +5,8 @@ SAVE_FREQ: "2"
USE_DEPRECATED_ENDPOINTS: "true" USE_DEPRECATED_ENDPOINTS: "true"
WEB_ENABLED: true WEB_ENABLED: true
WEB_PORT: "3000" WEB_PORT: "3000"
START_SERVICES: true CCASH_PORT: 8080
CCASH_PORT_S: 8443
START_SERVICES: false
START_ON_BOOT: true START_ON_BOOT: true
BRANCH: "main" BRANCH: "main"