Skip to content

Instantly share code, notes, and snippets.

location /wp-admin {
# Allow all in 172.168.1.0/24 subnet
allow 172.168.1.0/24;
# Deny for everyone else
deny all;
}
<Location "/wp-admin">
# Allow all in 172.168.1.0/24 subnet
Require host 172.168.1.0/24
</Location>
SSLProtocol TLSv1.2
SSLHonorCipherOrder on
SSLCipherSuite HIGH:!aNULL:!MD5:!3DES
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:!ADH:!AECDH:!MD5;
- name: Import MySQL database
hosts: dbhost
tasks:
- name: Start database import
## Assuming we already have a cnf file created with DB credentials.
shell: "mysql {{ MYSQL_DATABASE }} < /backups/database_dump.sql"
async: 2100
poll: 0
register: import_db
FROM ubuntu:18.04
RUN apt-get update \
&& apt-get install -y nginx \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "daemon off;" >> /etc/nginx/nginx.conf
ADD default /etc/nginx/sites-available/default
---
- hosts: dev-server
gather_facts: no
remote_user: ubuntu
become: yes
tasks:
- name: Install docker and some dependencies
apt:
name: python3-pip, docker.io
state: present
---
all:
children:
dev-server:
hosts: <your remote server ip or hostname>
vars:
drupal_port: 80
nginx_port: 80
mysql_port: 3306
mysql_root_pass: !vault |
---
- hosts: server
gather_facts: no
connection: local
vars:
nginx_port: 82
roles:
- roles/nginx
all:
vars:
nginx_port: 81
children:
server:
hosts: "127.0.0.1"