From 812ae572d8c9eb41ee0abf3feaf44faaf7b74328 Mon Sep 17 00:00:00 2001 From: Adrien Luxey Date: Sun, 3 May 2020 14:52:54 +0200 Subject: [PATCH] improved wordpress creation, added host config for docker and logrotate --- deployer/ansible.cfg | 2 +- deployer/group_vars/all/vars.yml | 163 +++++++++--------- deployer/host.yml | 5 + deployer/roles/build/tasks/wordpress.yml | 35 ++-- .../templates/wordpress/nginx/nginx.conf.j2 | 4 +- deployer/roles/deploy/handlers/main.yml | 8 + deployer/roles/deploy/tasks/wordpress.yml | 17 +- deployer/roles/host/files/docker/daemon.json | 8 + deployer/roles/host/files/logrotate.conf | 20 +++ deployer/roles/host/files/logrotate.d/btmp | 7 + deployer/roles/host/files/logrotate.d/nginx | 18 ++ deployer/roles/host/files/logrotate.d/wtmp | 8 + deployer/roles/host/handlers/main.yml | 8 + deployer/roles/host/tasks/docker.yml | 7 + deployer/roles/host/tasks/logrotate.yml | 12 ++ deployer/roles/host/tasks/main.yml | 9 + sites/arvuhez.old/README.md | 13 -- sites/arvuhez.old/docker-compose.yml | 24 --- sites/lexperimental.old/docker-compose.yml | 27 --- sites/lexperimental.old/lexperimental.fr | 44 ----- sites/mts8.old/docker-compose.yml | 52 ------ sites/rennes-des-bois.old/README.md | 13 -- sites/rennes-des-bois.old/docker-compose.yml | 24 --- 23 files changed, 224 insertions(+), 304 deletions(-) create mode 100644 deployer/host.yml create mode 100644 deployer/roles/deploy/handlers/main.yml create mode 100644 deployer/roles/host/files/docker/daemon.json create mode 100644 deployer/roles/host/files/logrotate.conf create mode 100644 deployer/roles/host/files/logrotate.d/btmp create mode 100644 deployer/roles/host/files/logrotate.d/nginx create mode 100644 deployer/roles/host/files/logrotate.d/wtmp create mode 100644 deployer/roles/host/handlers/main.yml create mode 100644 deployer/roles/host/tasks/docker.yml create mode 100644 deployer/roles/host/tasks/logrotate.yml create mode 100644 deployer/roles/host/tasks/main.yml delete mode 100644 sites/arvuhez.old/README.md delete mode 100644 sites/arvuhez.old/docker-compose.yml delete mode 100644 sites/lexperimental.old/docker-compose.yml delete mode 100644 sites/lexperimental.old/lexperimental.fr delete mode 100644 sites/mts8.old/docker-compose.yml delete mode 100644 sites/rennes-des-bois.old/README.md delete mode 100644 sites/rennes-des-bois.old/docker-compose.yml diff --git a/deployer/ansible.cfg b/deployer/ansible.cfg index a1a218c..52b2833 100644 --- a/deployer/ansible.cfg +++ b/deployer/ansible.cfg @@ -4,7 +4,7 @@ transport = ssh [ssh_connection] -# ForwardAgent to forward my SSH key to remote hosts, and be able to pull from gitlab +# ForwardAgent to forward my SSH key to remote hosts, and be able to pull from remote git # ControlMaster to avoid a bug when cloning: https://github.com/ansible/ansible/issues/13876 # ControlPersist for SSH multiplexing "-o ControlPersist=60s" <- Causes user not being added to docker group T_T ssh_args = -o ForwardAgent=yes -o ControlMaster=auto diff --git a/deployer/group_vars/all/vars.yml b/deployer/group_vars/all/vars.yml index 66f9a74..bbf82c2 100644 --- a/deployer/group_vars/all/vars.yml +++ b/deployer/group_vars/all/vars.yml @@ -1,5 +1,8 @@ --- +mysql_root_password: "{{ vault_mysql_root_password }}" +adrien_serenity_password: "{{ vault_adrien_serenity_password }}" + www_path: /vault/www sites_path: /vault/sites @@ -8,91 +11,95 @@ wordpress: checksum: sha1:d5f1e6d7cadd72c11d086a2e1ede0a72f23d993e sites: - - slug: test # Shorthand name to use as directory/file name + # - slug: test # Shorthand name to use as directory/file name + # # The site URL (without www) + # url: test.luxeylab.net + # # Ask nginx to redirect url to www + # # Else, we redirect www to url + # redirect_to_www: no + # # What kind of site is that? + # type: wordpress + # # Subnet addresses + # subnet_cidr_address: 172.27.6.0/24 + # subnet_gateway_ip: 172.27.6.1 + # subnet_nginx_ip: 172.27.6.2 + # subnet_site_ip: 172.27.6.3 + # # MySQL + # mysql_database: wp_test + # mysql_username: wp_test + # mysql_password: "{{ vault_wp_test_mysql_password }}" + + - slug: rdb # Shorthand name to use as directory/file name # The site URL (without www) - url: test.luxeylab.net + url: rennesdesbois.fr + # Ask nginx to redirect url to www + # Else, we redirect www to url + redirect_to_www: yes + # What kind of site is that? + type: wordpress + # Subnet addresses + subnet_cidr_address: 172.27.1.0/24 + subnet_gateway_ip: 172.27.1.1 + subnet_nginx_ip: 172.27.1.2 + subnet_site_ip: 172.27.1.3 + # MySQL + mysql_database: rdb + mysql_username: rdb + mysql_password: "{{ vault_rdb_mysql_password }}" + + - slug: arvuhez # Shorthand name to use as directory/file name + # The site URL (without www) + url: arvuhez.org # Ask nginx to redirect url to www # Else, we redirect www to url redirect_to_www: no # What kind of site is that? type: wordpress # Subnet addresses - subnet_cidr_address: 172.27.6.0/24 - subnet_gateway_ip: 172.27.6.1 - subnet_nginx_ip: 172.27.6.2 - subnet_site_ip: 172.27.6.3 - - mysql_database: wp_test - mysql_username: wp_test - mysql_password: "{{ vault_wp_test_mysql_password }}" + subnet_cidr_address: 172.27.2.0/24 + subnet_gateway_ip: 172.27.2.1 + subnet_nginx_ip: 172.27.2.2 + subnet_site_ip: 172.27.2.3 + # MySQL + mysql_database: arvuhez + mysql_username: arvuhez + mysql_password: "{{ vault_arvuhez_mysql_password }}" - # - slug: rdb # Shorthand name to use as directory/file name - # # The site URL (without www) - # url: rennesdesbois.fr - # # Ask nginx to redirect url to www - # # Else, we redirect www to url - # redirect_to_www: yes - # # What kind of site is that? - # type: wordpress - # # Subnet addresses - # subnet_cidr_address: 172.27.1.0/24 - # subnet_gateway_ip: 172.27.1.1 - # subnet_site_ip: 172.27.1.2 - - # mysql_database: rdb - # mysql_username: rdb - # mysql_password: "{{ vault_rdb_mysql_password }}" + - slug: zinzoscope # Shorthand name to use as directory/file name + # The site URL (without www) + url: zinz.luxeylab.net + # Ask nginx to redirect url to www + # Else, we redirect www to url + redirect_to_www: no + # What kind of site is that? + type: wordpress + # Subnet addresses + subnet_cidr_address: 172.27.3.0/24 + subnet_gateway_ip: 172.27.3.1 + subnet_nginx_ip: 172.27.3.2 + subnet_site_ip: 172.27.3.3 + # MySQL + mysql_database: zinzoscope + mysql_username: zinzoscope + mysql_password: "{{ vault_zinzoscope_mysql_password }}" - # - slug: arvuhez # Shorthand name to use as directory/file name - # # The site URL (without www) - # url: arvuhez.org - # # Ask nginx to redirect url to www - # # Else, we redirect www to url - # redirect_to_www: no - # # What kind of site is that? - # type: wordpress - # # Subnet addresses - # subnet_cidr_address: 172.27.2.0/24 - # subnet_gateway_ip: 172.27.2.1 - # subnet_site_ip: 172.27.2.2 - - # mysql_database: arvuhez - # mysql_username: arvuhez - # mysql_password: "{{ vault_arvuhez_mysql_password }}" - - # - slug: zinzoscope # Shorthand name to use as directory/file name - # # The site URL (without www) - # url: zinz.luxeylab.net - # # Ask nginx to redirect url to www - # # Else, we redirect www to url - # redirect_to_www: no - # # What kind of site is that? - # type: wordpress - # # Subnet addresses - # subnet_cidr_address: 172.27.3.0/24 - # subnet_gateway_ip: 172.27.3.1 - # subnet_site_ip: 172.27.3.2 - - # mysql_database: zinzoscope - # mysql_username: zinzoscope - # mysql_password: "{{ vault_zinzoscope_mysql_password }}" - - # - slug: lexperimental # Shorthand name to use as directory/file name - # # The site URL (without www) - # url: lexperimental.fr - # # Ask nginx to redirect url to www - # # Else, we redirect www to url - # redirect_to_www: no - # # What kind of site is that? - # type: wordpress - # # Subnet addresses - # subnet_cidr_address: 172.27.4.0/24 - # subnet_gateway_ip: 172.27.4.1 - # subnet_site_ip: 172.27.4.2 - - # mysql_database: lexperimental - # mysql_username: lexperimental - # mysql_password: "{{ vault_lexperimental_mysql_password }}" + - slug: lexperimental # Shorthand name to use as directory/file name + # The site URL (without www) + url: lexperimental.fr + # Ask nginx to redirect url to www + # Else, we redirect www to url + redirect_to_www: no + # What kind of site is that? + type: wordpress + # Subnet addresses + subnet_cidr_address: 172.27.4.0/24 + subnet_gateway_ip: 172.27.4.1 + subnet_nginx_ip: 172.27.4.2 + subnet_site_ip: 172.27.4.3 + # MySQL + mysql_database: lexperimental + mysql_username: lexperimental + mysql_password: "{{ vault_lexperimental_mysql_password }}" # - slug: mts # Shorthand name to use as directory/file name # # The site URL (without www) @@ -106,13 +113,9 @@ sites: # subnet_cidr_address: 172.27.5.0/24 # subnet_gateway_ip: 172.27.5.1 # subnet_site_ip: 172.27.5.2 - # # This will allow setting up MySQL # # Configuration on Drupal's side must be done by hand: # # Edit your /sites/default/settings.php # mysql_database: mts8 # mysql_username: mts # mysql_password: "{{ vault_mts_mysql_password }}" - -mysql_root_password: "{{ vault_mysql_root_password }}" -adrien_serenity_password: "{{ vault_adrien_serenity_password }}" \ No newline at end of file diff --git a/deployer/host.yml b/deployer/host.yml new file mode 100644 index 0000000..82df527 --- /dev/null +++ b/deployer/host.yml @@ -0,0 +1,5 @@ +--- +- hosts: serenity + gather_facts: no + roles: + - host \ No newline at end of file diff --git a/deployer/roles/build/tasks/wordpress.yml b/deployer/roles/build/tasks/wordpress.yml index 1b281c5..eb47b24 100644 --- a/deployer/roles/build/tasks/wordpress.yml +++ b/deployer/roles/build/tasks/wordpress.yml @@ -1,4 +1,6 @@ - +##################### +# Create wp-content # +##################### - name: Is it a new install? stat: @@ -83,23 +85,10 @@ when: filetree_item.state == 'file' tags: [docker, nginx] -- name: Copy host config to /etc/nginx/sites-available - copy: - remote_src: yes - src: "{{ sites_path }}/{{ item.slug }}/nginx.host" - dest: "/etc/nginx/sites-available/{{ item.url }}" - become: yes - tags: nginx - - - -# - name: Create Let's Encrypt certificate -# This seems hard, see: -# https://docs.ansible.com/ansible/latest/modules/acme_certificate_module.html#acme-certificate-module -# https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-ansible-on-ubuntu-18-04 -# Maybe using shell directly? e.g. -# certbot certonly --webroot -w /var/www/letsencrypt -d +####################### +# MySQL configuration # +####################### # MySQL equivalent: # create user @ identified by ; @@ -118,3 +107,15 @@ priv: "{{ item.mysql_database }}.*:all" state: present tags: mysql + + +################### +# SSL certificate # +################### + +# - name: Create Let's Encrypt certificate +# This seems hard, see: +# https://docs.ansible.com/ansible/latest/modules/acme_certificate_module.html#acme-certificate-module +# https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-ansible-on-ubuntu-18-04 +# Maybe using shell directly? e.g. +# certbot certonly --webroot -w /var/www/letsencrypt -d diff --git a/deployer/roles/build/templates/wordpress/nginx/nginx.conf.j2 b/deployer/roles/build/templates/wordpress/nginx/nginx.conf.j2 index f83e748..ddb3587 100644 --- a/deployer/roles/build/templates/wordpress/nginx/nginx.conf.j2 +++ b/deployer/roles/build/templates/wordpress/nginx/nginx.conf.j2 @@ -15,8 +15,8 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + set_real_ip_from {{ item.subnet_gateway_ip }}; + log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; diff --git a/deployer/roles/deploy/handlers/main.yml b/deployer/roles/deploy/handlers/main.yml new file mode 100644 index 0000000..fb9c26a --- /dev/null +++ b/deployer/roles/deploy/handlers/main.yml @@ -0,0 +1,8 @@ +--- + +- name: Restart nginx + service: + name: nginx + state: restarted + become: yes + tags: nginx \ No newline at end of file diff --git a/deployer/roles/deploy/tasks/wordpress.yml b/deployer/roles/deploy/tasks/wordpress.yml index 0f6f825..f85517b 100644 --- a/deployer/roles/deploy/tasks/wordpress.yml +++ b/deployer/roles/deploy/tasks/wordpress.yml @@ -6,22 +6,25 @@ restarted: yes tags: docker +- name: Copy host config to /etc/nginx/sites-available + copy: + remote_src: yes + src: "{{ sites_path }}/{{ item.slug }}/nginx.host" + dest: "/etc/nginx/sites-available/{{ item.url }}" + become: yes + notify: Restart nginx + tags: nginx + - name: "Symlink nginx configuration to sites-enabled" file: src: "/etc/nginx/sites-available/{{ item.url }}" dest: "/etc/nginx/sites-enabled/{{ item.url }}" state: link become: yes + notify: Restart nginx tags: nginx - name: Verify nginx configuration command: "nginx -t" become: yes tags: nginx - -- name: Restart nginx service - service: - name: nginx - state: restarted - become: yes - tags: nginx \ No newline at end of file diff --git a/deployer/roles/host/files/docker/daemon.json b/deployer/roles/host/files/docker/daemon.json new file mode 100644 index 0000000..7acc790 --- /dev/null +++ b/deployer/roles/host/files/docker/daemon.json @@ -0,0 +1,8 @@ +{ + "log-driver": "json-file", + "log-opts": { + "max-size": "10m", + "max-file": "5", + "compress": "true" + } +} \ No newline at end of file diff --git a/deployer/roles/host/files/logrotate.conf b/deployer/roles/host/files/logrotate.conf new file mode 100644 index 0000000..cd512cd --- /dev/null +++ b/deployer/roles/host/files/logrotate.conf @@ -0,0 +1,20 @@ +# see "man logrotate" for details +# rotate log files weekly +weekly + +# keep 4 weeks worth of backlogs +rotate 4 + +# create new (empty) log files after rotating old ones +create + +# uncomment this if you want your log files compressed +compress + +# Set a max size of 200MB for any log file before they get rotated +size 100M + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# system-specific logs may be configured here diff --git a/deployer/roles/host/files/logrotate.d/btmp b/deployer/roles/host/files/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/deployer/roles/host/files/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + monthly + create 0660 root utmp + rotate 1 +} diff --git a/deployer/roles/host/files/logrotate.d/nginx b/deployer/roles/host/files/logrotate.d/nginx new file mode 100644 index 0000000..de49a96 --- /dev/null +++ b/deployer/roles/host/files/logrotate.d/nginx @@ -0,0 +1,18 @@ +/var/log/nginx/*.log { + weekly + missingok + rotate 12 + compress + delaycompress + notifempty + create 0640 www-data adm + sharedscripts + prerotate + if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ + run-parts /etc/logrotate.d/httpd-prerotate; \ + fi \ + endscript + postrotate + invoke-rc.d nginx rotate >/dev/null 2>&1 + endscript +} diff --git a/deployer/roles/host/files/logrotate.d/wtmp b/deployer/roles/host/files/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/deployer/roles/host/files/logrotate.d/wtmp @@ -0,0 +1,8 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + monthly + create 0664 root utmp + minsize 1M + rotate 1 +} diff --git a/deployer/roles/host/handlers/main.yml b/deployer/roles/host/handlers/main.yml new file mode 100644 index 0000000..07d9584 --- /dev/null +++ b/deployer/roles/host/handlers/main.yml @@ -0,0 +1,8 @@ +--- + +- name: Restart Docker + service: + name: docker + state: restarted + become: yes + tags: docker \ No newline at end of file diff --git a/deployer/roles/host/tasks/docker.yml b/deployer/roles/host/tasks/docker.yml new file mode 100644 index 0000000..d019380 --- /dev/null +++ b/deployer/roles/host/tasks/docker.yml @@ -0,0 +1,7 @@ +- name: Copy Docker daemon.json + copy: + src: docker/daemon.json + dest: /etc/docker/daemon.json + become: yes + tags: docker + notify: Restart Docker \ No newline at end of file diff --git a/deployer/roles/host/tasks/logrotate.yml b/deployer/roles/host/tasks/logrotate.yml new file mode 100644 index 0000000..204fd5c --- /dev/null +++ b/deployer/roles/host/tasks/logrotate.yml @@ -0,0 +1,12 @@ +- name: "Copy logrotate.conf" + copy: + src: "logrotate.conf" + dest: "/etc/" + become: yes + tags: logrotate +- name: "Copy logrotate.d" + copy: + src: "logrotate.d/" + dest: "/etc/logrotate.d/" + tags: logrotate + become: yes \ No newline at end of file diff --git a/deployer/roles/host/tasks/main.yml b/deployer/roles/host/tasks/main.yml new file mode 100644 index 0000000..9fed2b4 --- /dev/null +++ b/deployer/roles/host/tasks/main.yml @@ -0,0 +1,9 @@ +--- + +- name: Configure logrotate + include_tasks: logrotate.yml + tags: logrotate + +- name: Configure Docker + include_tasks: docker.yml + tags: docker \ No newline at end of file diff --git a/sites/arvuhez.old/README.md b/sites/arvuhez.old/README.md deleted file mode 100644 index 85cc72c..0000000 --- a/sites/arvuhez.old/README.md +++ /dev/null @@ -1,13 +0,0 @@ -## MySQL madness! - -Wordpress's IP is configured to 172.26.0.2 - -Do the MySQL! - -```mysql -select host, user, password from mysql.user order by user; -create user 'arvuhez'@'172.26.0.2' identified by 'kjhs'; -grant all on arvuhez.* to 'arvuhez'@'172.26.0.2'; -show grants for 'arvuhez'@'172.26.0.2'; -``` - diff --git a/sites/arvuhez.old/docker-compose.yml b/sites/arvuhez.old/docker-compose.yml deleted file mode 100644 index 10b7268..0000000 --- a/sites/arvuhez.old/docker-compose.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: '3' - -services: - wp: - image: wordpress:apache - # build: wp/ - restart: always - environment: - WORDPRESS_DB_HOST: 172.26.0.1 - WORDPRESS_DB_USER: arvuhez - WORDPRESS_DB_PASSWORD: "xMnCfZzBs8F3y5pEUY8HWAJFu4DGdBFGJqAcbgJN" - WORDPRESS_DB_NAME: arvuhez - volumes: - - "/vault/www/arvuhez_wp-content/:/var/www/html/wp-content" - networks: - arvuheznet: - ipv4_address: 172.26.0.2 - -networks: - arvuheznet: - ipam: - driver: default - config: - - subnet: 172.26.0.0/16 diff --git a/sites/lexperimental.old/docker-compose.yml b/sites/lexperimental.old/docker-compose.yml deleted file mode 100644 index 9cafa7b..0000000 --- a/sites/lexperimental.old/docker-compose.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: '3' - - -# Generated by ansible for site lexperimental.fr -# At 172.100.0.2 on 172.100.0.0/24 - -services: - wp: - image: wordpress:apache - restart: always - environment: - WORDPRESS_DB_HOST: "172.100.0.1" - WORDPRESS_DB_USER: "lexperimental" - WORDPRESS_DB_PASSWORD: "c2nGCmaRfJfF3Ltw5hoVVXF63Gm2VsVGUTdr4eQT" - WORDPRESS_DB_NAME: "lexperimental" - volumes: ['/var/www/lexperimental/wp-content/:/var/www/html/wp-content'] - - networks: - net: - ipv4_address: "172.100.0.2" - -networks: - net: - ipam: - driver: default - config: - - subnet: "172.100.0.0/24" diff --git a/sites/lexperimental.old/lexperimental.fr b/sites/lexperimental.old/lexperimental.fr deleted file mode 100644 index 0af3cde..0000000 --- a/sites/lexperimental.old/lexperimental.fr +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by ansible for site lexperimental.fr -# At 172.100.0.2 on 172.100.0.0/24 - -server { - listen 80; - listen [::]:80; - server_name lexperimental.fr www.lexperimental.fr; - - rewrite ^ https://lexperimental.fr$request_uri permanent; -} - -server { - listen 443 ssl; - listen [::]:443 ssl; - server_name lexperimental.fr www.lexperimental.fr; - - access_log /var/log/nginx/lexperimental-access.log; - error_log /var/log/nginx/error.log; - - # Let's Encrypt - include snippets/letsencrypt.conf; - - include snippets/ssl-params.conf; - ssl_certificate /etc/letsencrypt/live/lexperimental.fr/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/lexperimental.fr/privkey.pem; - - if ($host = www.lexperimental.fr) { - rewrite ^ https://lexperimental.fr$request_uri permanent; - } - - # Run by host - # root /var/www/lexperimental; - # include snippets/wordpress.conf; - - # Run in Docker - include snippets/header-params_server.conf; - location / { - include snippets/header-params_location.conf; - - proxy_pass http://172.100.0.2:80; - } -} - - diff --git a/sites/mts8.old/docker-compose.yml b/sites/mts8.old/docker-compose.yml deleted file mode 100644 index 9f4e7eb..0000000 --- a/sites/mts8.old/docker-compose.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: '3.7' - -services: - drupal: - image: drupal:8-apache - # No need to expose a port when you know the container's IP - # ports: - # - 8080:80 - volumes: - # this takes advantage of the feature in Docker that a new anonymous - # volume (which is what we're creating here) will be initialized with the - # existing content of the image at the same location - - /var/www/html/modules - - /var/www/html/profiles - # - /var/www/html/sites - # We want a host volume for the themes directory to easily work on theming - - ./themes:/var/www/html/themes - - ./sites:/var/www/html/sites - # Drupal 8 needs Drupal 7 folder to migrate - - "/var/www/mts7:/var/www/mts7" - restart: always - # Fix the container's IP - networks: - drupalnet: - ipv4_address: 172.28.0.2 - - db: - image: mariadb:10 - volumes: - - "mariadb_data:/var/lib/mysql" - restart: always - networks: - drupalnet: - ipv4_address: 172.28.0.3 - environment: - MYSQL_ROOT_PASSWORD: 'qdlkjqsdlkj78YKJHDKJ332' - MYSQL_DATABASE: 'drupal' - MYSQL_USER: 'drupal' - MYSQL_PASSWORD: 'drupaltestsite' - -volumes: - mariadb_data: - driver: local - -networks: - drupalnet: - ipam: - driver: default - config: - - subnet: 172.28.0.0/16 - - diff --git a/sites/rennes-des-bois.old/README.md b/sites/rennes-des-bois.old/README.md deleted file mode 100644 index 5cefe70..0000000 --- a/sites/rennes-des-bois.old/README.md +++ /dev/null @@ -1,13 +0,0 @@ -## MySQL madness! - -Wordpress's IP is configured to 172.26.0.2 - -Do the MySQL! - -```mysql -select host, user, password from mysql.user order by user; -create user 'rdb'@'172.26.0.2' identified by 'kjhs'; -grant all on rdb.* to 'rdb'@'172.26.0.2'; -show grants for 'rdb'@'172.26.0.2'; -``` - diff --git a/sites/rennes-des-bois.old/docker-compose.yml b/sites/rennes-des-bois.old/docker-compose.yml deleted file mode 100644 index 85f7c3a..0000000 --- a/sites/rennes-des-bois.old/docker-compose.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: '3' - -services: - wp: - image: wordpress:apache - # build: wp/ - restart: always - environment: - WORDPRESS_DB_HOST: 172.27.0.1 - WORDPRESS_DB_USER: rdb - WORDPRESS_DB_PASSWORD: "brEuC8KGQEPh4L9rYiwFaDxDB7FVdWLMB3TbgAcz" - WORDPRESS_DB_NAME: rdb - volumes: - - "/vault/www/rdb_wp-content/:/var/www/html/wp-content" - networks: - rdbnet: - ipv4_address: 172.27.0.2 - -networks: - rdbnet: - ipam: - driver: default - config: - - subnet: 172.27.0.0/24