Merge branch 'cleanup'

This commit is contained in:
Stefan Haun 2020-11-25 17:07:22 +01:00
commit 9921054e7e
7 changed files with 38 additions and 30 deletions

View file

@ -3,12 +3,11 @@
Setup
```bash
ansible-galaxy install -r requirements.yml
ansible-galaxy collection install community.general
```
Call with
```bash
ansible-playbook -i inventory httpd.yml
ansible-playbook -i inventory --ask-vault-pass main.yml
```
You need to provide a user with sudo rights.
You need to provide a user with sudo rights and the vault password.

View file

@ -50,10 +50,16 @@
include_tasks: tasks/users.yml
- name: Install Docker
include_tasks: tasks/docker_install.yml
include_role:
name: install-docker
vars:
docker_users: "{{ admin_users }}"
- name: Setup Docker Containers
include_tasks: tasks/docker_setup.yml
- name: Setup Docker Environment
include_tasks: tasks/docker_env.yml
- name: Setup httpd
include_tasks: tasks/httpd.yml
- name: Setup phpmyadmin
include_tasks: tasks/phpmyadmin.yml

View file

@ -0,0 +1,6 @@
---
- name: restart docker
service:
name: docker
state: restarted
enabled: yes

View file

@ -55,14 +55,7 @@
"max-size": "100m"
}
}
register: docker_config
- name: Restart docker for changed configuration
service:
name: docker
state: restarted
enabled: yes
when: docker_config.changed
notify: restart docker
- name: Check current docker-compose version.
command: docker-compose --version
@ -89,4 +82,4 @@
name: "{{ item }}"
groups: docker
append: yes
with_items: "{{ admin_users }}"
with_items: "{{ docker_users }}"

10
tasks/docker_env.yml Normal file
View file

@ -0,0 +1,10 @@
- name: Setup docker network
docker_network:
name: dockernet
driver: bridge
ipam_config:
- subnet: 192.168.0.0/24
gateway: 192.168.0.1
state: present

View file

@ -10,12 +10,7 @@
name: rewrite
state: present
- name: Setup proxy site mysql.adm.netz39.de
include_role:
name: setup-http-site-proxy
vars:
site_name: mysql.adm.netz39.de
proxy_port: 9001
- name: Setup proxy site testredmine.netz39.de
include_role:

View file

@ -1,12 +1,4 @@
- name: Setup docker network
docker_network:
name: dockernet
driver: bridge
ipam_config:
- subnet: 192.168.0.0/24
gateway: 192.168.0.1
state: present
---
- name: Setup phpmyadmin
docker_container:
name: phpmyadmin
@ -22,3 +14,10 @@
PMA_ABSOLUTE_URI: "https://mysql.adm.netz39.de"
published_ports:
- 9001:80
- name: Setup proxy site mysql.adm.netz39.de
include_role:
name: setup-http-site-proxy
vars:
site_name: mysql.adm.netz39.de
proxy_port: 9001