From 6baf6dcf5ad2cadb871d0ab02c4e3f7458c4624e Mon Sep 17 00:00:00 2001 From: shockrah Date: Fri, 21 Jan 2022 14:48:34 -0800 Subject: [PATCH] + Nginx setup and git tea service installation --- docker-host/setup/tasks/git-stack.yml | 30 ++++++++++++++++++ docker-host/setup/tasks/install-docker.yml | 5 +++ docker-host/setup/tasks/nginx.yml | 36 ++++++++++++++++++++++ docker-host/setup/vars/main.yml | 2 ++ 4 files changed, 73 insertions(+) create mode 100644 docker-host/setup/tasks/git-stack.yml create mode 100644 docker-host/setup/tasks/nginx.yml diff --git a/docker-host/setup/tasks/git-stack.yml b/docker-host/setup/tasks/git-stack.yml new file mode 100644 index 0000000..551cd8c --- /dev/null +++ b/docker-host/setup/tasks/git-stack.yml @@ -0,0 +1,30 @@ +--- +- hosts: leftcoastlab + become: yes + vars: + GITEA_VOLUME: gitea-volume + tasks: + - name: Import Vars required for configuration + include_vars: + dir: ../vars + + - name: Create Gitea Volume + community.docker.docker_volume: + name: "{{GITEA_VOLUME}}" + + - name: Update/Install Git Tea Container Service + community.docker.docker_container: + name: gitea + image: gitea/gitea + pull: yes + restart_policy: always + recreate: yes + volumes: + - "{{GITEA_VOLUME}}:/data" + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "{{GITEA_PUB_PORT}}:3000" + - "{{GITEA_SSH_PORT}}:22" + + diff --git a/docker-host/setup/tasks/install-docker.yml b/docker-host/setup/tasks/install-docker.yml index f6072a8..971f6f8 100644 --- a/docker-host/setup/tasks/install-docker.yml +++ b/docker-host/setup/tasks/install-docker.yml @@ -13,12 +13,17 @@ - gnupg - software-properties-common - lsb-release + - python3-pip - name: Install Docker apt: name: docker.io update_cache: yes + - name: Install Docker Ansible Driver + pip: + name: docker + diff --git a/docker-host/setup/tasks/nginx.yml b/docker-host/setup/tasks/nginx.yml new file mode 100644 index 0000000..9de99fd --- /dev/null +++ b/docker-host/setup/tasks/nginx.yml @@ -0,0 +1,36 @@ +--- +- hosts: leftcoastlab + become: yes + vars: + STATIC_USER: staticweb + tasks: + - name: Install Nginx Package + apt: + name: nginx + update_cache: yes + state: present + + - name: Stop Apache2 Service + systemd: + name: apache2 + state: stopped + enabled: no + + - name: Remove Apache2 + apt: + name: apache2 + state: absent + + - name: website user account + user: + name: "{{STATIC_USER}}" + comment: Static Website maintainer account + state: present + + - name: Create Static web root directory + file: + path: /var/www + state: directory + recurse: yes + owner: "{{STATIC_USER}}" + group: "{{STATIC_USER}}" diff --git a/docker-host/setup/vars/main.yml b/docker-host/setup/vars/main.yml index 138cc87..8cefcd9 100644 --- a/docker-host/setup/vars/main.yml +++ b/docker-host/setup/vars/main.yml @@ -1,3 +1,5 @@ --- # vars file for setup DEBIAN_CODENAME: sid +GITEA_PUB_PORT: 3000 +GITEA_SSH_PORT: 2222