-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
90 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
github.key | ||
hacker_theme.zip | ||
config.json | ||
# todo: remove this line | ||
challenge.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
|
||
- name: Setup the deploy-dynamic instance | ||
hosts: deploy-dynamic | ||
gather_facts: true | ||
roles: | ||
- prerequisites | ||
- deploy_dynamic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
[ctfd] | ||
heroctf-ctfd ansible_connection=ssh ansible_user=root | ||
|
||
[deploy-dynamic] | ||
heroctf-deploy-dynamic ansible_connection=ssh ansible_user=root | ||
|
||
[static-challenges] | ||
heroctf-static-1 ansible_connection=ssh ansible_user=root | ||
# heroctf-static-1 ansible_connection=ssh ansible_user=root | ||
|
||
[dynamic-challenges] | ||
heroctf-dynamic-1 ansible_connection=ssh ansible_user=root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
challenges_git_url: "[email protected]:HeroCTF/HeroCTF_v6.git" | ||
challenges_install_path: "/home/{{ ctf_user }}/challenges" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ctfd_install_path: "/home/{{ ctf_user }}/CTFd" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
|
||
- name: "Clone deploy-dynamic repository to '{{ deploy_dynamic_install_path }}'" | ||
ansible.builtin.git: | ||
repo: "https://github.com/HeroCTF/deploy-dynamic" | ||
version: "main" | ||
dest: "{{ deploy_dynamic_install_path }}" | ||
accept_hostkey: true | ||
force: true | ||
become: true | ||
become_user: "{{ ctf_user }}" | ||
register: git_challenge_output | ||
changed_when: git_challenge_output.changed | ||
|
||
- name: "Upload 'config.json' & '.env' to '{{ deploy_dynamic_install_path }}'" | ||
ansible.builtin.copy: | ||
src: "files/{{ item }}" | ||
dest: "{{ deploy_dynamic_install_path }}/{{ item }}" | ||
owner: "{{ ctf_user }}" | ||
group: "{{ ctf_user }}" | ||
mode: "0644" | ||
become: true | ||
become_user: "{{ ctf_user }}" | ||
loop: | ||
- "config.json" | ||
- ".env" | ||
|
||
- name: "Upload HTTPs certs to '{{ deploy_dynamic_install_path }}/nginx/certs/'" | ||
ansible.builtin.copy: | ||
src: "files/{{ item }}" | ||
dest: "{{ deploy_dynamic_install_path }}/nginx/certs/{{ item }}" | ||
owner: "{{ ctf_user }}" | ||
group: "{{ ctf_user }}" | ||
mode: "0644" | ||
become: true | ||
become_user: "{{ ctf_user }}" | ||
loop: | ||
- "fullchain.pem" | ||
- "privkey.pem" | ||
|
||
- name: Start deploy-dynamic docker-compose | ||
ansible.builtin.shell: "docker compose up -d --build --force-recreate" | ||
args: | ||
chdir: "{{ deploy_dynamic_install_path }}" | ||
register: docker_compose_output | ||
changed_when: "'recreated' in docker_compose_output.stdout or 'Pulling' in docker_compose_output.stdout" | ||
become: true | ||
become_user: "{{ ctf_user }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deploy_dynamic_install_path: "/home/{{ ctf_user }}/deploy-dynamic" |