vps/new/playbooks/basic-setup.yml
2023-08-26 19:42:44 +02:00

47 lines
1.4 KiB
YAML

---
- name: Basic Server setup
hosts: all
gather_facts: false
vars:
acme_challenge_type: http-01
acme_directory: https://acme-v02.api.letsencrypt.org/directory
acme_version: 2
acme_email: nilstrieb@gmail.com # don't spam me pls :(
letsencrypt_dir: /etc/letsencrypt
letsencrypt_keys_dir: /etc/letsencrypt/keys
letsencrypt_csrs_dir: /etc/letsencrypt/csrs
letsencrypt_certs_dir: /etc/letsencrypt/certs
letsencrypt_account_key: /etc/letsencrypt/account/account.key
domain_name: vps2.nilstrieb.dev
tasks:
- name: Test ping
ansible.builtin.ping:
- name: Install docker
ansible.builtin.apt:
name: docker.io
state: present
- name: Install nginx
ansible.builtin.apt:
name: nginx
state: present
- name: Ensure nginx is started
ansible.builtin.service:
name: nginx
state: started
- name: Create hello world file
ansible.builtin.copy:
dest: /var/www/html/index.html
content: |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>uwu</title>
</head>
<body>
meow :3
</body>
</html>
mode: u=rw,g=r,o=r