#
# 
# Automated webserver installation with plesk for captica Webservers
# 
# Project: playbooks
# Author: Marc Böhm <marc.boehm@captica.de>
# License: MIT License (see LICENSE.md)
# 
# Copyright (c) captica GmbH est. 2021
#
- hosts: "git" 
  vars:    
    hostname: git
    tools_install_users:
      - root     
      - ansible
    ssh_pubkeys_root:
      - "../files/ssh/root-lxc.pub"
    ssh_pubkeys_ansible:
      - "../files/ssh/ansible-lxc.pub"
  roles: 
    - linux-base-install
    - zsh
    - vim
    - fzf
    - linux-docker       

- hosts: "git"
  tags: 
    - gitea
    - install
  vars:
    service_name: gitea
    service_directory: /opt/git/gitea
    service_volume_dirs:
      - appdata
      - db
    service_user_name: gitea
    service_user_id: 1020
    service_group_name: gitea
    service_group_id: 1020    
    gitea_version: latest
  tasks:
    - name: "Install gitea application"
      include_tasks: setup-docker-application.yml

- hosts: "git"
  tags: 
    - opengist
    - install
  vars:
    service_name: opengist
    service_directory: /opt/git/opengist
    service_volume_dirs:
      - appdata      
      - config
    service_user_name: opengist
    service_user_id: 1025
    service_group_name: opengist
    service_group_id: 1025
    opengist_version: "lates"
  tasks:
    - name: "Install opengist application"
      include_tasks: setup-docker-application.yml

- hosts: "git"
  tags: 
    - sonarqube
    - install
  vars:
    service_name: sonarqube
    service_directory: /opt/git/sonarqube
    service_volume_dirs:
      - appdata
      - db
    service_user_name: sonarqube
    service_user_id: 1045
    service_group_name: sonarqube
    service_group_id: 1045
    sonarqube_version: "10.6.0-community"
  tasks:
    - name: "Install sonarqube application"
      include_tasks: setup-docker-application.yml