Merge branch 'cleanup'
This commit is contained in:
commit
9921054e7e
7 changed files with 38 additions and 30 deletions
|
@ -3,12 +3,11 @@
|
||||||
Setup
|
Setup
|
||||||
```bash
|
```bash
|
||||||
ansible-galaxy install -r requirements.yml
|
ansible-galaxy install -r requirements.yml
|
||||||
ansible-galaxy collection install community.general
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Call with
|
Call with
|
||||||
```bash
|
```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.
|
||||||
|
|
12
main.yml
12
main.yml
|
@ -50,10 +50,16 @@
|
||||||
include_tasks: tasks/users.yml
|
include_tasks: tasks/users.yml
|
||||||
|
|
||||||
- name: Install Docker
|
- name: Install Docker
|
||||||
include_tasks: tasks/docker_install.yml
|
include_role:
|
||||||
|
name: install-docker
|
||||||
|
vars:
|
||||||
|
docker_users: "{{ admin_users }}"
|
||||||
|
|
||||||
- name: Setup Docker Containers
|
- name: Setup Docker Environment
|
||||||
include_tasks: tasks/docker_setup.yml
|
include_tasks: tasks/docker_env.yml
|
||||||
|
|
||||||
- name: Setup httpd
|
- name: Setup httpd
|
||||||
include_tasks: tasks/httpd.yml
|
include_tasks: tasks/httpd.yml
|
||||||
|
|
||||||
|
- name: Setup phpmyadmin
|
||||||
|
include_tasks: tasks/phpmyadmin.yml
|
||||||
|
|
6
roles/install-docker/handlers/main.yml
Normal file
6
roles/install-docker/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
- name: restart docker
|
||||||
|
service:
|
||||||
|
name: docker
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
|
@ -55,14 +55,7 @@
|
||||||
"max-size": "100m"
|
"max-size": "100m"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
register: docker_config
|
notify: restart docker
|
||||||
|
|
||||||
- name: Restart docker for changed configuration
|
|
||||||
service:
|
|
||||||
name: docker
|
|
||||||
state: restarted
|
|
||||||
enabled: yes
|
|
||||||
when: docker_config.changed
|
|
||||||
|
|
||||||
- name: Check current docker-compose version.
|
- name: Check current docker-compose version.
|
||||||
command: docker-compose --version
|
command: docker-compose --version
|
||||||
|
@ -89,4 +82,4 @@
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
groups: docker
|
groups: docker
|
||||||
append: yes
|
append: yes
|
||||||
with_items: "{{ admin_users }}"
|
with_items: "{{ docker_users }}"
|
10
tasks/docker_env.yml
Normal file
10
tasks/docker_env.yml
Normal 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
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,7 @@
|
||||||
name: rewrite
|
name: rewrite
|
||||||
state: present
|
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
|
- name: Setup proxy site testredmine.netz39.de
|
||||||
include_role:
|
include_role:
|
||||||
|
|
|
@ -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
|
- name: Setup phpmyadmin
|
||||||
docker_container:
|
docker_container:
|
||||||
name: phpmyadmin
|
name: phpmyadmin
|
||||||
|
@ -22,3 +14,10 @@
|
||||||
PMA_ABSOLUTE_URI: "https://mysql.adm.netz39.de"
|
PMA_ABSOLUTE_URI: "https://mysql.adm.netz39.de"
|
||||||
published_ports:
|
published_ports:
|
||||||
- 9001:80
|
- 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
|
Loading…
Reference in a new issue