73 lines
3.3 KiB
Markdown
73 lines
3.3 KiB
Markdown
# Ansible Playbooks
|
||
|
||
A collection of minimalist Ansible playbooks for automating server setups, based on DigitalOcean's Community guides.
|
||
|
||
- [Initial Server Setup for Ubuntu 18.04](https://github.com/do-community/ansible-playbooks/tree/master/setup_ubuntu1804) *
|
||
- [Apache on Ubuntu 18.04](https://github.com/do-community/ansible-playbooks/tree/master/apache_ubuntu1804)
|
||
- [Postgres on Ubuntu 19.10](https://git.tanshu.com/tanshu/playbooks/src/branch/master/postgres)
|
||
- [Redis on Ubuntu 19.10](https://git.tanshu.com/tanshu/playbooks/src/branch/master/redis)
|
||
- [Bitwarden Ubuntu 19.10](https://git.tanshu.com/tanshu/playbooks/src/branch/master/bitwarden)
|
||
- [Gitea on Ubuntu 19.10](https://git.tanshu.com/tanshu/playbooks/src/branch/master/gitea)
|
||
|
||
_\*the Initial Server Setup should be your starting point for fresh servers._
|
||
|
||
## Playbook Structure
|
||
|
||
Each service gets its own directory. A single-container service uses the flat layout below. A service with more than one container, unit, or stateful volume uses `roles/`. [CODING_STANDARDS.md](CODING_STANDARDS.md) states the rule and the naming conventions.
|
||
|
||
For instance, this is the flat layout:
|
||
|
||
```
|
||
service
|
||
├── files
|
||
│ ├── info.php.j2
|
||
│ └── nginx.conf.j2
|
||
├── vars
|
||
│ └── default.yml
|
||
├── playbook.yml
|
||
└── readme.md
|
||
```
|
||
|
||
|
||
- `files/`: templates and static files the playbook copies or templates.
|
||
- `vars/`: variable files. `default.yml` holds the values the operator sets.
|
||
- `playbook.yml`: the playbook file.
|
||
- `readme.md`: what the playbook deploys, the variables to set, and the command to run it.
|
||
|
||
## Getting Started
|
||
|
||
To set up your Ansible environment, please follow our guide on [How to Install and Configure Ansible on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-18-04).
|
||
|
||
### Connection Test
|
||
|
||
From your local machine or Ansible control node, run:
|
||
|
||
```command
|
||
ansible all -m ping -u remote_user
|
||
```
|
||
|
||
If you're able to get a "pong" reply back from your node(s), your setup works as expected and you'll be able to run both ad-hoc commands and playbooks on your nodes, using Ansible.
|
||
|
||
## Guides
|
||
|
||
The following guides cover how to use the playbooks you'll find in this repository.
|
||
|
||
### Initial Server Setup
|
||
|
||
- [Initial Server Setup for Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-18-04)
|
||
|
||
Once you have executed the initial server setup, you can choose from any of the available server setup playbooks:
|
||
|
||
### Web Servers
|
||
- [Apache on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-apache-on-ubuntu-18-04)
|
||
- [LEMP (Linux, Nginx, MySQL, PHP) on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-lemp-on-ubuntu-18-04)
|
||
- [LAMP (Linux, Apache, MySQL, PHP) on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-lamp-on-ubuntu-18-04)
|
||
|
||
### Applications & CMSs
|
||
|
||
- [WordPress with LAMP on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-wordpress-with-lamp-on-ubuntu-18-04)
|
||
|
||
### Containers & K8s
|
||
- [Docker on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-docker-on-ubuntu-18-04)
|
||
|