diff --git a/README.md b/README.md index 3dd5a16..3850317 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ # DEPLOYCCASH +# Ansible + +CCash can be deployed to any infrastructure able to run Rocky/Alma Linux 8/9 x86_64 virtual or not, we will be eventually updating it to allow it to run on other OS's but for now RHEL is what works. + +As CCash is intended to be run as root, the playbook is run also as root. The playbook also builds CCash from the latest github push, so there may be bugs. + +In order to use the ansible playbook, clone the playbook to any pc with the ability to access the server through SSH and with Ansible installed, edit the inventory file to contain the IP address of the target server and run the following commands: + +```git clone https://github.com/Expand-sys/DEPLOYCCASH``` + +```cd DEPLOYCCASH``` + +```ansible-playbook -i inventory main.ansible.yml -k``` + +When this is complete the server will have ccash installed to the user dir, this is customizable in the vars/default.yml file along with the admin username and save frequency. +To start CCash you can CD into the directory CCash is installed then run ./build/bank {ADMIN ACCOUNT} {SAVE FREQUENCY} true +replacing {ADMIN ACCOUNT} with your admin account username and {SAVE FREQUENCY} with the amount of minutes you want to wait for the bank to autosave. +true just means that the server will be run in daemon mode and will run as a background process + diff --git a/inventory b/inventory index 949fe01..0ed1766 100644 --- a/inventory +++ b/inventory @@ -1,2 +1,2 @@ [all] -54.38.56.147 ansible_ssh_user=root ansible_ssh_common_args='-o StrictHostKeyChecking=no' \ No newline at end of file +127.0.0.1 ansible_ssh_user=root ansible_ssh_common_args='-o StrictHostKeyChecking=no' \ No newline at end of file diff --git a/main.ansible.yml b/main.ansible.yml index 3092b4c..aab7cb4 100644 --- a/main.ansible.yml +++ b/main.ansible.yml @@ -154,7 +154,7 @@ - name: Create .env file ansible.builtin.copy: content: | - BANKAPIURL={{ ansible_facts["all_ipv4_addresses"][0] }} + BANKAPIURL=http://127.0.0.1:{{ CCASH_PORT }} SECURE=true SETUP=true PORT={{ WEB_PORT }} @@ -201,7 +201,12 @@ - name: Allow firewalld ports ansible.posix.firewalld: permanent: true - port: 443/tcp + port: '{{ CCASH_PORT }}/tcp' + state: enabled + - name: Allow firewalld ports + ansible.posix.firewalld: + permanent: true + port: '{{ CCASH_PORT_S }}/tcp' state: enabled - name: Allow firewalld ports