diff --git a/datacoop_hosts b/datacoop_hosts index 55b667f..5fd8e2b 100644 --- a/datacoop_hosts +++ b/datacoop_hosts @@ -1,7 +1,7 @@ ###################################### ### All hosts -10.1.1.198 -10.1.1.199 +10.1.1.198 ansible_python_interpreter=/usr/bin/python3 +10.1.1.199 ansible_python_interpreter=/usr/bin/python3 ###################################### ### Application servers diff --git a/roles/docker/files/composefiles/.gitea.yml.swp b/roles/docker/files/composefiles/.gitea.yml.swp new file mode 100644 index 0000000..cf70f96 Binary files /dev/null and b/roles/docker/files/composefiles/.gitea.yml.swp differ diff --git a/roles/docker/files/composefiles/gitea.yml b/roles/docker/files/composefiles/gitea.yml new file mode 100644 index 0000000..09081f3 --- /dev/null +++ b/roles/docker/files/composefiles/gitea.yml @@ -0,0 +1,38 @@ +version: "2.3" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + environment: + - USER_UID=1000 + - USER_GID=1000 + restart: always + networks: + - gitea + volumes: + - gitea:/data + ports: + - "3000:3000" + - "222:22" + depends_on: + - db + + db: + image: postgres:9.6 + restart: always + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=gitea + - POSTGRES_DB=gitea + networks: + - gitea + volumes: + - postgres:/var/lib/postgresql/data + +volumes: + gitea: + postgres: diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 4670c24..ba626fc 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -15,3 +15,14 @@ apt: name: docker-ce state: present + +- name: install docker python bindings + pip: + executable: "pip3" + name: "{{ item }}" + state: present + with_items: + - docker-compose + +- name: setup services + include_tasks: services.yml diff --git a/roles/docker/tasks/services.yml b/roles/docker/tasks/services.yml new file mode 100644 index 0000000..27baa93 --- /dev/null +++ b/roles/docker/tasks/services.yml @@ -0,0 +1,5 @@ +- name: setup gitea + docker_service: + project_name: gitea + definition: + "{{ lookup('file', 'composefiles/gitea.yml') | from_yaml }}" diff --git a/roles/ubuntu_base/tasks/base.yml b/roles/ubuntu_base/tasks/base.yml index 058ad62..eddff22 100644 --- a/roles/ubuntu_base/tasks/base.yml +++ b/roles/ubuntu_base/tasks/base.yml @@ -1,5 +1,8 @@ --- -- name: Install aptitude if missing +- name: Install necessary packages apt: - name: aptitude - state: present \ No newline at end of file + name: "{{ item }}" + state: present + with_items: + - aptitude + - python3-pip