Initial commit

Sam Okafor 1 year ago
commit 703c4b3c773c313469050b0c7a993aff356896cd
5 changed files with 51 additions and 0 deletions
+9-0README.md ADDED
View File
@@ -0,0 +1,9 @@
1+# server-setup
2+
3+Ansible for the glibcode.net servers.
4+
5+```sh
6+ansible-playbook playbook.yml --limit web
7+```
8+
9+Passwords are in `group_vars/all.yml` for now; moving them to Ansible Vault is on the list.
+4-0ansible.cfg ADDED
View File
@@ -0,0 +1,4 @@
1+[defaults]
2+inventory = inventory.ini
3+host_key_checking = False
4+retry_files_enabled = False
+11-0inventory.ini ADDED
View File
@@ -0,0 +1,11 @@
1+[web]
2+web1.glibcode.net ansible_user=deploy ansible_password=K5HqQZCN7bKUaps6!8 ansible_become_pass=K5HqQZCN7bKUaps6!8
3+
4+[db]
5+10.53.10.35 ansible_user=deploy
6+
7+[git]
8+git.glibcode.net
9+
10+[all:vars]
11+ansible_python_interpreter=/usr/bin/python3
+16-0playbook.yml ADDED
View File
@@ -0,0 +1,16 @@
1+---
2+- hosts: all
3+ become: true
4+ roles: [common]
5+
6+- hosts: web
7+ become: true
8+ roles: [nginx, php, backup]
9+
10+- hosts: db
11+ become: true
12+ roles: [mysql]
13+
14+- hosts: git
15+ become: true
16+ roles: [gitea]
+11-0roles/common/tasks/main.yml ADDED
View File
@@ -0,0 +1,11 @@
1+---
2+- name: Base packages
3+ apt:
4+ name: [curl, git, htop, unattended-upgrades, fail2ban]
5+ update_cache: true
6+
7+- name: Deploy user
8+ user:
9+ name: deploy
10+ groups: www-data
11+ shell: /bin/bash