Rebase plugin container
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2022-10-15 17:33:12 +02:00
parent c8ec968ab6
commit bda7db0ba0
4 changed files with 55 additions and 16 deletions

View File

@ -3,25 +3,24 @@ type: kubernetes
name: turn name: turn
steps: steps:
- name: Check syntax
image: plugins/ansible:3
settings:
playbook: playbook.yml
inventory: inventory.yml
galaxy: requirements.yml
syntax_check: true
- name: Apply playbook - 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: volumes:
- name: certificates - name: certificates
path: /certificates path: /certificates
settings:
playbook: playbook.yml
inventory: inventory.yml
galaxy: requirements.yml
private_key:
from_secret: ssh_privatekey
volumes: volumes:
- name: certificates - name: certificates

View File

@ -6,5 +6,6 @@
coturn: coturn:
version: 4.6-alpine version: 4.6-alpine
roles: roles:
- common
- dockerhost - dockerhost
- turn - turn

View 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

View File

@ -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: community.docker.docker_container:
name: coturn name: coturn
image: bv11-cr01.bessems.eu/proxy/coturn/coturn:{{ coturn.version }} image: bv11-cr01.bessems.eu/proxy/coturn/coturn:{{ coturn.version }}
@ -11,4 +28,6 @@
--no-tls \ --no-tls \
--realm=dendrite --realm=dendrite
network_mode: host network_mode: host
state: started
restart_policy: unless-stopped restart_policy: unless-stopped
recreate: yes