diff --git a/README.md b/README.md index 597f5ff..e1cbfd3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Setup ```bash ansible-galaxy install -r requirements.yml +ansible-galaxy collection install community.general ``` Call with diff --git a/main.yml b/main.yml index f945551..2b25a4e 100644 --- a/main.yml +++ b/main.yml @@ -3,6 +3,8 @@ become: true vars: + ansible_python_interpreter: /usr/bin/python3 + server_admin: "admin@netz39.de" admin_users: [tux, alex] @@ -11,6 +13,14 @@ docker_compose_version: "1.25.4" docker_compose_path: /usr/local/bin/docker-compose + mysql_root_pw: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 64313138383833643866383332623265383863623332343864306537633931326139303638303761 + 6464653933613663643632383935376164393033363233330a313063613832396166666464666136 + 36633532393231663634663034666666356332373438646130643161383134653739663066626538 + 3661663132343639310a613431653031626434323064313465373866666332353931313836623465 + 3461 + roles: - role: ansible.timezone @@ -39,8 +49,11 @@ - name: Setup users include_tasks: tasks/users.yml - - name: Setup Docker - include_tasks: tasks/docker.yml + - name: Install Docker + include_tasks: tasks/docker_install.yml + + - name: Setup Docker Containers + include_tasks: tasks/docker_setup.yml - name: Setup httpd include_tasks: tasks/httpd.yml diff --git a/tasks/docker.yml b/tasks/docker_install.yml similarity index 99% rename from tasks/docker.yml rename to tasks/docker_install.yml index 980ae20..38c91bf 100644 --- a/tasks/docker.yml +++ b/tasks/docker_install.yml @@ -42,6 +42,7 @@ vars: packages: - docker-ce + - python-docker - name: Set docker configuration copy: diff --git a/tasks/docker_setup.yml b/tasks/docker_setup.yml new file mode 100644 index 0000000..59fdb63 --- /dev/null +++ b/tasks/docker_setup.yml @@ -0,0 +1,24 @@ +- 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 + state: started + image: phpmyadmin:5.0 + networks_cli_compatible: true + networks: + - name: dockernet + restart_policy: always + env: + PMA_HOST: 192.168.0.1 + MYSQL_ROOT_PASSWORD: "{{ mysql_root_pw }}" + PMA_ABSOLUTE_URI: "https://mysql.adm.netz39.de" + published_ports: + - 9001:80 diff --git a/tasks/httpd.yml b/tasks/httpd.yml index 8b3f71d..1f8ac4c 100644 --- a/tasks/httpd.yml +++ b/tasks/httpd.yml @@ -10,6 +10,12 @@ 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: