R ansible/deploy.yaml => ansible/deploy-beta.yaml +0 -103
@@ 1,55 1,3 @@
-- name: Deploy bleeding servers
- hosts: starkingdoms_prod_servers_bleeding
- vars:
- # Randomly generated per-deployment secrets
- api_key: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
- jwt_signing_secret: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
-
- # Database info
- db_name: starkingdoms-bleeding
-
- # What version of the docker container should be deployed?
- version: bleeding
-
- ws_port: 3204
- api_port: 3205
- web_port: 3206
-
- api_config_dir: /home/stk-deploy/config
- db_data_dir: /home/stk-deploy/data
- compose_dir: /home/stk-deploy
-
- api_url: https://api.bleeding.starkingdoms.tk
- game_url: https://bleeding.starkingdoms.tk
- tasks:
- - name: Ensure host connectivity
- ansible.builtin.ping:
- - name: Create configuration directory
- ansible.builtin.file:
- path: "{{ api_config_dir }}"
- state: directory
- mode: 0755
- - name: Create data directory
- ansible.builtin.file:
- path: "{{ db_data_dir }}"
- state: directory
- mode: 0755
- - name: Create API config file
- ansible.builtin.template:
- src: ../docker/config.jinja.toml
- dest: "{{ api_config_dir }}/config.toml"
- force: no
- - name: Create docker-compose config file
- ansible.builtin.template:
- src: ../docker/docker-compose.jinja.yml
- dest: "{{ compose_dir }}/docker-compose.yml"
- force: no
- - name: Start the server
- ansible.builtin.shell:
- cmd: docker-compose up -d
- chdir: "{{ compose_dir }}"
-
-
- name: Deploy beta servers
hosts: starkingdoms_prod_servers_beta
vars:
@@ 100,54 48,3 @@
ansible.builtin.shell:
cmd: docker-compose up -d
chdir: "{{ compose_dir }}"
-
-- name: Deploy stable servers
- hosts: starkingdoms_prod_servers_stable
- vars:
- # Randomly generated per-deployment secrets
- api_key: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
- jwt_signing_secret: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
-
- # Database info
- db_name: starkingdoms-bleeding
-
- # What version of the docker container should be deployed?
- version: stable
-
- ws_port: 3204
- api_port: 3205
- web_port: 3206
-
- api_config_dir: /home/stk-deploy/config
- db_data_dir: /home/stk-deploy/data
- compose_dir: /home/stk-deploy
-
- api_url: https://api.starkingdoms.tk
- game_url: https://starkingdoms.tk
- tasks:
- - name: Ensure host connectivity
- ansible.builtin.ping:
- - name: Create configuration directory
- ansible.builtin.file:
- path: "{{ api_config_dir }}"
- state: directory
- mode: 0755
- - name: Create data directory
- ansible.builtin.file:
- path: "{{ db_data_dir }}"
- state: directory
- mode: 0755
- - name: Create API config file
- ansible.builtin.template:
- src: ../docker/config.jinja.toml
- dest: "{{ api_config_dir }}/config.toml"
- force: no
- - name: Create docker-compose config file
- ansible.builtin.template:
- src: ../docker/docker-compose.jinja.yml
- dest: "{{ compose_dir }}/docker-compose.yml"
- force: no
- - name: Start the server
- ansible.builtin.shell:
- cmd: docker-compose up -d
- chdir: "{{ compose_dir }}">
\ No newline at end of file
A ansible/deploy-bleeding.yaml => ansible/deploy-bleeding.yaml +50 -0
@@ 0,0 1,50 @@
+- name: Deploy bleeding servers
+ hosts: starkingdoms_prod_servers_bleeding
+ vars:
+ # Randomly generated per-deployment secrets
+ api_key: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
+ jwt_signing_secret: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
+
+ # Database info
+ db_name: starkingdoms-bleeding
+
+ # What version of the docker container should be deployed?
+ version: bleeding
+
+ ws_port: 3204
+ api_port: 3205
+ web_port: 3206
+
+ api_config_dir: /home/stk-deploy/config
+ db_data_dir: /home/stk-deploy/data
+ compose_dir: /home/stk-deploy
+
+ api_url: https://api.bleeding.starkingdoms.tk
+ game_url: https://bleeding.starkingdoms.tk
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Create configuration directory
+ ansible.builtin.file:
+ path: "{{ api_config_dir }}"
+ state: directory
+ mode: 0755
+ - name: Create data directory
+ ansible.builtin.file:
+ path: "{{ db_data_dir }}"
+ state: directory
+ mode: 0755
+ - name: Create API config file
+ ansible.builtin.template:
+ src: ../docker/config.jinja.toml
+ dest: "{{ api_config_dir }}/config.toml"
+ force: no
+ - name: Create docker-compose config file
+ ansible.builtin.template:
+ src: ../docker/docker-compose.jinja.yml
+ dest: "{{ compose_dir }}/docker-compose.yml"
+ force: no
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/deploy-stable.yaml => ansible/deploy-stable.yaml +51 -0
@@ 0,0 1,51 @@
+
+- name: Deploy stable servers
+ hosts: starkingdoms_prod_servers_stable
+ vars:
+ # Randomly generated per-deployment secrets
+ api_key: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
+ jwt_signing_secret: "{{ lookup('community.general.random_string', base64=True, length=24) }}"
+
+ # Database info
+ db_name: starkingdoms-bleeding
+
+ # What version of the docker container should be deployed?
+ version: stable
+
+ ws_port: 3204
+ api_port: 3205
+ web_port: 3206
+
+ api_config_dir: /home/stk-deploy/config
+ db_data_dir: /home/stk-deploy/data
+ compose_dir: /home/stk-deploy
+
+ api_url: https://api.starkingdoms.tk
+ game_url: https://starkingdoms.tk
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Create configuration directory
+ ansible.builtin.file:
+ path: "{{ api_config_dir }}"
+ state: directory
+ mode: 0755
+ - name: Create data directory
+ ansible.builtin.file:
+ path: "{{ db_data_dir }}"
+ state: directory
+ mode: 0755
+ - name: Create API config file
+ ansible.builtin.template:
+ src: ../docker/config.jinja.toml
+ dest: "{{ api_config_dir }}/config.toml"
+ force: no
+ - name: Create docker-compose config file
+ ansible.builtin.template:
+ src: ../docker/docker-compose.jinja.yml
+ dest: "{{ compose_dir }}/docker-compose.yml"
+ force: no
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/restart-beta.yaml => ansible/restart-beta.yaml +15 -0
@@ 0,0 1,15 @@
+- name: Restart beta servers
+ hosts: starkingdoms_prod_servers_beta
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/restart-bleeding.yaml => ansible/restart-bleeding.yaml +15 -0
@@ 0,0 1,15 @@
+- name: Restart bleeding servers
+ hosts: starkingdoms_prod_servers_bleeding
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/restart-stable.yaml => ansible/restart-stable.yaml +15 -0
@@ 0,0 1,15 @@
+- name: Restart stable servers
+ hosts: starkingdoms_prod_servers_stable
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/restart.yaml => ansible/restart.yaml +15 -0
@@ 0,0 1,15 @@
+- name: Restart all servers
+ hosts: starkingdoms_prod_servers
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/start-beta.yaml => ansible/start-beta.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Start beta servers
+ hosts: starkingdoms_prod_servers_beta
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/start-bleeding.yaml => ansible/start-bleeding.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Start bleeding servers
+ hosts: starkingdoms_prod_servers_bleeding
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/start-stable.yaml => ansible/start-stable.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Start stable servers
+ hosts: starkingdoms_prod_servers_beta
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/start.yaml => ansible/start.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Start all servers
+ hosts: starkingdoms_prod_servers
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Start the server
+ ansible.builtin.shell:
+ cmd: docker-compose up -d
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/stop-beta.yaml => ansible/stop-beta.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Stop beta servers
+ hosts: starkingdoms_prod_servers_beta
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/stop-bleeding.yaml => ansible/stop-bleeding.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Stop bleeding servers
+ hosts: starkingdoms_prod_servers_beta
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/stop-stable.yaml => ansible/stop-stable.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Stop stable servers
+ hosts: starkingdoms_prod_servers_stable
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/stop.yaml => ansible/stop.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Stop all servers
+ hosts: starkingdoms_prod_servers
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop the server
+ ansible.builtin.shell:
+ cmd: docker-compose down
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/update-beta.yaml => ansible/update-beta.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Update beta servers
+ hosts: starkingdoms_prod_servers_beta
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Update the server
+ ansible.builtin.shell:
+ cmd: docker-compose pull
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/update-bleeding.yaml => ansible/update-bleeding.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Update bleeding servers
+ hosts: starkingdoms_prod_servers_bleeding
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Update the server
+ ansible.builtin.shell:
+ cmd: docker-compose pull
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/update-stable.yaml => ansible/update-stable.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Update stable servers
+ hosts: starkingdoms_prod_servers_stable
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Update the server
+ ansible.builtin.shell:
+ cmd: docker-compose pull
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file
A ansible/update.yaml => ansible/update.yaml +11 -0
@@ 0,0 1,11 @@
+- name: Update all servers
+ hosts: starkingdoms_prod_servers
+ vars:
+ compose_dir: /home/stk-deploy
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Update the server
+ ansible.builtin.shell:
+ cmd: docker-compose pull
+ chdir: "{{ compose_dir }}"<
\ No newline at end of file