diff --git a/Vagrantfile b/Vagrantfile index f2e98a9..de828e4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,6 +3,7 @@ Vagrant.configure("2") do |config| config.vm.box = "debian/buster64" + config.vm.network "forwarded_port", host: 8080, guest: 8080 config.vm.synced_folder ".", "/vagrant", disabled: true # Machine Name diff --git a/moxie.yml b/moxie.yml index 583deac..17f30f6 100644 --- a/moxie.yml +++ b/moxie.yml @@ -31,5 +31,10 @@ state: present force_apt_get: true + - name: 'Install Ansible dependency: python-docker' + apt: + name: python-docker + roles: - docker + - wordpress diff --git a/roles/wordpress/tasks/main.yml b/roles/wordpress/tasks/main.yml new file mode 100644 index 0000000..bd10a51 --- /dev/null +++ b/roles/wordpress/tasks/main.yml @@ -0,0 +1,26 @@ +- name: Start MariaDB container + docker_container: + name: mariadb + image: mariadb:10.4.8 + restart_policy: always + volumes: mariadb:/var/lib/mysql + env: + MYSQL_RANDOM_ROOT_PASSWORD: "true" + MYSQL_DATABASE: wordpress + MYSQL_USER: wordpress + MYSQL_PASSWORD: Password1 + +- name: Start WordPress container + docker_container: + name: wordpress + image: wordpress:5.2.3 + restart_policy: always + ports: 8080:80 + volumes: wordpress:/var/www/html + links: + - mariadb + env: + WORDPRESS_DB_NAME: wordpress + WORDPRESS_DB_USER: wordpress + WORDPRESS_DB_PASSWORD: Password1 + WORDPRESS_DB_HOST: mariadb