From 567f537700510a4302c73b1a73a5cdba589fb66d Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Tue, 31 Jul 2018 21:54:07 +0000 Subject: [PATCH] Added support for nfs, removed node versions because node is not needed, added shell code for storage options: digitalocean, gcp, aws, openstack, and ceph --- group_vars/all | 31 +++++++++- .../dokuwiki/templates/docker-compose.yml.j2 | 53 +++++++---------- roles/gitea/templates/docker-compose.yml.j2 | 59 ++++++++++++++----- 3 files changed, 95 insertions(+), 48 deletions(-) diff --git a/group_vars/all b/group_vars/all index abda4c8..beda6e4 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,12 +1,37 @@ --- # Variables listed here are applicable to all host groups +# Software versions docker_compose_version_to_install: 1.18.0 docker_ce_version_to_install: 17.09.1~ce-0~ubuntu -nvm_version: v0.33.5 -node_version: 8.4.0 + +# User stuff default_pub_key: https://raw.githubusercontent.com/jcwimer/ubuntu-template/master/post/id_rsa.pub standard_user: cody git_user: "Jacob Cody Wimer" git_email: "jacob.wimer@gmail.com" -chosen_timezone: "America/New_York" \ No newline at end of file +chosen_timezone: "America/New_York" + +# Persistent storage if you are doing a single machine deploy, local is an option. If you are doing multi instance deploy, choose one of the following: +# nfs +# digitalocean +# gcp +# aws +# openstack +# ceph +# then fill out the variables associated with your choice below +storage_type: "local" + +# nfs variables: these need defined if using nfs storage +#nfs_address: 0.0.0.0 +#nfs_root_path: /some/filepath/on/nfs + +# digitalocean variables: these need defined if using digitalocean storage + +# gcp variables: these need defined if using gcp storage + +# aws variables: these need defined if using aws storage + +# openstack variables: these need defined if using openstack storage + +# ceph variables: these need defined if using ceph storage \ No newline at end of file diff --git a/roles/dokuwiki/templates/docker-compose.yml.j2 b/roles/dokuwiki/templates/docker-compose.yml.j2 index 600c61e..a918ced 100644 --- a/roles/dokuwiki/templates/docker-compose.yml.j2 +++ b/roles/dokuwiki/templates/docker-compose.yml.j2 @@ -1,31 +1,22 @@ -version: '2' -services: - web: - image: gitea/gitea:1.3.2 - volumes: - - ./data:/data - ports: - - "80:3000" - - "2222:22" - restart: always -# setup options: https://docs.gitea.io/en-us/config-cheat-sheet/ -# networks: -# - db -# depends_on: -# - db -# db: -# image: mariadb:10 -# restart: always -# networks: -# - db -# environment: -# - MYSQL_ROOT_PASSWORD=changeme -# - MYSQL_DATABASE=gitea -# - MYSQL_USER=gitea -# - MYSQL_PASSWORD=changeme -# volumes: -# - db/:/var/lib/mysql -#networks: -# db: -#volumes: -# db: \ No newline at end of file +version: '2' +services: + dokuwiki: + image: 'bitnami/dokuwiki:latest' + labels: + kompose.service.type: nodeport + ports: + - '80:80' + - '443:443' + volumes: + - 'dokuwiki_data:/bitnami' +volumes: + dokuwiki_data: + {% if storage_type == 'nfs' %} + driver: local + driver_opts: + type: nfs + o: "addr={{ nfs_address }},soft,nolock,rw" + device: ":{{ nfs_root_path }}/dokuwiki" + {% elif storage_type == 'local' %} + driver: local + {% endif %} \ No newline at end of file diff --git a/roles/gitea/templates/docker-compose.yml.j2 b/roles/gitea/templates/docker-compose.yml.j2 index fc4ccdf..5a48afe 100644 --- a/roles/gitea/templates/docker-compose.yml.j2 +++ b/roles/gitea/templates/docker-compose.yml.j2 @@ -1,14 +1,45 @@ -version: '2' -services: - dokuwiki: - image: 'bitnami/dokuwiki:latest' - labels: - kompose.service.type: nodeport - ports: - - '80:80' - - '443:443' - volumes: - - 'dokuwiki_data:/bitnami' -volumes: - dokuwiki_data: - driver: local \ No newline at end of file +version: '2' +services: + web: + image: gitea/gitea:1.3.2 + volumes: + - gitea_data:/data + ports: + - "80:3000" + - "2222:22" + restart: always + +volumes: + gitea_data: + {% if storage_type == 'nfs' %} + driver: local + driver_opts: + type: nfs + o: "addr={{ nfs_address }},soft,nolock,rw" + device: ":{{ nfs_root_path }}/gitea" + {% elif storage_type == 'local' %} + driver: local + {% endif %} + + +# setup options: https://docs.gitea.io/en-us/config-cheat-sheet/ +# networks: +# - db +# depends_on: +# - db +# db: +# image: mariadb:10 +# restart: always +# networks: +# - db +# environment: +# - MYSQL_ROOT_PASSWORD=changeme +# - MYSQL_DATABASE=gitea +# - MYSQL_USER=gitea +# - MYSQL_PASSWORD=changeme +# volumes: +# - db/:/var/lib/mysql +#networks: +# db: +#volumes: +# db: \ No newline at end of file