Merge branch 'cleanup'
This commit is contained in:
commit
9921054e7e
7 changed files with 38 additions and 30 deletions
|
@ -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.
|
||||
|
|
12
main.yml
12
main.yml
|
@ -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
|
||||
|
|
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"
|
||||
}
|
||||
}
|
||||
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
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
|
||||
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:
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue