Browse Source

initial import of very basic karma role. more details to come.

main
commit
da2ce8a718
  1. 5
      defaults/main.yml
  2. 43
      tasks/main.yml

5
defaults/main.yml

@ -0,0 +1,5 @@
---
karma_docker_network: karma
karma_listen_ip: "127.0.0.1"
karma_port: 8080

43
tasks/main.yml

@ -0,0 +1,43 @@
---
# Tasks to install karma as docker container
- name: karma | docker-python
become: true
apt:
name: python3-docker
state: present
- name: karma | docker started
become: true
service:
name: docker
state: started
- name: karma | docker network
become: true
docker_network:
name: "{{ karma_docker_network }}"
state: present
- name: karma | install and start the app container
become: true
docker_container:
image: ghcr.io/prymitive/karma:latest
name: karma
networks:
- name: "{{ karma_docker_network }}"
published_ports: "{{ karma_listen_ip }}:{{ karma_port }}:{{ karma_port }}"
state: started
restart_policy: always
env:
ALERTMANAGER_URI="{{ karma_alertmanager_uri }}"
register: _karma_container
- name: karma | lookup container IP
command: docker inspect --format '{''{ .NetworkSettings.Networks.{{ karma_docker_network }}.IPAddress}''}' karma
register: _karma_container_ip
- name: karma | return container IP
set_fact:
karma_internal_ip: "{{ _karma_container_ip.stdout }}"
Loading…
Cancel
Save