Johannes Rothe 649e48930e
Add ansible roles and playbook to setup LEMP stack
Ansible roles added:
 * nginx
 * php
 * mysql
 * wordpress

Additionally adds a Vagrantfile to setup two machines using the new
playbook for testing.
2023-08-17 20:54:40 +02:00

40 lines
864 B
YAML

---
- name: Download wordpress archive
ansible.builtin.get_url:
url: https://de.wordpress.org/latest-de_DE.tar.gz
dest: /tmp/wordpress.tar.gz
- name: Extract wordpress
ansible.builtin.unarchive:
src: /tmp/wordpress.tar.gz
dest: "{{ wordpress.dir | dirname }}"
remote_src: true
become: true
- name: Add wordpress group
ansible.builtin.group:
name: wordpress
become: true
- name: Add wordpress user
ansible.builtin.user:
name: wordpress
group: www-data
become: true
- name: Add wordpress config
ansible.builtin.template:
src: "wp-config.php.j2"
dest: "{{ wordpress.dir }}/wp-config.php"
become: true
- name: Change ownership of wordpress installation
ansible.builtin.file:
path: "{{ wordpress.dir }}"
owner: wordpress
group: www-data
state: directory
recurse: true
become: true