ansible-debops-infrastructure

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

commit 615463e5208c42422c6f565f3c5e9774209d454b
parent 3c5c6465d493eaf3d2424f57aa416a291b17b874
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Sun, 29 Apr 2018 00:57:33 +0300

plothopes: Init plothopes role, vars and playbook

Diffstat:
ansible/inventory/group_vars/all/docker.yml | 2++
ansible/inventory/group_vars/plothopes/all.yml | 5+++++
ansible/playbooks/plothopes.com | 28++++++++++++++++++++++++++++
ansible/roles/docker/tasks/main.yml | 5+++++
ansible/roles/plothopes.com/tasks/main.yml | 28++++++++++++++++++++++++++++
5 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/ansible/inventory/group_vars/all/docker.yml b/ansible/inventory/group_vars/all/docker.yml @@ -3,3 +3,5 @@ docker__upstream: True docker__tcp: False docker__ferment: True + +docker__volumes_location: '/data/volumes' diff --git a/ansible/inventory/group_vars/plothopes/all.yml b/ansible/inventory/group_vars/plothopes/all.yml @@ -0,0 +1,5 @@ +--- + +plothopes__mysql_root_password: '{{ lookup("password", secret + "/credentials/plothopes.com/mysql/password") }}' +plothopes__private_ip: '192.168.122.4' +plothopes__port: '28080' diff --git a/ansible/playbooks/plothopes.com b/ansible/playbooks/plothopes.com @@ -0,0 +1,28 @@ +--- + +- hosts: docker + become: True + + environment: '{{ inventory__environment | d({}) + | combine(inventory__group_environment | d({})) + | combine(inventory__host_environment | d({})) }}' + + roles: + + - role: debops.secret + + - role: debops.etc_services + tags: [ 'role::etc_services' ] + etc_services__dependent_list: + - '{{ docker__etc_services__dependent_list }}' + + - role: debops.ferm + tags: [ 'role::ferm' ] + ferm__dependent_rules: + - '{{ docker__ferm__dependent_rules }}' + + - role: debops.docker + tags: [ 'role::docker' ] + + - role: docker + - role: plothopes.com diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml @@ -0,0 +1,5 @@ +--- + +- file: + name: "{{ docker__volumes_location }}" + state: directory diff --git a/ansible/roles/plothopes.com/tasks/main.yml b/ansible/roles/plothopes.com/tasks/main.yml @@ -0,0 +1,28 @@ +--- + +- name: plothopes.com mysql docker + docker_container: + name: plothopes-db + image: mysql:5 + state: started + restart_policy: always + pull: true + volumes: + - "{{ docker__volumes_location }}/plothopes-db:/var/lib/mysql" + env: + MYSQL_ROOT_PASSWORD: "{{ plothopes__mysql_root_password }}" + +- name: plothopes.com wordpress docker + docker_container: + name: plothopes-wordpress + image: wordpress + state: started + restart_policy: always + pull: true + ports: + - "{{ plothopes__private_ip }}:{{ plothopes__port }}:80" + volumes: + - "{{ docker__volumes_location }}/plothopes-wp/sparkling:/var/www/html/wp-content/themes/sparkling/" + - "{{ docker__volumes_location }}/plothopes-wp/uploads:/var/www/html/wp-content/uploads/" + - "{{ docker__volumes_location }}/plothopes-wp/plugins:/var/www/html/wp-content/plugins/" + links: plothopes-db:mysql