- name: dokos | install | install bench become: yes become_user: "{{ dokos_user }}" shell: > bash -ci " bench init frappe-bench --frappe-path https://gitlab.com/dokos/dodock --frappe-branch {{ dodock_tag }} --python /usr/local/bin/python3.10 --no-procfile" args: creates: "/home/{{ dokos_user }}/frappe-bench" chdir: /home/{{ dokos_user }} - name: dokos | install | bench setup config become: yes become_user: "{{ dokos_user }}" command: bench setup config args: creates: "/home/{{ dokos_user }}/frappe-bench/sites/common_site_config.json" chdir: /home/{{ dokos_user }}/frappe-bench - name: dokos | install | get-app become: yes become_user: "{{ dokos_user }}" command: bench get-app erpnext https://gitlab.com/dokos/dokos --branch {{ dokos_tag }} args: creates: "/home/{{ dokos_user }}/frappe-bench/apps/erpnext" chdir: /home/{{ dokos_user }}/frappe-bench - name: dokos | install | get-app payments become: yes become_user: "{{ dokos_user }}" command: bench get-app https://gitlab.com/dokos/payments --branch v3.x.x args: creates: "/home/{{ dokos_user }}/frappe-bench/apps/payments" chdir: /home/{{ dokos_user }}/frappe-bench # - name: dokos | install | get-app hrms # become: yes # become_user: "{{ dokos_user }}" # command: bench get-app https://gitlab.com/dokos/hrms --branch v3.x.x # args: # creates: "/home/{{ dokos_user }}/frappe-bench/apps/hrms" # chdir: /home/{{ dokos_user }}/frappe-bench - name: dokos | install | new-site become: yes become_user: "{{ dokos_user }}" command: > bench new-site {{ site_fqdn }} --admin-password '{{ admin_password }}' --mariadb-root-password '{{ mysql_root_password }}' args: creates: "/home/{{ dokos_user }}/frappe-bench/sites/{{ site_fqdn }}" chdir: /home/{{ dokos_user }}/frappe-bench # no_log: yes # diff: no - name: dokos | install | install-app become: yes become_user: "{{ dokos_user }}" shell: bench --site {{ site_fqdn }} install-app erpnext args: creates: "/home/{{ dokos_user }}/frappe-bench/sites/apps.txt" chdir: /home/{{ dokos_user }}/frappe-bench # - name: dokos | install | install-app # become: yes # become_user: "{{ dokos_user }}" # shell: bench --site {{ site_fqdn }} install-app hrms # args: # creates: "/home/{{ dokos_user }}/frappe-bench/sites/apps.txt" # chdir: /home/{{ dokos_user }}/frappe-bench - name: dokos | install | bench setup redis become: yes become_user: "{{ dokos_user }}" command: bench setup redis args: creates: "/home/{{ dokos_user }}/frappe-bench/redis_cache.conf" chdir: /home/{{ dokos_user }}/frappe-bench - name: dokos | install | bench setup nginx become: yes become_user: "{{ dokos_user }}" command: bench setup nginx --logging site --log_format combined args: creates: "/home/{{ dokos_user }}/frappe-bench/nginx.conf" chdir: /home/{{ dokos_user }}/frappe-bench - name: dokos | install | setup nginx file: src: "/home/{{ dokos_user }}/frappe-bench/config/nginx.conf" dest: /etc/nginx/conf.d/frappe-bench.conf state: link notify: nginx restart - name: dokos | install | allow http in ufw ufw: rule: allow port: "80" from_ip: "{{ trust_proxy }}" proto: tcp - name: dokos | install | install systemd rules command: bench setup systemd --user dokos-user --yes args: creates: "/home/{{ dokos_user }}/frappe-bench/config/systemd" chdir: /home/{{ dokos_user }}/frappe-bench - name: dokos | install | list systemd rules find: paths: /home/{{ dokos_user }}/frappe-bench/config/systemd/ file_type: file patterns: - '*.target' - '*.service' register: systemd_list - name: dokos | install | deploy systemd rules file: src: "{{ item.path }}" dest: /etc/systemd/system/{{ item.path | basename }} state: link loop: "{{ systemd_list.files }}" notify: frappe restart