wordpress

This commit is contained in:
Janik von Rotz committed 2020-06-17 19:37:42 +02:00
1 parent f51df3b910
commit 771ca97022
17 files changed
+129 -87

No files matched your search

+9
View File
@@ -190,4 +190,13 @@ ROLENAME_admin_password: "{{ vault_ROLENAME_admin_password }}"
ROLENAME_postgres_hostname:
ROLENAME_postgres_user:
ROLENAME_postgres_password: "{{ vault_ROLENAME_postgres_password }}"
# SMTP
ROLENAME_smtp_hostname:
ROLENAME_smtp_auth:
ROLENAME_smtp_secure:
ROLENAME_smtp_port:
ROLENAME_smtp_domain:
ROLENAME_smtp_from:
ROLENAME_smtp_username:
ROLENAME_smtp_password:
```
+7
View File
@@ -6,6 +6,10 @@
- [ ] Install bbb exporter https://github.com/greenstatic/bigbluebutton-exporter
- [ ] Configure nginx role -> map the *.nginx files and include them in the config
## Wordpress
- [ ] Configure sendmail
## Odoo
- [ ] Install etherpad https://github.com/ether/etherpad-lite/blob/develop/doc/docker.md or use pad.odoo.com
@@ -23,8 +27,10 @@
- [x] apollo
- [x] eris
- [x] hera
- [ ] Package upgrader -> if versions do not match, unpin package
- [ ] Update Odoo and apps -> show db names 1.0.1
- [ ] Update Bookstack to 0.29
- [ ] upgrade nginx images -> basic group -> nginx 1.19
## Identity
@@ -95,6 +101,7 @@
# DONE
- [x] Docker packages use package role to install its packages -> include role and override packages
- [x] Test PATH update for crontab -> did not work! -> fixed -> all paths were required
- [x] Configure meta/main.yml dependencies for all projects! See cadvisor and update playbooks
- [x] node-exporter
+1 -22
View File
@@ -3,25 +3,4 @@
roles:
- role: clean
tags:
- nginx
- modsecurity
- keycloak
- kibana
- moodle
- odoo
- odoo-scripts
- nextcloud
- collabora-code
- bookstack
- logstash
- elasticsearch
- metricbeat
- cadvisor
- node-exporter
- prometheus
- grafana
- openldap
- mysql
- postgres
- docker-network
- fathom
- always
+3 -1
View File
@@ -7,19 +7,21 @@
- name: Include letsencrypt install tasks
include: install-letsencrypt.yml
when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04" and bigbluebutton_apt_repo_url
tags:
- bigbluebutton
- bigbluebutton-letsencrypt
- name: Include enable https tasks
include: enable-https.yml
when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04" and bigbluebutton_apt_repo_url
tags:
- bigbluebutton
- bigbluebutton-https
- name: Include greenligh install tasks
include: install-greenlight.yml
when: greenlight_image is defined
when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04" and bigbluebutton_apt_repo_url
tags:
- bigbluebutton
- bigbluebutton-greenlight
+2 -1
View File
@@ -25,4 +25,5 @@
- mysql
- postgres
- docker-network
- odoo-scripts
- odoo-scripts
- wordpress
+7 -1
View File
@@ -2,4 +2,10 @@
docker_container:
name: "{{ mysql_hostname }}"
state: absent
when: mysql_hostname is defined
when: mysql_hostname is defined
- name: "Remove mysql volume {{ mysql_volume_name }}"
docker_volume:
name: "{{ mysql_volume_name }}"
state: absent
when: mysql_volume_name is defined and 'mysql-volume' in ansible_run_tags
+11
View File
@@ -0,0 +1,11 @@
- name: "Remove wordpress container {{ wordpress_hostname }}"
docker_container:
name: "{{ wordpress_hostname }}"
state: absent
when: wordpress_hostname is defined
- name: "Remove wordpress volume {{ wordpress_volume_name }}"
docker_volume:
name: "{{ wordpress_volume_name }}"
state: absent
when: wordpress_volume_name is defined and 'wordpress-volume' in ansible_run_tags
+10 -39
View File
@@ -1,27 +1,8 @@
- name: Install aptitude using apt
apt:
name: "{{ docker_aptitude_package }}"
update_cache: yes
force_apt_get: yes
- name: Unpin docker packages
dpkg_selections:
name: "{{ item }}"
selection: install
loop: "{{ docker_packages }}"
when: "'=' not in item"
- name: Install required docker packages
apt:
name: "{{ item }}"
loop: "{{ docker_packages }}"
- name: Pin docker packages
dpkg_selections:
name: "{{ item.split('=')[0] }}"
selection: hold
loop: "{{ docker_packages }}"
when: "'=' in item"
include_role:
name: package
vars:
packages: "{{ docker_packages }}"
- name: Add Docker GPG apt Key
apt_key:
@@ -33,22 +14,12 @@
repo: "{{ docker_apt_repo }}"
state: present
- name: Unpin docker-ce version
dpkg_selections:
name: "{{ docker_package }}"
selection: hold
when: "'=' not in docker_package"
- name: Update apt and install docker-ce
apt:
update_cache: yes
name: "{{ docker_package }}"
- name: Pin docker-ce version
dpkg_selections:
name: "{{ docker_package.split('=')[0] }}"
selection: hold
when: "'=' in docker_package"
- name: Install required docker packages
include_role:
name: package
vars:
packages:
- "{{ docker_package }}"
- name: Install Docker Module for Python
pip:
-4
View File
@@ -56,10 +56,6 @@
seconds: "10"
when: certbot_certs | json_query(certbot_stat_filter) | list
- name: debug
debug:
var: certbot_issue_certificate
- name: "Remove certbot container {{ certbot_hostname }}"
docker_container:
name: "{{ certbot_hostname }}"
+7 -1
View File
@@ -15,6 +15,12 @@
when: item.msg == 'alias.zeit.co.'
loop: "{{ dig.results }}"
- name: Fail if DNS record points to cname.vercel-dns.com.
fail:
msg: DNS record points to default alias.
when: item.msg == 'cname.vercel-dns.com.'
loop: "{{ dig.results }}"
- name: Include install certbot tasks
include_tasks: install-certbot.yml
when: certbot_image is defined
@@ -65,7 +71,7 @@
name: "{{ nginx_hostname }}"
image: "{{ nginx_image }}"
restart_policy: unless-stopped
recreate: yes
recreate: no
ports:
- "{{ nginx_http_port }}:{{ nginx_http_port }}"
- "{{ nginx_https_port }}:{{ nginx_https_port }}"
+2 -2
View File
@@ -8,7 +8,7 @@ server {
location / {
{% if redirect_hostname %}
return 301 $scheme://{{ redirect_hostname }}$request_uri;
return 301 https://{{ redirect_hostname }}$request_uri;
{% else %}
return 301 https://$host$request_uri;
{% endif %}
@@ -53,7 +53,7 @@ server {
{% if redirect_hostname %}
location / {
return 301 $scheme://{{ redirect_hostname }}$request_uri;
return 301 https://{{ redirect_hostname }}$request_uri;
}
{% endif %}
+13 -2
View File
@@ -15,11 +15,22 @@ packages:
state: absent
```
And include it in your playbook.
Include it in your playbook.
```yml
- hosts: package
roles:
- role: packages
- role: package
tags: package
```
Or include it in another role.
```yml
- name: Install required docker packages
include_role:
name: package
vars:
packages:
- "{{ docker_package }}"
```
+6
View File
@@ -1,3 +1,9 @@
- name: Update apt-get repo and cache
apt:
update_cache: yes
force_apt_get: yes
cache_valid_time: 3600
- name: Unpin packages
dpkg_selections:
name: "{{ item.name }}"
+13 -1
View File
@@ -9,7 +9,19 @@ Configure the role.
**vars.yml**
```yml
wordpress_image: wordpress:php7.4-apache
wordpress_hostname: word01
wordpress_volume_name: word_data01
wordpress_db_hostname: mysql01
wordpress_db_user: wordpress
wordpress_db_password: "{{ vault_wordpress_db_password }}"
wordpress_db_name: wordpress
wordpress_smtp_secure: tls
wordpress_smtp_hostname: mail.example.com
wordpress_smtp_port: "587"
wordpress_smtp_from: noreply@example.com
wordpress_smtp_username: bot@example.com
wordpress_smtp_password: "{{ vault_wordpress_smtp_password }}"
```
And include it in your playbook.
+34 -11
View File
@@ -3,12 +3,6 @@
name: "{{ wordpress_volume_name }}"
when: wordpress_volume_name is defined
- name: Ensure wordpress data dir exists
file:
path: "{{ wordpress_data_dir }}"
state: directory
when: wordpress_data_dir is defined
- name: "Start wordpress container {{ wordpress_hostname }}"
docker_container:
name: "{{ wordpress_hostname }}"
@@ -16,15 +10,44 @@
restart_policy: unless-stopped
recreate: no
env:
GF_SECURITY_ADMIN_USER: "{{ wordpress_admin_user }}"
GF_SECURITY_ADMIN_PASSWORD: "{{ wordpress_admin_password }}"
GF_USERS_ALLOW_SIGN_UP: "false"
WORDPRESS_DB_HOST: "{{ wordpress_db_hostname }}"
WORDPRESS_DB_USER: "{{ wordpress_db_user}}"
WORDPRESS_DB_PASSWORD: "{{ wordpress_db_password }}"
WORDPRESS_DB_NAME: "{{ wordpress_db_name }}"
WORDPRESS_SMTP_HOST: "{{ wordpress_smtp_hostname }}"
WORDPRESS_SMTP_PORT: "{{ wordpress_smtp_port }}"
WORDPRESS_SMTP_SECURE: "{{ wordpress_smtp_secure }}"
WORDPRESS_SMTP_USERNAME: "{{ wordpress_smtp_username }}"
WORDPRESS_SMTP_PASSWORD: "{{ wordpress_smtp_password }}"
WORDPRESS_SMTP_FROM: "{{ wordpress_smtp_from }}"
WORDPRESS_SMTP_FROM_NAME: "{{ wordpress_smtp_from }}"
WORDPRESS_SMTP_AUTH: "true"
volumes:
- "{{ wordpress_volume_name }}:/wordpress"
- "{{ wordpress_data_dir }}/datasource.yml:/etc/wordpress/provisioning/datasource/datasource.yml"
- "{{ wordpress_volume_name }}:/var/www/html"
networks:
- name: "{{ docker_network_name }}"
log_driver: "{{ docker_log_driver }}"
log_options:
max-size: "{{ docker_log_max_size }}"
max-file: "{{ docker_log_max_file }}"
# - name: Upate wordpress config
# blockinfile:
# path: "/var/lib/docker/volumes/{{ wordpress_volume_name }}/_data/wp-mail.php"
# insertafter: "$pop3->quit();"
# marker: "// {mark} ANSIBLE MANAGED BLOCK"
# block: |
# /* SMTP Settings */
# add_action( 'phpmailer_init', 'send_smtp_email' );
# function send_smtp_email( $phpmailer ) {
# $phpmailer->isSMTP();
# $phpmailer->Host = getenv('WORDPRESS_SMTP_HOST');
# $phpmailer->SMTPAuth = getenv('WORDPRESS_SMTP_AUTH');
# $phpmailer->Port = getenv('WORDPRESS_SMTP_PORT');
# $phpmailer->SMTPSecure = getenv('WORDPRESS_SMTP_SECURE');
# $phpmailer->Username = getenv('WORDPRESS_SMTP_USERNAME');
# $phpmailer->Password = getenv('WORDPRESS_SMTP_PASSWORD');
# $phpmailer->From = getenv('WORDPRESS_SMTP_FROM');
# $phpmailer->FromName = getenv('WORDPRESS_SMTP_FROM_NAME');
# }
# notify: Restart wordpress container
+3 -1
View File
@@ -19,4 +19,6 @@
- biglbuebutton-core
- biglbuebutton-letsencrypt
- biglbuebutton-https
- biglbuebutton-greenlight
- biglbuebutton-greenlight
- role: wordpress
tags: wordpress