From ac8057de9b1027bea74d07970f13a57706d7857a Mon Sep 17 00:00:00 2001 From: "xanhacks@protonmail.com" Date: Mon, 30 Sep 2024 13:48:19 +0200 Subject: [PATCH] init ansible --- .gitignore | 1 + README.md | 2 ++ ansible/challenges.yml | 6 ++++++ ansible/ctfd.yml | 6 ++++++ ansible/group_vars/challenges | 1 + ansible/group_vars/ctfd | 1 + ansible/inventories/dev | 5 +++++ ansible/inventories/prod | 12 ++++++++++++ 8 files changed, 34 insertions(+) create mode 100644 .gitignore create mode 100644 ansible/challenges.yml create mode 100644 ansible/ctfd.yml create mode 100644 ansible/group_vars/challenges create mode 100644 ansible/group_vars/ctfd create mode 100644 ansible/inventories/dev create mode 100644 ansible/inventories/prod diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/README.md b/README.md index 0cbab3c..21d9975 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # HeroCTF All in one +- [terraform/](./terraform/): Deploy our infrastructure, mainly on Linode, AWS and GCP. +- [ansible/](./ansible/): Setup our CTFd and challenges instances. \ No newline at end of file diff --git a/ansible/challenges.yml b/ansible/challenges.yml new file mode 100644 index 0000000..639f129 --- /dev/null +++ b/ansible/challenges.yml @@ -0,0 +1,6 @@ +--- + +- hosts: challenges + gather_facts: yes + roles: + - challs diff --git a/ansible/ctfd.yml b/ansible/ctfd.yml new file mode 100644 index 0000000..41c98e0 --- /dev/null +++ b/ansible/ctfd.yml @@ -0,0 +1,6 @@ +--- + +- hosts: ctfd + gather_facts: yes + roles: + - ctfd diff --git a/ansible/group_vars/challenges b/ansible/group_vars/challenges new file mode 100644 index 0000000..71ee41c --- /dev/null +++ b/ansible/group_vars/challenges @@ -0,0 +1 @@ +challenges_git_url: git@github.com:HeroCTF/HeroCTF_v6.git \ No newline at end of file diff --git a/ansible/group_vars/ctfd b/ansible/group_vars/ctfd new file mode 100644 index 0000000..17800dd --- /dev/null +++ b/ansible/group_vars/ctfd @@ -0,0 +1 @@ +ctfd_version: 3.7.3 \ No newline at end of file diff --git a/ansible/inventories/dev b/ansible/inventories/dev new file mode 100644 index 0000000..53931ff --- /dev/null +++ b/ansible/inventories/dev @@ -0,0 +1,5 @@ +[ctfd] +heroctf-ctfd ansible_connection=ssh ansible_user=root + +[challenges] +heroctf-challenge-1 ansible_connection=ssh ansible_user=root \ No newline at end of file diff --git a/ansible/inventories/prod b/ansible/inventories/prod new file mode 100644 index 0000000..8ef0375 --- /dev/null +++ b/ansible/inventories/prod @@ -0,0 +1,12 @@ +[ctfd] +heroctf-ctfd ansible_connection=ssh ansible_user=root + +[challenges] +heroctf-challenge-1 ansible_connection=ssh ansible_user=root +heroctf-challenge-2 ansible_connection=ssh ansible_user=root +heroctf-challenge-3 ansible_connection=ssh ansible_user=root +heroctf-challenge-4 ansible_connection=ssh ansible_user=root +heroctf-challenge-5 ansible_connection=ssh ansible_user=root +heroctf-challenge-6 ansible_connection=ssh ansible_user=root +heroctf-challenge-7 ansible_connection=ssh ansible_user=root +heroctf-challenge-8 ansible_connection=ssh ansible_user=root \ No newline at end of file