You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

---
# Tasks to install goneb as a docker container
- name: goneb | create needed directories
file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: 0777
with_items:
- "{{ goneb_directory }}"
- "{{ goneb_directory }}/data"
- /etc/goneb/
- name: goneb | install config file
template:
src: config.yaml.j2
dest: /etc/goneb/config.yaml
- name: goneb | docker-python
become: true
apt:
name: python3-docker
state: present
- name: goneb | docker started
become: true
service:
name: docker
state: started
- name: goneb | docker network
become: true
docker_network:
name: "{{ goneb_docker_network }}"
state: present
- name: goneb | install and start the app container
become: true
docker_container:
image: matrixdotorg/go-neb:latest
name: goneb
networks:
- name: "{{ goneb_docker_network }}"
published_ports: "{{ goneb_listen_ip }}:{{ goneb_port }}:{{ goneb_port }}"
state: started
restart_policy: always
volumes:
- "{{ goneb_directory }}/data/:/data/"
- /etc/goneb/config.yaml:/data/config.yaml:ro
env:
BASE_URL: "{{ goneb_base_url }}"
CONFIG_FILE: /data/config.yaml
register: _goneb_container
- name: goneb | lookup container IP
command: docker inspect --format '{''{ .NetworkSettings.Networks.{{ goneb_docker_network }}.IPAddress}''}' goneb
register: _goneb_container_ip
- name: goneb | return container IP
set_fact:
goneb_internal_ip: "{{ _goneb_container_ip.stdout }}"