mirror of
https://github.com/Expand-sys/DEPLOYCCASH
synced 2025-12-15 21:42:16 +11:00
patch for latest ansible requirements
This commit is contained in:
parent
e4d23a5c18
commit
4d7790a5ee
2 changed files with 13 additions and 18 deletions
|
|
@ -11,11 +11,6 @@
|
||||||
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Refresh packages update
|
|
||||||
ansible.builtin.yum:
|
|
||||||
name: "*"
|
|
||||||
update_cache: true
|
|
||||||
|
|
||||||
- name: Add repository
|
- name: Add repository
|
||||||
ansible.builtin.yum:
|
ansible.builtin.yum:
|
||||||
name: epel-release
|
name: epel-release
|
||||||
|
|
@ -127,7 +122,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
|
when: START_SERVICES == true
|
||||||
|
|
||||||
- name: Clone Web
|
- name: Clone Web
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
|
|
@ -135,26 +130,26 @@
|
||||||
dest: '{{ BUILD_DIR }}/CCash/web'
|
dest: '{{ BUILD_DIR }}/CCash/web'
|
||||||
update: true
|
update: true
|
||||||
force: true
|
force: true
|
||||||
when: WEB_ENABLED = true
|
when: WEB_ENABLED == true
|
||||||
|
|
||||||
- name: "Install Nodejs 18 module"
|
- name: "Install Nodejs 18 module"
|
||||||
ansible.builtin.command: dnf module install -y nodejs:18/common
|
ansible.builtin.command: dnf module install -y nodejs:18/common
|
||||||
register: result
|
register: result
|
||||||
changed_when:
|
changed_when:
|
||||||
- '"Enabling module streams" in result.stdout'
|
- '"Enabling module streams" in result.stdout'
|
||||||
when: ansible_os_family = "RedHat" and WEB_ENABLED = true
|
when: ansible_os_family == "RedHat" and WEB_ENABLED == true
|
||||||
|
|
||||||
- name: Install pm2
|
- name: Install pm2
|
||||||
community.general.npm:
|
community.general.npm:
|
||||||
path: '{{ BUILD_DIR }}/CCash/web'
|
path: '{{ BUILD_DIR }}/CCash/web'
|
||||||
name: pm2
|
name: pm2
|
||||||
global: true
|
global: true
|
||||||
when: WEB_ENABLED = true
|
when: WEB_ENABLED == true
|
||||||
|
|
||||||
- name: Install web dependencies
|
- name: Install web dependencies
|
||||||
community.general.npm:
|
community.general.npm:
|
||||||
path: '{{ BUILD_DIR }}/CCash/web'
|
path: '{{ BUILD_DIR }}/CCash/web'
|
||||||
when: WEB_ENABLED = true
|
when: WEB_ENABLED == true
|
||||||
|
|
||||||
- name: Create .env file
|
- name: Create .env file
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
|
@ -165,7 +160,7 @@
|
||||||
PORT={{ WEB_PORT }}
|
PORT={{ WEB_PORT }}
|
||||||
dest: '{{ BUILD_DIR }}/CCash/web/.env'
|
dest: '{{ BUILD_DIR }}/CCash/web/.env'
|
||||||
mode: 0700
|
mode: 0700
|
||||||
when: WEB_ENABLED = true
|
when: WEB_ENABLED == true
|
||||||
|
|
||||||
- name: Create pm2 file
|
- name: Create pm2 file
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
|
@ -178,7 +173,7 @@
|
||||||
}
|
}
|
||||||
dest: "{{ BUILD_DIR }}/CCash/web/pm2.json"
|
dest: "{{ BUILD_DIR }}/CCash/web/pm2.json"
|
||||||
mode: 0700
|
mode: 0700
|
||||||
when: WEB_ENABLED = true
|
when: WEB_ENABLED == true
|
||||||
|
|
||||||
|
|
||||||
- name: Start webapp service
|
- name: Start webapp service
|
||||||
|
|
@ -186,14 +181,14 @@
|
||||||
chdir: "{{ BUILD_DIR }}/CCash/web"
|
chdir: "{{ BUILD_DIR }}/CCash/web"
|
||||||
cmd: |
|
cmd: |
|
||||||
pm2 start index.js --update-env --name 'CCashFrontend' -f
|
pm2 start index.js --update-env --name 'CCashFrontend' -f
|
||||||
when: START_SERVICES = true and WEB_ENABLED = true
|
when: START_SERVICES == true and WEB_ENABLED == true
|
||||||
|
|
||||||
- name: Enable web app on boot
|
- name: Enable web app on boot
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
chdir: "{{ BUILD_DIR }}/CCash/web"
|
chdir: "{{ BUILD_DIR }}/CCash/web"
|
||||||
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:
|
||||||
|
|
@ -201,7 +196,7 @@
|
||||||
special_time: reboot
|
special_time: reboot
|
||||||
state: present
|
state: present
|
||||||
job: '{{ BUILD_DIR }}/CCash/build/bank {{ ADMIN_A }} {{ SAVE_FREQ }} true'
|
job: '{{ BUILD_DIR }}/CCash/build/bank {{ ADMIN_A }} {{ SAVE_FREQ }} true'
|
||||||
when: START_ON_BOOT = true
|
when: START_ON_BOOT == true
|
||||||
|
|
||||||
- name: Allow firewalld ports
|
- name: Allow firewalld ports
|
||||||
ansible.posix.firewalld:
|
ansible.posix.firewalld:
|
||||||
|
|
@ -214,4 +209,4 @@
|
||||||
permanent: true
|
permanent: true
|
||||||
port: 3000/tcp
|
port: 3000/tcp
|
||||||
state: enabled
|
state: enabled
|
||||||
when: WEB_ENABLED = true
|
when: WEB_ENABLED == true
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ BUILD_DIR: "/root"
|
||||||
ADMIN_A: "admin"
|
ADMIN_A: "admin"
|
||||||
SAVE_FREQ: "2"
|
SAVE_FREQ: "2"
|
||||||
USE_DEPRECATED_ENDPOINTS: "true"
|
USE_DEPRECATED_ENDPOINTS: "true"
|
||||||
WEB_ENABLED: false
|
WEB_ENABLED: true
|
||||||
WEB_PORT: "3000"
|
WEB_PORT: "3000"
|
||||||
CCASH_PORT: 8080
|
CCASH_PORT: 8080
|
||||||
CCASH_PORT_S: 8443
|
CCASH_PORT_S: 8443
|
||||||
START_SERVICES: false
|
START_SERVICES: true
|
||||||
START_ON_BOOT: true
|
START_ON_BOOT: true
|
||||||
BRANCH: "main"
|
BRANCH: "main"
|
||||||
Loading…
Reference in a new issue