|
- #
- # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
- #
- - name: Unzip algo master.zip
- unarchive:
- src: master.zip
- dest: /root/ansible/roles/algo
-
- - name: Write algo config.cfg.hbs
- copy:
- src: config.cfg.hbs
- dest: /root/ansible/roles/algo/algo/config.cfg.hbs
-
- - name: Install algo_refresh_users script and monitor
- copy:
- src: "{{ item }}"
- dest: "/usr/local/bin/{{ item }}"
- owner: root
- group: root
- mode: 0500
- with_items:
- - "algo_refresh_users.sh"
- - "algo_refresh_users_monitor.sh"
-
- - name: Install algo_refresh_users_monitor supervisor conf file
- copy:
- src: supervisor_algo_refresh_users_monitor.conf
- dest: /etc/supervisor/conf.d/algo_refresh_users_monitor.conf
-
- - name: Write install_algo.sh template
- template:
- src: install_algo.sh.j2
- dest: /root/ansible/roles/algo/algo/install_algo.sh
- owner: root
- group: root
- mode: 0500
-
- - name: Install wg_monitor_connections script
- copy:
- src: wg_monitor_connections.sh
- dest: "/usr/local/sbin/wg_monitor_connections.sh"
- owner: root
- group: root
- mode: 0500
-
- - name: Install wg_monitor_connections supervisor conf file
- copy:
- src: supervisor_wg_monitor_connections.conf
- dest: /etc/supervisor/conf.d/wg_monitor_connections.conf
-
- # Don't setup algo when in restore mode, bubble_restore_monitor.sh will set it up after the CA key has been restored
- - name: Run algo playbook to install algo
- shell: /root/ansible/roles/algo/algo/install_algo.sh
- when: restore_key is not defined
-
- # Don't start monitors when in restore mode, bubble_restore_monitor.sh will start it after algo is installed
- - name: Run algo playbook to install algo
- shell: bash -c "supervisorctl reload && sleep 5s && supervisorctl restart algo_refresh_users_monitor && supervisorctl restart wg_monitor_connections"
- when: restore_key is not defined
-
- - name: Run algo playbook to install algo
- shell: bash -c "supervisorctl reload && sleep 5s && supervisorctl stop algo_refresh_users_monitor && supervisorctl stop wg_monitor_connections"
- when: restore_key is defined
-
- - include: algo_firewall.yml
|