summaryrefslogtreecommitdiff
path: root/roles/hysteria/tasks/check_hysteria_exists.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/hysteria/tasks/check_hysteria_exists.yaml')
-rw-r--r--roles/hysteria/tasks/check_hysteria_exists.yaml21
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/hysteria/tasks/check_hysteria_exists.yaml b/roles/hysteria/tasks/check_hysteria_exists.yaml
new file mode 100644
index 00000000..3c8f85c7
--- /dev/null
+++ b/roles/hysteria/tasks/check_hysteria_exists.yaml
@@ -0,0 +1,21 @@
+---
+- name: "Check if hysteria is already installed"
+ ansible.builtin.stat:
+ path: /var/reactance/hysteria
+ register: hysteria_directory
+
+- name: "Check if hysteria is configured"
+ ansible.builtin.stat:
+ path: /var/reactance/hysteria/etc/config.json
+ register: hysteria_config
+
+- name: "Install hysteria if directory doesn't exist"
+ ansible.builtin.include_tasks: install_hysteria.yaml
+ when: hysteria_directory.stat.exists == false
+
+- name: "Configure hysteria"
+ ansible.builtin.include_tasks: configure_hysteria.yaml
+ when: hysteria_config.stat.exists == false
+
+- name: "Create hysteria users"
+ ansible.builtin.include_tasks: create_users_hysteria.yaml