This commit is contained in:
parent
c8ec968ab6
commit
bda7db0ba0
29
.drone.yml
29
.drone.yml
@ -3,25 +3,24 @@ type: kubernetes
|
||||
name: turn
|
||||
|
||||
steps:
|
||||
- name: Check syntax
|
||||
image: plugins/ansible:3
|
||||
settings:
|
||||
playbook: playbook.yml
|
||||
inventory: inventory.yml
|
||||
galaxy: requirements.yml
|
||||
syntax_check: true
|
||||
|
||||
- name: Apply playbook
|
||||
image: plugins/ansible:3
|
||||
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||
commands:
|
||||
- |
|
||||
mkdir ~/.ssh && \
|
||||
echo "$${private_key}" > ~/.ssh/id_rsa && \
|
||||
chmod 0600 ~/.ssh/id_rsa
|
||||
- ansible-galaxy collection install -r requirements.yml
|
||||
- |
|
||||
ansible-playbook \
|
||||
--inventory inventory.yml \
|
||||
playbook.yml
|
||||
environment:
|
||||
private_key:
|
||||
from_secret: ssh_privatekey
|
||||
volumes:
|
||||
- name: certificates
|
||||
path: /certificates
|
||||
settings:
|
||||
playbook: playbook.yml
|
||||
inventory: inventory.yml
|
||||
galaxy: requirements.yml
|
||||
private_key:
|
||||
from_secret: ssh_privatekey
|
||||
|
||||
volumes:
|
||||
- name: certificates
|
||||
|
@ -6,5 +6,6 @@
|
||||
coturn:
|
||||
version: 4.6-alpine
|
||||
roles:
|
||||
- common
|
||||
- dockerhost
|
||||
- turn
|
||||
|
20
roles/common/tasks/main.yml
Normal file
20
roles/common/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
||||
- name: Upgrade all packages
|
||||
ansible.builtin.apt:
|
||||
name: "*"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
|
||||
- name: Check if a reboot is needed
|
||||
ansible.builtin.stat:
|
||||
path: /var/run/reboot-required
|
||||
get_checksum: no
|
||||
register: rebootrequired
|
||||
|
||||
- name: Trigger reboot
|
||||
ansible.builtin.reboot:
|
||||
msg: "Reboot initiated by Ansible due to kernel updates"
|
||||
reboot_timeout: 300
|
||||
pre_reboot_delay: 0
|
||||
post_reboot_delay: 30
|
||||
test_command: uptime
|
||||
when: rebootrequired.stat.exists
|
@ -1,4 +1,21 @@
|
||||
- name: Run coturn container
|
||||
- name: Get current running containers
|
||||
community.docker.docker_host_info:
|
||||
containers: yes
|
||||
register: docker_info
|
||||
|
||||
- name: Stop/Remove all current containers
|
||||
community.docker.docker_container:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
loop: "{{ docker_info.containers | map(attribute='Id') | list }}"
|
||||
|
||||
- name: Prune everything
|
||||
community.docker.docker_prune:
|
||||
containers: yes
|
||||
images: yes
|
||||
volumes: yes
|
||||
|
||||
- name: Start coturn container
|
||||
community.docker.docker_container:
|
||||
name: coturn
|
||||
image: bv11-cr01.bessems.eu/proxy/coturn/coturn:{{ coturn.version }}
|
||||
@ -11,4 +28,6 @@
|
||||
--no-tls \
|
||||
--realm=dendrite
|
||||
network_mode: host
|
||||
state: started
|
||||
restart_policy: unless-stopped
|
||||
recreate: yes
|
||||
|
Loading…
Reference in New Issue
Block a user